I'm not sure it's the correct forum however I didn't find a forum specific for PDF Library. If there is one, I would love to get a link to it.
Now to the question(s).
I have an automated c# process that's optimizing pdf files that's coming from multiple sources using PDF Library:
using (Library library = new Library())
{
using (PDFOptimizer optimizer = new PDFOptimizer())
{
SetOptimizerOptions(optimizer);
try
{
optimizer.Optimize(new Document(sourceFile), targetFile);
}
catch(Datalogics.PDFL.LibraryException e)
{
throw new PdfException(e);
}
}
}
private void SetOptimizerOptions(PDFOptimizer optimizer)
{
optimizer.SetOption(OptimizerOption.MergeDuplicateFonts, true);
optimizer.SetOption(OptimizerOption.DiscardUnusedForms, true);
optimizer.SetOption(OptimizerOption.Linearize, true);
optimizer.SetOption(OptimizerOption.SubsetAllEmbeddedFonts, true);
optimizer.SetOption(OptimizerOption.RemoveAllBase14Fonts, true);
optimizer.SetOption(OptimizerOption.RemoveAllEmbeddedFonts, RemoveEmbeddedFonts);
optimizer.SetOption(OptimizerOption.DiscardOutputIntent, DiscardOutputIntent);
optimizer.SetOption(OptimizerOption.DiscardStructureTrees, DiscardStructureTrees);
}
Some of them are using embedded fonts, some do not.
1. Is there a way to find out if embedded fonts are used in the document?
2. Is there a way to remove only embedded fonts that are not used? (I didn't see an OptimizeOption for that)?