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

Cyrillic letters in pdf form #25

Closed
smirninini opened this issue Mar 8, 2015 · 8 comments
Closed

Cyrillic letters in pdf form #25

smirninini opened this issue Mar 8, 2015 · 8 comments

Comments

@smirninini
Copy link

How to make correct fill in pdf forms with cyrillic and other letters?

@jkraemer
Copy link
Owner

jkraemer commented Mar 9, 2015

Use the XFdf data format which supports UTF-8. See the README and #10

@jkraemer jkraemer closed this as completed Mar 9, 2015
@dpaluy
Copy link

dpaluy commented Mar 26, 2015

@pavlentio Did it work after adding XFdf option? I tried it without success. My pdftk version is 2.02.
@jkraemer Is there anything else I should pay an attention to?

@smirninini
Copy link
Author

yep, i got it work, but add some code.
The reason for this is that pdftk doesn't have Cyrillic fonts. So it can't create the visual appearance for your text.
You can download my from my branch and use it. https://github.com/Pavlentio/pdf-forms.git it has by default option need_appearances => true by to use non english letters. It doesn't work with flatten option.

@jkraemer
Copy link
Owner

Are you sure you embedded all the necessary fonts into the pdf form when creating it? There are certain size optimization options in Acrobat which may lead to missing fonts / characters. Afaik pdftk cannot add any fonts to a form when filling it out, it depends on the fonts already embedded.

@smirninini
Copy link
Author

Author of pdftk answered me:

Hello-

Thank you for your email.

Try appending the option "need_appearances" at the end of your pdftk command. From the manual:

Sets a flag that cues Reader/Acrobat to generate new field appearances based on the form field values. Use this when filling a form with non-ASCII text to ensure the best presentation in Adobe Reader or Acrobat. It won't work when combined with the flatten option.

The reason for this is that pdftk doesn't have Cyrillic fonts. So it can't create the visual appearance for your text. By adding need_appearances, Reader/Acrobat will create the appearance after the PDF is opened.

Regards-

Sid Steward
PDF Labs

On 03/09/2015 04:10 AM, Павел Смирнов wrote:
Hi, I have some strange error like in Java plugin that I used before for my App, and developers solve it: when you use fill_form command and put data via xfdf-file with non-Latin letters ( Cyrillic letters in my way ), they will not be visible in fields while field not active. It will be cool to make an issue. I use Mac OS. Thank you.

С уважением,
Павел Смирнов.

27 марта 2015 г., в 3:39, Jens Krämer notifications@github.com написал(а):

Are you sure you embedded all the necessary fonts into the pdf form when creating it? There are certain size optimization options in Acrobat which may lead to missing fonts / characters. Afaik pdftk cannot add any fonts to a form when filling it out, it depends on the fonts already embedded.


Reply to this email directly or view it on GitHub.

I think that standard fonts must work good with need_appearances option.

@dpaluy
Copy link

dpaluy commented Mar 28, 2015

Thank you all. But currently I get a Java exception (pdftk related)

Unhandled Java Exception in create_output():
java.lang.ArrayIndexOutOfBoundsException: 0
   at pdftk.com.lowagie.text.pdf.DocumentFont.fillEncoding(pdftk)
   at pdftk.com.lowagie.text.pdf.DocumentFont.doType1TT(pdftk)
   at pdftk.com.lowagie.text.pdf.DocumentFont.<init>(pdftk)
   at pdftk.com.lowagie.text.pdf.AcroFields.getAppearance(pdftk)
   at pdftk.com.lowagie.text.pdf.AcroFields.setField(pdftk)
   at pdftk.com.lowagie.text.pdf.AcroFields.setFields(pdftk)

I am waiting for response from Sid Steward

@xinlangzi
Copy link

@dpaluy

Have you overcome this problem?

@dpaluy
Copy link

dpaluy commented May 6, 2018

@xinlangzi I didn't.
My project requirements were changed, so I didn't solve it, that time.

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

4 participants