How do I delete an image from a PDF page?

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

b) Swap the image with an empty form xobject.

You can create empty as follows:

ElementWriter w = ElementWriter();
Obj xobj = w.End();

Then you can replace the existing image with the empty form using
sdfdoc.Swap(...). For example:


The replaced images will be removed from the document duing doc.Save()
in 'remove-unused' or 'linearization' mode.