Aspose.Pdf Optimization issue

Excuse me if I re-open this post… what kind of optimization do the Optimize() and OptimizeResource() performs? I’ve got a file, after optmizing it it’s bigger then the source… doing a Adobe -> Save as creates a smaller file…
Thanks


Hi Paolo,


Thanks for your inquiry. We’ve already notice the issue and logged a ticket as PDFNEWNET-35227 in our issue tracking system for further investigation and irresolution. I’ve linked your request to the mention issue and will update you via this forum thread as soon as issue is resolved.

Sorry for the inconvenience faced.

Best Regards,

ok splendid… I’ve got also a file that when I do a OptimizeResource it throws an exception with Object not set to an instance of an object…if there a way of providing you further information? don’t know maybe via tracing/debug version of the aspose pdf dll?

Hi Paolo,


The reason you are getting Object Reference Exception when calling OptimizeResource(…) method might be related to specific PDF file that you are using. Sometimes due to complexity and structure of PDF file, component generates errors. Can you please share the source PDF file so that we can test the scenario at our end. We are sorry this inconvenience.

can you provide me a pvt mail address where I can send it?

Excuse me is there a place where I can look at the status of PDFNEWNET-35227 ?
just to understand do you plan to release a new version of Aspose.Pdf in a short?
Thanks

pponzano:
can you provide me a pvt mail address where I can send it?
Hi Paolo,

Sorry for the delayed response.

Please follow the instructions specified over following link for further details on How to send a license?

pponzano:
Excuse me is there a place where I can look at the status of PDFNEWNET-35227 ?
Hi Paolo,

As soon as we have made some progress towards the
resolution of this issue, we will keep you updated on the
status of correction within this forum thread. Please be patient and spare us little time. Your patience
and comprehension is greatly appreciated in this regard.<o:p></o:p>

pponzano:
just to understand do you plan to release a new version of Aspose.Pdf in a short?
We do have a plan to release a new version of Aspose.Pdf for .NET in current week. However since we recently have been able to notice this issue, so the development team requires little time to investigate and figure out the actual reasons of this problem. I am afraid the resolution of PDFNEWNET-35227 will not be included in the upcoming release. We are sorry for this inconvenience.

The issues you have found earlier (filed as PDFNEWNET-35227) have been fixed in Aspose.Pdf for .NET 9.3.0.

Blog post for this release can be viewed over this link


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Hi Paolo,

Thanks for your patience. We have investigated the issue and found that document optimized by Aspose contains embedded fonts. Where as Adobe Distiller un-embed these embedded fonts, this explains difference in document size.

In order to provide same ability to optimize the document a new feature, un-embedFonts property, is added to OptimizeResources in upcoming release 9.3.0 . When un-embedFonts flag is set in Document.OptimizationOptions, all fonts in the document will be un-embedded. Please not that file may be unreadable if appropriate font is not found on machine where file is opened. That's why this option is false by default.

Document doc = new Document("35227.pdf");

Document.OptimizationOptions opt = new Document.OptimizationOptions();

opt.UnembedFonts = true;

doc.OptimizeResources(opt);

doc.Save("35227-out.pdf");

You may also un-embed some particular fonts with the following code:
Font.IsEmbedded = false;
For example:


foreach (Aspose.Pdf.Text.Font font in page.Resources.Fonts)

font.IsEmbedded = false;

But this may be incorrect for some types of fonts for example for CID Fonts.


Please feel free to contact us for any further assistance.


Best Regards,