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

Bookmarks not merged correctly by PDFMergerUtility

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2.0
    • Component/s: Utilities
    • Labels:
      None
    • Environment:
      Windows Vista 32-bit, Java 1.5.0_06, PDFBox Head tag (revision 940574)

      Description

      When multiple PDFs with bookmarks are merged, not all of the bookmarks are in the output and they are not in the expected order. The output will have all bookmarks from the first file, the first bookmark from all files, and then the bookmarks 2-n of file #2. Files 3 and above will only have the first bookmark copied over.

      The expected behavior is that all bookmarks for file 1 appear, followed by all bookmarks for files 2, then all bookmarks for file 3 and so on.

      Code to duplicate the problem:
      String inputFile = "C:
      US_Constitutional_Ammendments_bookmarked.pdf";
      String outputFile = "C:
      US_Constitutional_Ammendments_bookmarked3.pdf";

      PDFMergerUtility merger = new PDFMergerUtility();
      merger.setDestinationFileName(outputFile);
      merger.addSource(inputFile);
      merger.addSource(inputFile);
      merger.addSource(inputFile);
      merger.mergeDocuments();

        Attachments

        1. PDFBOX-719.patch
          0.8 kB
          Adam Nichols
        2. US_Constitutional_Ammendments_bookmarked.pdf
          150 kB
          Adam Nichols

          Activity

            People

            • Assignee:
              lehmi Andreas Lehmkühler
              Reporter:
              adamnichols Adam Nichols
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: