Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form fields containing diacritics not displaying correctly #773

Closed
bretwalker opened this issue Jan 11, 2024 · 3 comments
Closed

Form fields containing diacritics not displaying correctly #773

bretwalker opened this issue Jan 11, 2024 · 3 comments
Assignees

Comments

@bretwalker
Copy link

Using:
pdfcpu: v0.6.0 dev
commit: e33b502 (2023-12-13T10:22:47Z)
base : go1.21.0

On macOS 13.6 (22G120)

When I populate a form with text containing text with diacritics, it is not rendered properly in Adobe Acrobat Pro 2023.008.20458 when opened. The text does appear as expected once I click on the form field in Acrobat Pro.

Screenshot 2024-01-11 at 10 14 37 AM Screenshot 2024-01-11 at 10 14 44 AM

If I edit populate the form using either Acrobat or macOS Preview using the same text as is in the JSON, the file opens as expected in Acrobat.

out.json
populated.out.json
template-pl.pdf
template.pdf

@hhrutter
Copy link
Collaborator

hhrutter commented Jan 12, 2024

This may not be obvious but when filling you have to ensure all characters you fill are represented in the fill font which any PDF may set explicitly.

That is the reason for some characters not being displayed.

@hhrutter
Copy link
Collaborator

hhrutter commented Feb 7, 2024

The cause of this is that this PDF form defines the fill font to be a Type 1 core font.
For fill strings containing code points above 0xFF this results in these characters to disappear because they can't be represented by any glyph.

The solutions for this is embedding a font which contains these missing glyphs.

@hhrutter
Copy link
Collaborator

This is fixed with latest commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants