[
https://issues.apache.org/jira/browse/PDFBOX-1234?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14004849#comment-14004849
]
Tilman Hausherr commented on PDFBOX-1234:
-----------------------------------------
It failed for me with the trunk:
{code}
Exception in thread "main" java.io.IOException: Invalid field type: null
at
org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.createField(PDFieldFactory.java:98)
at
org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.createField(PDFieldFactory.java:98)
at
org.apache.pdfbox.pdmodel.interactive.form.PDField.getKids(PDField.java:546)
at
org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.isButton(PDFieldFactory.java:105)
at
org.apache.pdfbox.pdmodel.interactive.form.PDFieldFactory.createField(PDFieldFactory.java:55)
at
org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm.getField(PDAcroForm.java:293)
at pdfboxpageimageextraction.ExtractImages.main(ExtractImages.java:76)
{code}
> NPE at
> org.apache.pdfbox.pdmodel.interactive.form.PDAppearance.calculateFontSize(PDAppearance.java:551)
> -------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-1234
> URL: https://issues.apache.org/jira/browse/PDFBOX-1234
> Project: PDFBox
> Issue Type: Bug
> Components: AcroForm
> Reporter: Christer Palm
> Attachments: 200221.pdf, SetPDFFieldValueTest.java, fw8bene--dft.pdf
>
>
> Using SVN trunk revision 1291094 (2012-02-18)
> Getting the following stack trace when trying to call PDField.setValue() on a
> AcroForm field in the attached document;
> java.lang.NullPointerException
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAppearance.calculateFontSize(PDAppearance.java:551)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAppearance.insertGeneratedAppearance(PDAppearance.java:371)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDAppearance.setAppearanceValue(PDAppearance.java:281)
> at
> org.apache.pdfbox.pdmodel.interactive.form.PDVariableText.setValue(PDVariableText.java:131)
> Reason seems to be that PDApperance.getFontAndUpdateResources() returns null,
> in turn because the font dictionary for the DA of the field ("/Cour 11 Tf 0
> g") is not present in the document.
--
This message was sent by Atlassian JIRA
(v6.2#6252)