Work with Images using PdfContentEditor

Delete Images from a Particular Page of PDF (Facades)

In order to delete the images from a particular page, you need to call DeleteImage method with pageNumber and index parameter. The index parameter represents an array of integers – the indexes of the images to be deleted. First of all, you need to create an object of PdfContentEditor class and then call the DeleteImage method. After that, you can save the updated PDF file using Save method.

The following code snippet shows you how to delete images from a particular page of PDF.

Delete All the Images from a PDF File (Facades)

All the images can be deleted from a PDF file using DeleteImage method of the PdfContentEditor. Call the DeleteImage method – the overload without any parametes – to delete all the images, and then save the updated PDF file using Save method.

The following code snippet shows you how to delete all the images from a PDF file.

Replace Image in a PDF File (Facades)

the PdfContentEditor allows you replace your image in a PDF file, call for this the ReplaceImage method, and Save the result.