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

Filled hebrew characters unable to render unless clicked #688

Closed
dfrancoS37 opened this issue Dec 1, 2020 · 4 comments
Closed

Filled hebrew characters unable to render unless clicked #688

dfrancoS37 opened this issue Dec 1, 2020 · 4 comments

Comments

@dfrancoS37
Copy link

dfrancoS37 commented Dec 1, 2020

I'm having an issue when filling in fields with hebrew characters. Works OK for english (latin) & russian (cyrillic).

Because I may have non-latin characters, I am embedding the Ubuntu font in the pdfDoc as recommended https://www.npmjs.com/package/pdf-lib#creating-and-filling-forms.

After the document is filled in, the english & russian values are clearly visible. Hebrew characters are not. They are empty boxes. But when clicked, the value is clearly shown. When clicked outside the textfield, the value goes back to boxes. If I click inside the box and modify the value, like adding a space, the value remains visible even after clicking outside the field.

Example PDF file: Consent_Form_pdf-lib_Completed.pdf

test_pdf-lib.zip

Additional Info:

The results are inconsistent with different viewers.

  • Apple Preview (on macBook): Results are as reported above.
  • Safari: Hebrew is empty boxes until clicked. Remains viewable when clicked outside textfield.
  • Chrome: Results are as Apple Preview, but when hebrew viewable, it's backwards (LTR).
  • Adobe Acrobat Reader: Hebrew is empty boxes. When clicked, the boxes change to dots. Clicking outside textfield changes back to boxes.
  • Confluence viewer: Results remain empty boxes

Is PDF viewer inconsistency an issue which needs to be taken into consideration? Is there a preferred viewer?
Thank you, Dan

@vlio20
Copy link

vlio20 commented Dec 30, 2020

@dfrancoS37 did you embed any specific font?

@Hopding
Copy link
Owner

Hopding commented Jan 2, 2021

Hello @dfrancoS37!

Sounds like there's a problem with the way pdf-lib or @pdf-lib/fontkit is processing the custom font you're embedding. This crops up occasionally for some users (see https://github.com/Hopding/pdf-lib/issues?q=is%3Aissue+font).

This issue may be related to #726.

@Hopding
Copy link
Owner

Hopding commented Jan 2, 2021

@dfrancoS37 What happens if you try to just draw the those characters somewhere on the page with PDFPage.drawText?

@dfrancoS37
Copy link
Author

Hi @Hopding & @vlio20 Thank you for following up. I'm not working on this anymore, but my colleague was able to get this working by embedding the DejaVuSans.ttf font.

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

No branches or pull requests

3 participants