Hi,
I have to used below code snippet to convert PDF of 200KB and it created PDFA of 2MB file. I am really surprised by looking at the size of PDFA. Can you please let me know why it is creating such a big file? How to bring it back to the size of original PDF.
I used "com.aspose.pdf.Document.OptimizationOptions" but it helped to reduce file size by 25% only i.e. 2MB file came down to 1.5 MB. But still its a big file for original file size of 200KB.
Any quick help is appreciated.
// Open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
// Convert to PDF/A compliant document
pdfDocument.validate("Validation_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B);
pdfDocument.convert("Conversion_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B, com.aspose.pdf.ConvertErrorAction.Delete);
// Save updated document
pdfDocument.save("output.pdf");
// Open document
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document("input.pdf");
// Convert to PDF/A compliant document
pdfDocument.validate("Validation_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B);
pdfDocument.convert("Conversion_log.xml", com.aspose.pdf.PdfFormat.PDF_A_1B, com.aspose.pdf.ConvertErrorAction.Delete);
// Save updated document
pdfDocument.save("output.pdf");
// Load source PDF file
com.aspose.pdf.Document doc = new Document("source.pdf");
// Optimize the file size by removing unused objects
com.aspose.pdf.Document.OptimizationOptions opt = new Document.OptimizationOptions();
opt.setRemoveUnusedObjects(true);
opt.setRemoveUnusedStreams(true);
opt.setLinkDuplcateStreams(true);
doc.optimizeResources(opt);
// Save the updated file
doc.save("optimized.pdf");
Hi Reddi,
Thanks for your inquiry. We will appreciate it if you please share your sample PDF document here. We will look into it and provide you information accordingly.
We are sorry for the inconvenience caused.
Best Regards,
Hi,
I tried converting "Aspose_EndUserAgreement.pdf" from PDF to PDF/A, which is 197KB but when it converted to PDF/A, the size became 1.92MB.
Attached pdf.
Thanks,
Reddi.
Hi Reddi,
I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWNET-34925. We will investigate this issue in details and will keep you updated on the status of a correction.
We apologize for your inconvenience.
Thanks for the update.
Is there any approximate timeline to fix the issue? So that I can communicate to my manager.
Reddi.
Hi Reddi,
As we have recently noticed this issue, the development team needs some time to investigate and figure out the reasons for this problem. Nevertheless, as soon as we have made some definite progress towards its resolution, we would be more than happy to update you with the status of the correction.
Our humble request is to please be patient and spare us some time.
Thanks Nayyer.
I am from New Jersey Judiciary IT department. I posted the issue with my personnel account. Do you want me to log issue again with NJ Judiciary enterprise account?
Reddi.
Hi Reddi,
In order to expedite the issue investigation/resolution, please post a query in Enterprise Support forum with official account, so that priority of this issue can be raised.
Hi Reddi,
Thanks for your patience.
We have further investigated earlier reported issue PDFNEWJAVA-34925 and as per our observations, its not a bug. The PDF/A places higher demands on the information it contains. In PDF/A all required fonts must be embedded within the PDF (as opposed to font linking in source document).
For more details please see the link below: http://www.pdfa.org/2013/02/pdfa-facts/