Aspose PDF file optimization. Additional options

Hello, can you explain plz additional options for PDF file optimization
1.
Aspose.Pdf.Document
document.OptimizeResources(OptimizationOptions options);

LinkDuplicateStreams
AllowReusePageContent
RemoveUnusedStreams
RemoveUnusedObjects
UnembedFonts
SubsetFonts
RemovePrivateInfo

  1. If I use SubsetFonts = true as option for optimization - I get output optimized file with size bigger than original file. Is there some explanation for that?

@vprokopenko19

We need to investigate this scenario further. Can you please share your sample source and output PDFs along with code snippet for our reference? We will test the scenario in our environment and address it accordingly.

@asad.ali

1.zip (10.5 KB)
2.zip (297.5 KB)

Here are two examples in attachments.

  1. 1.zip Contains original pdf file and after optimization with flag SubsetFonts = true
  2. 2.zip Contains original docx file. Converted pdf without optimization and converted pdf with optimization flag SubsetFonts = true
  3. And if can somebody explain additional optimization flags listed above?

@vprokopenko19

LinkDuplcateStreams: If this flag is set to true, Resource streams will be analyzed. If duplicate streams are found (i.e. if stream contents is equal), then thes streams will be stored as one object. This allows to decrease document size in some cases (for example, when same document was concatenedted multiple times).
AllowReusePageContent: If true page contents will be reused when document is optimized for equal pages.
RemoveUnusedStreams: If this flag set to true, every resource is checked on it’s usage. If resource is never used, then resources is removed. This may decrease document size for example when pages were extracted from document.
RemoveUnusedObjects: If this flag is set to true, all document objects will be checked and unused objects (i.e. objects which does not have any reference) are removed from document.
UnembedFonts: Make fonts not embedded if set to true.
SubsetFonts: Fonts will be converted into subsets if set to true.
RemovePrivateInfo: Remove private information (page piece info).

Furthermore, we have opened an investigation ticket as PDFNET-54638 in our issue tracking to analyze this case further. We will look into its details and let you know as soon as the ticket is resolved. Please be patient and spare us some time.

@asad.ali
Thank you for answer