Question

I am using a custom font (TTF) in my Java application where i set the font into graphics and do some DrawText.

Currently I use Font.createFont() to load the custom TTF font. But When i try to print the graphics canvas into a Virtual PDF Printer(PDFCreator Virtual printer), only the fonts installed in my Windows comes as actual text. The custom font i loaded is rasterized while printing. So my custom font texts are not selectable in the produced PDF.

Is there any way to avoid this? Does anyone know what is the difference between setting a installed font to the canvas and setting the Custom font created using Font.CreateFont to the canvas.

Was it helpful?

Solution

I think no way to fix this. It's somewhere in the Virtual PDF library. It tries to render with font and if font is not available it draws the letters.

From my experience of using IText you can add custom font to the generated PDF. So try to use another PDF generator.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top