You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Ivan Latysh (Commented) (JIRA)" <ji...@apache.org> on 2012/01/16 17:50:39 UTC

[jira] [Commented] (PDFBOX-189) NPE in COSDictionaryMap.put

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

Ivan Latysh commented on PDFBOX-189:
------------------------------------

Any updates on this one ?

I guess it is possible to fix NPE in 5 years .....
                
> NPE in COSDictionaryMap.put
> ---------------------------
>
>                 Key: PDFBOX-189
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-189
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel.AcroForm
>            Priority: Minor
>
> [imported from SourceForge]
> http://sourceforge.net/tracker/index.php?group_id=78314&atid=552832&aid=1538596
> Originally submitted by jfnieto on 2006-08-11 03:28.
> When importing FDF fields in a PDF file, I get a
> NullPointerException in COSDictionaryMap.
> I'm just starting with PDFBox. I use it to create final
> PDF files merging a PDF with an FDF file. In most
> cases, it works fine, but with a couple of PDF files I
> get this error.
> I have done a little program to import a sample FDF
> into all "template" PDFs. I only get the NPE with two
> of them. The source of this test is attached to this
> message.
> The exception trace:
> java.lang.NullPointerException
>         at
> org.pdfbox.pdmodel.common.COSDictionaryMap.put(COSDictionaryMap.java:
> 120)
>         at
> org.pdfbox.pdmodel.interactive.form.PDAppearance.getFontAndUpdateReso
> urces(PDAppearance.java:447)
>         at
> org.pdfbox.pdmodel.interactive.form.PDAppearance.setAppearanceValue(P
> DAppearance.java:275)
>         at
> org.pdfbox.pdmodel.interactive.form.PDVariableText.setValue(PDVariabl
> eText.java:145)
>         at
> org.pdfbox.pdmodel.interactive.form.PDField.importFDF(PDField.java:31
> 9)
>         at
> org.pdfbox.pdmodel.interactive.form.PDAcroForm.importFDF(PDAcroForm.j
> ava:132)
>         at TestPDF.importFDF(TestPDF.java:44)
>         at TestPDF.test(TestPDF.java:28)
>         at TestPDF.main(TestPDF.java:60)
> [attachment on SourceForge]
> http://sourceforge.net/tracker/download.php?group_id=78314&atid=552832&aid=1538596&file_id=188647
> TestPDF.java (application/octet-stream), 1363 bytes
> Test: Import a FDF into a group of PDF files
> [comment on SourceForge]
> Originally sent by jfnieto.
> Logged In: YES 
> user_id=393901
> I'm playing with the PDFBox code. If I insert a check in the
> put method of COSDictionaryMap to avoid the NPE, then I get
> errors when saving() the final document:
> java.lang.NullPointerException
>         at
> org.pdfbox.cos.COSStream.getFilteredStream(COSStream.java:153)
>         at
> org.pdfbox.pdfwriter.COSWriter.visitFromStream(COSWriter.java:936)
>         at org.pdfbox.cos.COSStream.accept(COSStream.java:218)
>         at
> org.pdfbox.pdfwriter.COSWriter.doWriteObject(COSWriter.java:449)
>         at
> org.pdfbox.pdfwriter.COSWriter.doWriteBody(COSWriter.java:382)
>         at
> org.pdfbox.pdfwriter.COSWriter.visitFromDocument(COSWriter.java:794)
>         at
> org.pdfbox.cos.COSDocument.accept(COSDocument.java:390)
>         at
> org.pdfbox.pdfwriter.COSWriter.write(COSWriter.java:1089)
>         at
> org.pdfbox.pdmodel.PDDocument.save(PDDocument.java:611)
>         at
> org.pdfbox.pdmodel.PDDocument.save(PDDocument.java:592)
>         at GenPDF.importFDF(GenPDF.java:25)
>         at GenPDF.main(GenPDF.java:43)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira