ImagePlacementAbsorber Class
Represents an absorber object of image placement objects. Performs search of image usages and provides access to search results via ImagePlacements collection.
Inheritance Hierarchy
SystemObject
  Aspose.PdfImagePlacementAbsorber

Namespace: Aspose.Pdf
Assembly: Aspose.PDF (in Aspose.PDF.dll) Version: 20.11
Syntax
public sealed class ImagePlacementAbsorber

The ImagePlacementAbsorber type exposes the following members.

Constructors
  NameDescription
Public methodImagePlacementAbsorber
Initializes a new instance of the ImagePlacementAbsorber class
Properties
  NameDescription
Public propertyImagePlacements
Gets collection of image placement occurrences that are presented with ImagePlacement objects.
Public propertyIsReadOnlyMode
Gets/sets read only mode for parsing operations collection. It may help against out of memory exceptions.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)
Public methodVisit(Document)
Performs search on the specified document.
Public methodVisit(Page)
Performs search on the specified page.
Remarks
The ImagePlacementAbsorber object is basically used in images search scenario. When the search is completed the occurrences are represented with ImagePlacement objects that the ImagePlacements collection contains. The ImagePlacement object provides access to the image placement properties: dimensions, resolution etc.
Examples
The example demonstrates how to find images on the first PDF document page and get the image placement properties.
C#
// 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.Pages[1].Accept(abs);

// Display image placement properties for all placements
foreach (ImagePlacement imagePlacement in abs.ImagePlacements)
{     
    Console.Out.WriteLine("image width:" + imagePlacement.Rectangle.Width);
    Console.Out.WriteLine("image height:" + imagePlacement.Rectangle.Height);
    Console.Out.WriteLine("image LLX:" + imagePlacement.Rectangle.LLX);
    Console.Out.WriteLine("image LLY:" + imagePlacement.Rectangle.LLY);
    Console.Out.WriteLine("image horizontal resolution:" + imagePlacement.Resolution.X);
    Console.Out.WriteLine("image vertical resolution:" + imagePlacement.Resolution.Y);
}
See Also