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

UTF-8 chars are not displayed in the filled PDF #53

Closed
oki opened this issue Jul 27, 2016 · 3 comments
Closed

UTF-8 chars are not displayed in the filled PDF #53

oki opened this issue Jul 27, 2016 · 3 comments

Comments

@oki
Copy link

oki commented Jul 27, 2016

Hi,

I have test pdf: http://s000.tinyupload.com/?file_id=77431117353383489288

I am filling in data with small script:

require "pp"

template_file = File.join(Rails.root, "form_example.pdf")
output_file = "output.pdf"

pdftk = PdfForms.new(`which pdftk`.chomp, utf8_fields: false, data_format: "XFdf")

pp pdftk.get_field_names template_file

pdf_data = {
  "name" => "różowy słoń ma usiąść na tępych gwoździach"
}

pdftk.fill_form template_file, output_file, pdf_data

After run got: http://take.ms/DrupC all utf8 letters dissapear (except ó)
Also attached generated pdf file: http://s000.tinyupload.com/index.php?file_id=32840734551043583650

Any idea what the problem is here? Why UTF-8 chars are not displayed?
Thanks for any help or experience.

@jkraemer
Copy link
Owner

Running pdftk output.pdf dump_data_fields_utf8 yields the following result:

---
FieldType: Text
FieldName: name
FieldFlags: 0
FieldValue: różowy słoń ma usiąść na tępych gwoździach
FieldJustification: Left

I'd say the data is stored properly but your PDF lacks the proper font to display them.

@phoet
Copy link

phoet commented Mar 13, 2019

this should be a disclaimer in the readme 😄

@jkraemer
Copy link
Owner

good point

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