Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-1595

PDFMerger failed with the following exception: java.lang.NullPointerException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.7, 2.0.0
    • 1.8.8, 2.0.0
    • Utilities
    • Windows

    Description

      Merging 2 PDF documents leads to a null pointer exception:
      From my point of view the PDF document misses the xref and startxref tag.

      java -jar pdfbox-app-1.8.1.jar PDFMerger "bid.pdf" "2nd Testfile.pdf" output.pdf

      Mai 08, 2013 12:52:03 PM org.apache.pdfbox.pdfparser.XrefTrailerResolver setTrailer
      WARNING: Cannot add trailer because XRef start was not signalled.
      Mai 08, 2013 12:52:03 PM org.apache.pdfbox.pdfparser.XrefTrailerResolver setStartxref
      WARNING: Did not found XRef object at specified startxref position 0
      PDFMerger failed with the following exception:
      java.lang.NullPointerException
      at org.apache.pdfbox.util.PDFMergerUtility.appendDocument(PDFMergerUtility.java:257)
      at org.apache.pdfbox.util.PDFMergerUtility.mergeDocuments(PDFMergerUtility.java:188)
      at org.apache.pdfbox.PDFMerger.merge(PDFMerger.java:68)
      at org.apache.pdfbox.PDFMerger.main(PDFMerger.java:44)
      at org.apache.pdfbox.PDFBox.main(PDFBox.java:83)

      Attachments

        1. 2nd Testfile.pdf
          80 kB
          Ernst Eibensteiner
        2. bid.pdf
          3 kB
          Ernst Eibensteiner

        Activity

          People

            lehmi Andreas Lehmkühler
            ernst.eibensteiner Ernst Eibensteiner
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: