We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Delete Images from PDFs

We have a requirement where we need to delete an instance of an IMG logo from the PDF page.
The same logo image is present on two locations on the same PDF. When I try to redact using following code the image within the rectangular area is cleared but the same logo on a different location of the same PDF page gets blackened.
Is there any other option available for me to delete images without affecting other instances?
I have also tried ImagePlacementAbsorber but there is no option available to delete an image when I iterate through the ImagePlacement object inside of the Absorber.

//solution one redacts the image in within the rectangle but blackens the other instance of the same
//image
Dim rectangle As New Aspose.Pdf.Rectangle(Specs(0), Specs(1), Specs(2), Specs(3))
Dim annotator As New PdfAnnotationEditor(pdf)
annotator.RedactArea(i, rectangle, System.Drawing.Color.Transparent)
annotator.Save(PDFfilename)

@Robert343

Thank you for contacting support.

Would you please share source and generated files along with SSCCE code so that we may try to reproduce and investigate it in our environment. Before sharing requested data, please ensure using Aspose.PDF for .NET 19.6.

Please see attached zip with sample code and pdf.TXG.doc-000000.id-122717971.zip (172.7 KB)

We are trying to delete the logo image next to the address area without affecting other images on the PDF.
Please suggest solutions available to us.

@Robert343

Thank you for contacting support.

It is the same image which is referenced on different pages in the PDF document, so when API tries to redact one instance, all instances are affected. We have also verified the same with Adobe Acrobat as in attached screenshot Redact.PNG.

Aspose.PDF for .NET API mimics behavior of Acrobat so we are afraid single instance may not be deleted without affecting others.