Hi,

It's not possible and yes, it's a weakness. I think I had some wild hack years ago that needed a change in PDFBox itself but I can't find it anymore.

What might work if you can build from source: expand PDTextField so you can pass a font (which you create with the subset flag on); pass this font to AppearanceGeneratorHelper; there change the line "PDFont font = defaultAppearance.getFont();"; when done with the font, call font.subset().

Tilman

On 30.05.2024 17:36, Anil Basavaraju wrote:
Hi Pdfbox team,

We have a requirement to prefill the pdf with different languages including CJK 
(Chinese, Japanese, Korean) and some special characters.
So we embedded arial-unicode-ms.ttf with pdfbox. The ttf file is about 22.7 MB. 
We are able to prefill the pdf form with the languages and special characters.
But the issue is the size of the pdf file becomes around 27 MB. Before 
prefilling the pdf file size is around 2 MB.
We need to upload this pdf file after prefilling, which is taking more time 
which is not a good user experience.
Is there any way where we can reduce the pdf file size using pdfbox?

Note: If we use any other font/ttf file which is smaller in size, it is not 
supporting CJK.

Thanks,
Anil



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

Reply via email to