public final class ImagePlacementAbsorber extends Object
Represents an absorber object of image placement objects.
Performs search of image usages and provides access to search results via ImagePlacementAbsorber.ImagePlacements
collection.
The example demonstrates how to find images on the first PDF document page and get the image placement properties.// Open document 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 doc.getPages().get_Item(1).accept(abs); // Display image placement properties for all placements for (ImagePlacement imagePlacement : abs.getImagePlacements()) { System.out.println("image width:" + imagePlacement.getRectangle().getWidth()); System.out.println("image height:" + imagePlacement.getRectangle().getHeight()); System.out.println("image LLX:" + imagePlacement.getRectangle(0).getX()); System.out.println("image LLY:" + imagePlacement.getRectangle.getY()); System.out.println("image horizontal resolution:" + imagePlacement.getResolution().getX()); System.out.println("image vertical resolution:" + imagePlacement.getResolution().getY()); }
ImagePlacementAbsorber
object is basically used in images search scenario.
When the search is completed the occurrences are represented with ImagePlacement
objects that the ImagePlacementAbsorber.ImagePlacements
collection contains.
The ImagePlacement
object provides access to the image placement properties: dimensions, resolution etc.
Constructor and Description |
---|
ImagePlacementAbsorber()
Initializes new instance of the
ImagePlacementAbsorber object. |
Modifier and Type | Method and Description |
---|---|
ImagePlacementCollection |
getImagePlacements()
Gets collection of image placement occurrences that are presented with
ImagePlacement objects. |
void |
visit(IDocument pdf)
Performs search on the specified document.
|
void |
visit(Page page)
Performs search on the specified page.
|
public ImagePlacementAbsorber()
Initializes new instance of the ImagePlacementAbsorber
object.
public ImagePlacementCollection getImagePlacements()
Gets collection of image placement occurrences that are presented with ImagePlacement
objects.
public void visit(Page page)
Performs search on the specified page.
public void visit(IDocument pdf)
Performs search on the specified document.
Copyright © 2017 Aspose. All Rights Reserved.