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

SaveIncremental on same opened file

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.0.8
    • None
    • Writing
    • None

    Description

      The incremental save does not work correctly if it is done on the same opened document. It produces corrupted file. The save incremental should append changes at the end of file (after last origin EOF).
      Newly saved file contains changes also in the middle of the file not only at the end. Changes in the middle of file contains zeroed bytes or garbage.

      Tested with the latest stable version of PDFBox 2.0.8.

      Sample code:

      String fileName = "/path/to/document.pdf";
      PDDocument doc = PDDocument.load((new File(fileName));
      ...
      document changes
      ...
      try ( OutputStream outStream = new FileOutputStream(fileName)) {
      	doc.saveIcremental(outStream);
      }
      catch ....
      ...
      

      Attachments

        1. pdf_reference_1-7.pdf
          30.97 MB
          Martin Mancuska

        Activity

          People

            Unassigned Unassigned
            mato7d5 Martin Mancuska
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: