Question:
I would like to process PDF files that enter my system, and ensure that all fonts are embedded for later viewing in the browser.
Answer:
You would use the Optimizer class to embed and subset all fonts (you subset so as not to embed an entire, and possibly large, font).
The code below disables Optimizer classes other features, so that images are not down-sampled, or even re-sampled.
Optimizer.ImageSettings ims = new Optimizer.ImageSettings();
ims.SetDownsampleMode(Optimizer.ImageSettings.DownsampleMode.e_off);
Optimizer.MonoImageSettings mims = new Optimizer.MonoImageSettings();
mims.SetDownsampleMode(Optimizer.MonoImageSettings.DownsampleMode.e_off);
Optimizer.TextSettings ts = new Optimizer.TextSettings();
ts.EmbedFonts(true); // embed and subset missing fonts
ts.SubsetFonts(false); // leave already embedded fonts alone
Optimizer.OptimizerSettings os = new Optimizer.OptimizerSettings();
os.SetColorImageSettings(ims);
os.SetGrayscaleImageSettings(ims);
os.SetMonoImageSettings(mims);
os.SetTextSettings(ts);
Optimizer.Optimize(doc, os);