Hi,

This is related to a known problem, that the font subsetting is done when saving. So try saving to a dummy, e.g. to a ByteArrayOutputStream.

I would like to know whether that works, or whether you have to always reload, so that the documentation can be improved.

Tilman

Am 07.08.2020 um 00:34 schrieb Support:
I am using the org.apache.pdfbox.multipdf.Overlay class to add a watermark to an 
existing PDF file. The watermark contains the name of the customer and therefore can 
contain a wide range of characters. To accommodate that I am embedding the 
NotoSansCJKtc-Regular.ttf font in the overlay document. (If I write the overlay 
document to a file the font is embedded as expected). However, when I use 
Overlay.overlayDocuments(Map<Integer,PDDocument>) the resulting file does not 
embed the font.

How the resulting PDF file is displayed depends on the PDF viewer and on 
whether the font happens to be installed on the system. Sometimes helpful 
warnings are produced (Acrobat if the font is not installed), sometimes the 
overlay text is displayed with what appears to random characters and random 
font (Google Chrome) and sometimes everything is shown beautifully.

Can anyone direct me to how I can get the true type font embedded in the 
PDDocument created by overlayDocuments? What part am I missing? I will gladly 
provide some sample code / documents if there is obvious answer.

Thanks,

  - Rainer



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to