You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by trupti purohit <tr...@gmail.com> on 2009/11/23 11:32:14 UTC

Problem in using PDFBox library

Hi,


I am trying to use PDFBox library to convert pdf pages into images. I am
facing some problems while working on some of the PDF files that I have.

When I use  PDFBox-0.7.3.jar, it throws following exception..

Exception in thread "main" java.lang.NullPointerException
    *  at org.pdfbox.pdmodel.PDPageNode.getAllKids(PDPageNode.java:194)
      at org.pdfbox.pdmodel.PDPageNode.getAllKids(PDPageNode.java:182)
      at
org.pdfbox.pdmodel.PDDocumentCatalog.getAllPages(PDDocumentCatalog.java:226)
      at pdfboxcenverter.main(pdfboxcenverter.java:21)*


I tried using pdfbox-0.8.0-incubating.jar , now I get following exception.

 *org.apache.pdfbox.exceptions.WrappedIOException
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:237)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:841)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:808)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:733)
      at pdfboxcenverter.main(pdfboxcenverter.java:19)*

*Caused by: java.util.NoSuchElementException
      at java.util.AbstractList$Itr.next(Unknown Source)
      at
org.apache.pdfbox.pdfparser.PDFXrefStreamParser.parse(PDFXrefStreamParser.java:115)
      at
org.apache.pdfbox.cos.COSDocument.parseXrefStreams(COSDocument.java:538)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:203)
      ... 4 more
*

In my code I am doing something like

 PDDocument pdf = PDDocument.load("C:\\data\\Triplify.pdf");

List<PDPage> pages = pdf.getDocumentCatalog().getAllPages();


If you need I can send you the pdf file.
Please help me resolve the problem. I need it for my application
development.  I searched a lot on net but not yet able to solve the problem.
Is there any location from where I can download the jar which contains fix
for above problem?
Thanks in advance.

Thanks,
Trupti

Problem in using PDFBox library

Posted by trupti purohit <tr...@gmail.com>.
Hi,


I am trying to use PDFBox library to convert pdf pages into images in my
JAVA code. I am facing some problems while working on some of the PDF files
that I have.

When I use  PDFBox-0.7.3.jar, it throws following exception..

Exception in thread "main" java.lang.NullPointerException
    *  at org.pdfbox.pdmodel.PDPageNode.getAllKids(PDPageNode.java:194)
      at org.pdfbox.pdmodel.PDPageNode.getAllKids(PDPageNode.java:182)
      at
org.pdfbox.pdmodel.PDDocumentCatalog.getAllPages(PDDocumentCatalog.java:226)
      at pdfboxcenverter.main(pdfboxcenverter.java:21)*


I tried using pdfbox-0.8.0-incubating.jar , now I get following exception.

 *org.apache.pdfbox.exceptions.WrappedIOException
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:237)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:841)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:808)
      at org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:733)
      at pdfboxcenverter.main(pdfboxcenverter.java:19)*

*Caused by: java.util.NoSuchElementException
      at java.util.AbstractList$Itr.next(Unknown Source)
      at
org.apache.pdfbox.pdfparser.PDFXrefStreamParser.parse(PDFXrefStreamParser.java:115)
      at
org.apache.pdfbox.cos.COSDocument.parseXrefStreams(COSDocument.java:538)
      at org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:203)
      ... 4 more
*

In my code I am doing something like

 PDDocument pdf = PDDocument.load("C:\\data\\Triplify.pdf");

List<PDPage> pages = pdf.getDocumentCatalog().getAllPages();


If you need I can send you the pdf file.
Please help me resolve the problem. I need it for my application
development.  I searched a lot on net but not yet able to solve the problem.
Is there any location from where I can download the jar which contains fix
for above problem?
Thanks in advance.

Thanks,
Trupti