0

I am trying to compress PDF files using PDFClown 0.1.2, but i am facing issue like when i try to open PDF it says "An Error exists on this page"

also tried the approach mentioned in link Stack

Below is the my code

org.pdfclown.files.File file = new org.pdfclown.files.File(newPath);
        org.pdfclown.tools.Optimizer.RemoveOrphanedObjects(file);
        file.Document.Configuration.XrefMode = Document.ConfigurationImpl.XRefModeEnum.Compressed;
        file.Save(org.pdfclown.files.SerializationModeEnum.Standard);

Please let me know if any one has face the same issue

Thanks

Community
  • 1
  • 1
RayK
  • 41
  • 2
  • 10
  • Saving in-place as in your code did not work for me at all, the original file never got replaced. But using different locations for input and output works just fine here. You might want to try different locations for input and output, too. If that still doesn't work, the issue very likely relates to the PDF you use. Can you share it? – mkl Aug 16 '16 at 13:25
  • Hi mkl, no luck with changing the save path, sorry i am afraid am not allowed to share the pdf file, is there any other way we can overcome this exception? – RayK Aug 23 '16 at 14:36
  • If that still doesn't work, the issue very likely relates to the PDF you use. Can you share it? – mkl Aug 23 '16 at 21:21

0 Answers0