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

Free Support Forum - aspose.com

Search and replace images


I am looking to search and replace images inside a pdf. The PdfExtractor can pull out all the images, however, is there a way to loop thru all the images, pull out its meta-tag, and replace it with the corresponding image?



Thank you for considering Aspose. This feature is not support now and we have no plan to support it in short time.



We have added new property ImagePlacementAbsorber in Aspose.PDF 18.8 to replace images. Following example serve the purpose. Please check and share feedback with us.

Document doc = new Document(@“D:\Tests\input.pdf”);

// Create ImagePlacementAbsorber object to perform image placement search
ImagePlacementAbsorber abs = new ImagePlacementAbsorber();

// Accept the absorber for first page

// Display image placement properties for all placements
foreach (ImagePlacement imagePlacement in abs.ImagePlacements)
Console.Out.WriteLine(“image width:” + imagePlacement.Rectangle.Width);
Console.Out.WriteLine(“image height:” + imagePlacement.Rectangle.Height);
Console.Out.WriteLine(“image LLX:” + imagePlacement.Rectangle.LLX);
Console.Out.WriteLine(“image LLY:” + imagePlacement.Rectangle.LLY);
Console.Out.WriteLine(“image horizontal resolution:” + imagePlacement.Resolution.X);
Console.Out.WriteLine(“image vertical resolution:” + imagePlacement.Resolution.Y);