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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.7, 2.0.0
    • Fix Version/s: 1.8.8, 2.0.0
    • Component/s: Utilities
    • Environment:
      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. bid.pdf
          3 kB
          Ernst Eibensteiner
        2. 2nd Testfile.pdf
          80 kB
          Ernst Eibensteiner

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: