I tried this code from an example:
com.aspose.pdf.optimization.OptimizationOptions opt = new Document.OptimizationOptions();
opt.setRemoveUnusedObjects(true);
opt.setRemoveUnusedStreams(true);
opt.setLinkDuplcateStreams(true);
opt.setUnembedFonts(true);
opt.setAllowReusePageContent(true);
document.optimizeResources(opt);
Or this one:
document.optimizeResources();
Error:
com.aspose.pdf.internal.ms.System.l5if: Object not found
at com.aspose.pdf.internal.l0k.lh.lI(Unknown Source) ~[aspose-pdf-19.11.jar:19.11]
at com.aspose.pdf.internal.l0k.lh.lI(Unknown Source) ~[aspose-pdf-19.11.jar:19.11]
at com.aspose.pdf.internal.l9n.ld.lI(Unknown Source) ~[aspose-pdf-19.11.jar:19.11]
at com.aspose.pdf.internal.l9n.lb.lI(Unknown Source) ~[aspose-pdf-19.11.jar:19.11]
at com.aspose.pdf.ADocument.l1if(Unknown Source) ~[aspose-pdf-19.11.jar:19.11]
I saw that previous version you could also re-encode the images can this be done in alternative not deprecated way?