You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Maruan Sahyoun (JIRA)" <ji...@apache.org> on 2016/09/01 17:44:20 UTC
[jira] [Resolved] (PDFBOX-3165) Tab characters in PDTextField cause
error when using .flatten()
[ https://issues.apache.org/jira/browse/PDFBOX-3165?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Maruan Sahyoun resolved PDFBOX-3165.
------------------------------------
Resolution: Fixed
fixed by replacing tab with space. As Acrobat handles tab characters by jumping to specific positions that should be improved. See PDFBOX-3469
> 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
> Assignee: Maruan Sahyoun
> Fix For: 2.0.3, 2.1.0
>
> 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: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org