PdfPage.RemovePaintedImages Method

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

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
public void RemovePaintedImages(
	Predicate<PdfPaintedImage> remove
)
VB
Public Sub RemovePaintedImages ( 
	remove As Predicate(Of PdfPaintedImage)
)

Parameters

remove
Type: System.Predicate<PdfPaintedImage>
The predicate that determines whether to remove a painted image or not.

Exceptions

ExceptionCondition
ArgumentNullExceptionremove is null.

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.

See Also