ImagePlacementAbsorber gets wrong count of images from attached document. Array has 8 images but count is 9.
We have problems that one documents imagePlacements.Count is good and for another documents is wrong.
source.pdf (161.4 KB)
We have investigated attached file using Aspose.PDF for .NET 19.4 with below code snippet have found that Count
property as well as the array contains 8 images. We have also verified the same with a breakpoint at the last line where abs.ImagePlacements
array contains 9 entries starting from 0 to 8, as in attached screenshot 9images.PNG
// Load the source PDF document
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(dataDir + "source.pdf");
ImagePlacementAbsorber abs = new ImagePlacementAbsorber();
// Load the contents of first page
doc.Pages.Accept(abs);
Console.WriteLine("Count:" + abs.ImagePlacements.Count);
int i = 0;
foreach (ImagePlacement imagePlacement in abs.ImagePlacements)
{
i++;
}
Console.WriteLine("Counter: " + i);
In case you still notice the issue then elaborate further along with screenshots so that we may investigate and assist you accordingly.