Unfortunately as many things with PDF, removing fonts from PDF is not as simple as it seems.
If you are indiscriminately removing all embedded font streams you will visually 'break' the file only if the substituted font is missing specific glyphs or if the font is not using standard/predefined encoding. The latter case is more likely and the end result will be gibberish text.
Perhaps you can identify these cases (e.g. custom encoding) so that you can skip font removal?
If you need to remove all fonts ... period, you could still use PDFNet, but you will need to rewrite all content streams normalizing all text to Unicode.
The idea is similar to ElementEdit sample
except that you create a new Font (non-embedded) and associate all text with the new font. Also you would need to map text to Unicode (element.GetTextString
() -> uni, then element.SetData(uni.GetBuffer()m, uni.GetLength()*2)).
This would work for most but _not all_ files. The problem is that some/many PDFs don't have proper Unicode maps, which means that you could still end up with gibberish text. As a next step you could try to use OCR to verify and fix these mappings ...