Hi,
i need to remove the attachments from a pdf to reduce the original size, but it seems not work well.
The new file is without attachment, but with the same size of the original with attachment.
Thank in advance,
Marco
Hi,
i need to remove the attachments from a pdf to reduce the original size, but it seems not work well.
The new file is without attachment, but with the same size of the original with attachment.
Thank in advance,
Marco
Hi Marco,
com.aspose.pdf.facades.PdfContentEditor
editor = new
com.aspose.pdf.facades.PdfContentEditor();<o:p></o:p>
editor.bindPdf("c:/pdftest/12422.pdf");
editor.deleteAttachments();
editor.save("c:/pdftest/ContentEditor.pdf");
Document originalDocument = new Document("c:/pdftest/ContentEditor.pdf");
com.aspose.pdf.Document.OptimizationOptions optimize = new com.aspose.pdf.Document.OptimizationOptions();
optimize.setCompressImages(true);
optimize.setRemoveUnusedObjects(true);
optimize.setRemoveUnusedStreams(true);
optimize.setUnembedFonts(true);
optimize.setLinkDuplcateStreams(true);
originalDocument.optimizeResources(optimize);
originalDocument.save("c:/pdftest/FileOptimized.pdf");
It works perfectly.
Hi Marco,