ImagePlacementAbsorber

Inheritance: java.lang.Object

public final class ImagePlacementAbsorber

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 : ```
(Iterable)
```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());
 }

The 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.

Image positive rotation is counterclockwise, for the page, it is clockwise. Here, we need to represent the image rotation angle, so we deduct the page angle from the image angle.

Constructors

ConstructorDescription
ImagePlacementAbsorber()Initializes new instance of the ImagePlacementAbsorber object.

Methods

MethodDescription
isReadOnlyMode()Gets/sets read only mode for parsing operations collection.
setReadOnlyMode(boolean value)Gets/sets read only mode for parsing operations collection.
getImagePlacements()Gets collection of image placement occurrences that are presented with ImagePlacement objects.
visit(Page page)Performs search on the specified page.
visit(IDocument pdf)Performs search on the specified document.

ImagePlacementAbsorber()

public ImagePlacementAbsorber()

Initializes new instance of the ImagePlacementAbsorber object.

isReadOnlyMode()

public final boolean isReadOnlyMode()

Gets/sets read only mode for parsing operations collection. It may help against out of memory exceptions.

Returns: boolean - boolean value

setReadOnlyMode(boolean value)

public final void setReadOnlyMode(boolean value)

Gets/sets read only mode for parsing operations collection. It may help against out of memory exceptions.

Parameters:

ParameterTypeDescription
valuebooleanboolean value

getImagePlacements()

public ImagePlacementCollection getImagePlacements()

Gets collection of image placement occurrences that are presented with ImagePlacement objects.

Returns: ImagePlacementCollection - ImagePlacementCollection object

visit(Page page)

public void visit(Page page)

Performs search on the specified page.

Parameters:

ParameterTypeDescription
pagePagePdf pocument page object.

visit(IDocument pdf)

public void visit(IDocument pdf)

Performs search on the specified document.

Parameters:

ParameterTypeDescription
pdfIDocumentPdf pocument object.