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

First split result document misses metadata after split

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.3 PDFBox, 4.0.0
    • 3.0.3 PDFBox, 4.0.0
    • Writing
    • None

    Description

      This happens with the test file of PDFBOX-5840 and can also be reproduced with the command line utility: the first split result file doesn't have the metadata.

      Alternatively it can be reproduced programmatically by adding this code below assertEquals(5, pageTree.indexOf(pd5.getPage())); in

      assertNotNull(dstDoc.getDocumentCatalog().getMetadata());
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      dstDoc.save(baos);
      PDDocument reloadedDoc = Loader.loadPDF(baos.toByteArray());
      assertNotNull(reloadedDoc.getDocumentCatalog().getMetadata());
      reloadedDoc.close();
      

      I believe this is another writing problem, because the metadata exists, but gets lost during the first save, not during a second one (not part of the test code). It is expected to be object 116. It doesn't happen with 2.0. Attached: two saved files by splitting so that the entire file is the result.

      Attachments

        1. splitresult1.pdf
          12 kB
          Tilman Hausherr
        2. splitresult2.pdf
          15 kB
          Tilman Hausherr

        Activity

          People

            lehmi Andreas Lehmkühler
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: