com.aspose.pdf

Interfaces

Classes

Enums

Exceptions

com.aspose.pdf

Class ImagePlacementAbsorber



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

    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.

    • Constructor Detail

      • ImagePlacementAbsorber

        public ImagePlacementAbsorber()

        Initializes new instance of the ImagePlacementAbsorber object.

    • Method Detail

      • isReadOnlyMode

        public final boolean isReadOnlyMode()

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

        Returns:
        boolean value
      • setReadOnlyMode

        public final void setReadOnlyMode(boolean value)

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

        Parameters:
        value - boolean value
      • getImagePlacements

        public ImagePlacementCollection getImagePlacements()

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

        Returns:
        ImagePlacementCollection object
      • visit

        public void visit(Page page)

        Performs search on the specified page.

        Parameters:
        page - Pdf pocument page object.
      • visit

        public void visit(IDocument pdf)

        Performs search on the specified document.

        Parameters:
        pdf - Pdf pocument object.