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

Free Support Forum - aspose.com

Delete images from PDF using Aspose.PDF for .NET

Hi, Support;

Here report a bug again:
Pdf.Pages§.Resources.Images.Delete(Index)
it delete a wrong pic, that’s to say, the index value is not the true one , please check it and fix it.

@ducaisoft

Would you kindly share respective source PDF document with us from which you are deleting images. Also, please share the values of index for our reference.

Test.pdf (269.0 KB)

@ducaisoft

Please try following code snippet to delete all images:

Document Pdf = new Document(dataDir + "Test.pdf");
for (int cc = 7; cc >= 1; cc += -1)
{
 Pdf.Pages[1].Resources.Images.Delete(cc);
 Pdf.ProcessParagraphs();
}
Pdf.Save(dataDir + "case1.pdf");