Hi,
Hi Jun,
Thanks for your inquiry.
You can use ImagePlacementAbsorber to extract ImagePlacement from PDF document and get rectangle of the images later. Please check following code snippet, in order to achieve that.
Document doc = new Document(dataDir + “input.pdf”);
ImagePlacementAbsorber abs = new ImagePlacementAbsorber();
doc.getPages().get_Item(1).accept(abs);
for (int i = 1; i <= abs.getImagePlacements().size(); i++)
{
ImagePlacement image = abs.getImagePlacements().get_Item(i);
System.out .println("LLX : " + image.getRectangle().getLLX());
System.out .println("LLY : " + image.getRectangle().getLLY());
System.out .println("URX : " + image.getRectangle().getURX());
System.out .println("URY : " + image.getRectangle().getURY());
}
In case in you face any issue, please share your input document, so that we can test the scenario in our environment and address it accordingly.
Best Regards,