[
https://issues.apache.org/jira/browse/PDFBOX-3165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15061139#comment-15061139
]
Aaron Eischeid commented on PDFBOX-3165:
----------------------------------------
is there a specific way maybe to use a font file that has more characters in
it? What we are doing is using Libre Office to work on the doc and export to
PDF. I have noticed is that if we do this on a Ubuntu machine then after PdfBox
handles the PDF some windows users will see black circles instead of letters.
That problem goes away if we do the export from a windows machine. The error we
encountered with the missing tab char was on a PDF that had been generated on a
windows machine.
So the question is is there a way to tell Libre Office or whatever PDF
generating thing to use/declare/embed a font that has a broader set of
characters? Or should I use a different font setting in the form elements?
Arial as a font choice feels pretty safe really. If that one doesn't work it is
hard to imagine what would do better.
> Tab characters in PDTextField cause error when using .flatten()
> ---------------------------------------------------------------
>
> Key: PDFBOX-3165
> URL: https://issues.apache.org/jira/browse/PDFBOX-3165
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm, FontBox
> Affects Versions: 2.0.0
> Environment: Ubuntu, JDK7
> Reporter: Aaron Eischeid
> Attachments: Sample_Template.pdf
>
>
> pdf form gets filled in, then call I call .flatten(fields, true) which last I
> knew was undocumented, but anyway I needed the refreshAppearences for
> pdfViewers that don't support acroForms like pdf.js
> If a tab character some how gets entered into the PDTextField it chokes. I am
> worried other somewhat common characters might have similar issues, but
> haven't experimented so far.
> Using RC2 of pdfBox and fontBox. and fonts in pdfForm elements were all set
> to Arial.
> Relavent stacktrace:
> U+0009 is not available in this font's Encoding. Stacktrace follows:
> java.lang.IllegalArgumentException: U+0009 is not available in this font's
> Encoding
> at
> org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.encode(PDTrueTypeFont.java:358)
> at org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:283)
> at org.apache.pdfbox.pdmodel.font.PDFont.getStringWidth(PDFont.java:312)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PlainTextFormatter.format(PlainTextFormatter.java:193)
> at
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.insertGeneratedAppearance(AppearanceGeneratorHelper.java:373)
> at
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceContent(AppearanceGeneratorHelper.java:237)
> at
> org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.setAppearanceValue(AppearanceGeneratorHelper.java:144)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDTextField.constructAppearances(PDTextField.java:263)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.refreshAppearances(PDAcroForm.java:287)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.flatten(PDAcroForm.java:211)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]