Q: How do I delete an image from a PDF page using PDFTron PDFNet?
----------------------
A: There are couple of options:
a) Use ElementReader & ElementWriter as shown in ElementEdit sample
(
http://www.pdftron.com/pdfnet/samplecode.html#ElementEdit)
b) Swap the image with an empty form xobject.
You can create empty as follows:
ElementWriter w = ElementWriter();
w.Begin(doc);
Obj xobj = w.End();
Then you can replace the existing image with the empty form using
sdfdoc.Swap(...). For example:
doc.GetSDFDoc().Swap(image_element.GetXObject().GetObjNum(),
xobj.GetObjNum());
The replaced images will be removed from the document duing doc.Save()
in 'remove-unused' or 'linearization' mode.