How do I remove embedded fonts?


I've been writing a prototype and I've proven that PDFTron PDFTNET SDK
can do almost everything we need. The only thing that I haven't
figured out is how to remove embedded fonts (they're causing the file
to be too large).


The whole code may look something like this:

... Init PDFNet ...
PDFDoc doc = new PDFDoc("in.pdf");
Doc cos_doc = doc.GetSDFDoc();
int num_objs = cos_doc.XRefSize();
for (int i=1; i<num_objs; ++i) {
  Obj obj = cos_doc.GetObj(i);
  if (obj!=null && !obj.IsFree()&& obj.IsDict())
  { // Process only Fonts
     DictIterator itr = obj.Find("Type");
     if (itr == obj.DictEnd() ||
       itr.Value().GetName() != "Font")
     itr = obj.Find("FontDescriptor");
     if (itr == obj.DictEnd()) continue;
     if (!itr.Value().IsDict()) continue;
     Obj fd = itr.Value();

You could run the above loop only once (e.g. prior to split operation).