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

Acrobat Reader 7.0 cannot open created files

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.0.0
    • Fix Version/s: None
    • Component/s: Writing
    • Labels:
      None

      Description

      Note: This issue is not observed with PDFBox 1.8.10.
      Note: This is observed with recent 2.0.0 builds including 2.0.0-20151013.171100-1760

      A file created by PDFBox can be opened by Reader X and XI. But it cannot be opened by Reader 7.

      For instance, given a file, load.pdf, which can be opened by Reader 7, run the following:

      public class PDFBoxRunLoadSave {
        public static void main(String[] args) {
          PDDocument pdDocument = null;
          try {
      		pdDocument = PDDocument.load(new File("load.pdf"));
      		pdDocument.save("save.pdf");
          } catch (Exception ex) {
      		System.err.println("Caught " + ex);
      		ex.printStackTrace();
          } finally {
      		try { pdDocument.close(); } catch (Exception ex) {
      			System.out.println("Closing, caught " + ex);
      		}
          }
        }
      }

      The file, save.pdf, will be generated which can be opened by Reader X but Reader 7 will respond with a popup message, "There was an error opening this document. The file is damaged and could not be repaired." (See attached screenshot).

      This is consistently observed testing with a large number of sample files on 3 Windows 7 SP1 64-bit workstations and 1 Windows 10 workstation.

        Attachments

        1. save-reTrailer.pdf
          26 kB
          Kevin Ternes
        2. save-NoForm.pdf
          14 kB
          Kevin Ternes
        3. save-Acrobat-7.pdf
          39 kB
          Kevin Ternes
        4. save-Acrobat-6.pdf
          39 kB
          Kevin Ternes
        5. save.pdf
          25 kB
          Kevin Ternes
        6. Reader7OpenMessage.png
          19 kB
          Kevin Ternes
        7. PDFA-XRefUncompressedLastAdded-OpenScreenshot.png
          22 kB
          Kevin Ternes
        8. PDFA-XRefUncompressedLastAdded-Acrobat7.pdf
          18 kB
          Kevin Ternes
        9. PDFA-XRefUncompressedLastAdded-Acrobat6.pdf
          18 kB
          Kevin Ternes
        10. PDFA-XRefUncompressedLastAdded.pdf
          15 kB
          Tilman Hausherr
        11. PDFA-XRefUncompressed0LastAdded.pdf
          15 kB
          Tilman Hausherr
        12. PDFA-nullEntryAdded.pdf
          16 kB
          Tilman Hausherr
        13. PDFA.pdf
          16 kB
          Tilman Hausherr
        14. load-NoForm-saved-XRefUncompressedLastAdded.pdf
          14 kB
          Tilman Hausherr
        15. load-NoForm.pdf
          11 kB
          Kevin Ternes
        16. load.pdf
          37 kB
          Kevin Ternes

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jkternes Kevin Ternes
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: