How do I redact page content outside of visible page region?

Q:

I also noticed that the default behavior of PDFRedactTest is to remove the Robin Hood image on the front page, but when you extract the JPEG (redactedRobinHood.jpg) the parts of the image outside of the viewable area are still unredacted. Adobe also does the same thing, but I wondered if there is a way to force the entire image to be redacted if part of it is selected for redaction.

Can I use PDFNet to redact page content outside of visible page region?

A:

You can redact content outside of page regions as follows:

Temporary change the media & crop box (page.Set/GetMedia/CropBox()) to bounding box of all content on the page (i.e. page.GetBoundingBox()). After redaction you can restore the media & crop box to old values.