You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2021/04/04 04:00:00 UTC

[jira] [Comment Edited] (PDFBOX-5150) 3.0.0-RC1: PDComboBox.setValue() throws IllegalArgumentException: /DA is a required entry

    [ https://issues.apache.org/jira/browse/PDFBOX-5150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314397#comment-17314397 ] 

Tilman Hausherr edited comment on PDFBOX-5150 at 4/4/21, 3:59 AM:
------------------------------------------------------------------

Seems to go away by adding
{code}
String defaultAppearanceString = "/Helv 0 Tf 0 g";
acro.setDefaultAppearance(defaultAppearanceString);
{code}
to {{PdfBoxPerDocumentFormState.processControls()}} after the PDAcroForm creation. I wonder why this didn't fail before.


was (Author: tilman):
Seems to go away by adding
{code}
String defaultAppearanceString = "/Helv 0 Tf 0 g";
acro.setDefaultAppearance(defaultAppearanceString);
{code}
to PdfBoxPerDocumentFormState.processControls() after the PDAcroForm creation. I wonder why this didn't fail before.

> 3.0.0-RC1: PDComboBox.setValue() throws IllegalArgumentException: /DA is a required entry
> -----------------------------------------------------------------------------------------
>
>                 Key: PDFBOX-5150
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5150
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Emmeran Seehuber
>            Priority: Major
>
> While porting openhtmltopdf to PDFBox 3.0.0-RC1 I got exceptions in some tests:
> The tests com.openhtmltopdf.nonvisualregressiontests.NonVisualRegressionTest#testInputWithoutNameAttribute, com.openhtmltopdf.testcases.CssPropertiesTest#testFormControls and com.openhtmltopdf.testcases.TestcaseRunnerTest#runTestcaseRunner causes the „field.setValue()“ on a PDComboBox in [https://github.com/rototor/openhtmltopdf/blob/open-dev-v1-pdfbox-3.0.0/openhtmltopdf-pdfbox/src/main/java/com/openhtmltopdf/pdfboxout/PdfBoxForm.java#L363] to throw this exception:
> java.lang.IllegalArgumentException: /DA is a required entry
>  at org.apache.pdfbox.pdmodel.interactive.form.PDDefaultAppearanceString.<init>(PDDefaultAppearanceString.java:78)
>  at org.apache.pdfbox.pdmodel.interactive.form.PDVariableText.getDefaultAppearanceString(PDVariableText.java:93)
>  at org.apache.pdfbox.pdmodel.interactive.form.AppearanceGeneratorHelper.<init>(AppearanceGeneratorHelper.java:115)
>  at org.apache.pdfbox.pdmodel.interactive.form.PDComboBox.constructAppearances(PDComboBox.java:82)
>  at org.apache.pdfbox.pdmodel.interactive.form.PDTerminalField.applyChange(PDTerminalField.java:210)
>  at org.apache.pdfbox.pdmodel.interactive.form.PDChoice.setValue(PDChoice.java:381)
>  at com.openhtmltopdf.pdfboxout.PdfBoxForm.processSelectControl(PdfBoxForm.java:363)
>  at com.openhtmltopdf.pdfboxout.PdfBoxForm.process(PdfBoxForm.java:807)
>  at com.openhtmltopdf.pdfboxout.PdfBoxPerDocumentFormState.processControls(PdfBoxPerDocumentFormState.java:179)
>  at com.openhtmltopdf.pdfboxout.PdfBoxFastOutputDevice.processControls(PdfBoxFastOutputDevice.java:299)
>  at com.openhtmltopdf.pdfboxout.PdfBoxFastOutputDevice.finish(PdfBoxFastOutputDevice.java:904)
> You can get the project here: [https://github.com/rototor/openhtmltopdf/tree/open-dev-v1-pdfbox-3.0.0] 
> mvn test
> will show you the failing test cases.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org