Hi,

I only remember that we always advise to never embed font subsets in AcroForm fields. Your subsetted file doesn't have the actual subset fonts.

Does this effect also happen when you don't flatten? And if you save first, then reload and flatten?

Tilman

On 05.01.2024 08:41, Congwei Ni wrote:

Hi Apache PDFBox Team,

I am currently working with PDFBox 3.0.1 for filling AcroForm fields in my PDF files, with Chinese characters. In my attempts, I've loaded the SimSun.ttf Chinese font into the file and set embed subset to false. While this approach successfully fills the Chinese characters, the resultant PDF file size is significantly large, which does not meet my requirements.

When I set embed subset to true, the file size is reduced, and the PDF displays correctly on my Mac. However, on Windows, the embedded Chinese characters in the same file appear as garbled text. Notably, the same SimSun.ttf font is installed on both systems.

I am seeking advice on how to meet the following requirements:

1. Correctly embed Chinese characters into AcroForm fields, ensuring they display accurately across most systems without any encoding issues.

2. Keep the final PDF file size under 500KB.


To illustrate my issue, I have attached the following items to this google drive:

https://drive.google.com/drive/folders/1vUiKt_Z1z7CwgIaL73Jki_FmAZIWOw1c?usp=drive_link

1. A PDF file generated with embed subset set to true.

2. A PDF file generated with embed subset set to false.

3. The source code I am using for embedding the font and filling the form.

4. SimSun.ttf I am using

Could you please provide guidance or suggest alternative methods to achieve these objectives? Any sample code would be greatly appreciated.


Thank you for your assistance.

Best regards,

Congwei


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

Reply via email to