Table of Contents

Method RemovePaintedImages

Namespace
BitMiracle.Docotic.Pdf
Assembly
BitMiracle.Docotic.Pdf.dll

RemovePaintedImages(Predicate<PdfPaintedImage>)

Removes some or all images drawn on the page depending on a provided predicate.

public void RemovePaintedImages(Predicate<PdfPaintedImage> remove)

Parameters

remove Predicate<PdfPaintedImage>

The predicate that determines whether to remove a painted image or not.

Remarks

If the predicate pointed to by parameter remove returns true for a painted image then the image will be removed from the page. If the predicate returns false then the image will stay on the page.

The method calls the predicate for regular and inline images drawn directly on the page, including invisible (clipped, obscured) images.

The method does not call the predicate for images in XObjects. Therefore, this method does not remove images from XObjects.

The method calls the predicate according to the drawing order of the images. If image A is drawn earlier than image B then the predicate will be first invoked for image A and then for image B.

The same PdfImage may be drawn on the page multiple times. In that case, the predicate will be called multiple times with different PdfPaintedImage objects referencing the same base image in the Image property.

Exceptions

ArgumentNullException

remove is null.