Does anyone have any feedback for me on this problem? Should PDFBox 2 generate output that Reader 7 can open? Should I open a Jira issue for this?
-----Original Message----- From: Kevin Ternes Sent: Thursday, October 08, 2015 2:27 PM To: [email protected] Subject: PDDocument unreadable in Acrobat 7 after simple load/save I am working with a file using pdfbox-2.0.0-20151007.203054-1746 and I can open both the input and output file with Acrobat Reader XI. According to Acrobat Reader for both input and output documents, PDF Version 1.6 (Acrobat 7.x) I have a user reporting that she can open the input file, but cannot open the output version of that file. She gets a popup on the processed file from Acrobat saying "There was an error opening this document. The file is damaged and could not be repaired." She is using Acrobat Reader 7 on Win7 64-bit SP1. I have reduced the problem down to the following load/save and we still get the error on the saved file: public class PDFBoxRunLoadSave { public static void main(String[] args) { PDDocument pdDocumentA = null; try { pdDocumentA = PDDocument.load(new File("CancelPolicy-0.pdf")); pdDocumentA.save("CancelPolicy-1.pdf"); } catch (Exception ex) { System.err.println("Caught " + ex); ex.printStackTrace(); } finally { close(pdDocumentA); } } static void close(PDDocument doc) { if (null != doc) { try { doc.close(); } catch (Exception ex) { System.out.println("Closing, caught " + ex); } } } } And here are the loaded and saved files: Load: https://dl.dropboxusercontent.com/u/3103884/dev/CancelPolicy-0.pdf 17KB Save: https://dl.dropboxusercontent.com/u/3103884/dev/CancelPolicy-1.pdf 21KB (why is the output larger?) Is it possible that PDFBox is breaking the output file in a way that Acrobat 7 cannot read it but Acrobat XI can? --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]

