Class ImageRenderInfo

java.lang.Object
com.itextpdf.kernel.pdf.canvas.parser.data.AbstractRenderInfo
com.itextpdf.kernel.pdf.canvas.parser.data.ImageRenderInfo
All Implemented Interfaces:
IEventData

public class ImageRenderInfo extends AbstractRenderInfo
Represents image data from a PDF.
  • Constructor Details

    • ImageRenderInfo

      public ImageRenderInfo (Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Matrix ctm, PdfStream imageStream, PdfName resourceName, PdfDictionary colorSpaceDictionary, boolean isInline)
      Creates an ImageRenderInfo.
      Parameters:
      canvasTagHierarchy - the hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer
      gs - the canvas graphics state
      ctm - the coordinate transformation matrix at the time the image is rendered
      imageStream - the image stream object
      resourceName - the name of the image resource
      colorSpaceDictionary - the color space dictionary from resources which are associated with the image
      isInline - defines if the encountered image was inline
  • Method Details

    • getImage

      public PdfImageXObject getImage()
      Gets the image wrapped in ImageXObject. You can:
      Returns:
      the image
    • getImageResourceName

      public PdfName getImageResourceName()
      Gets the name of the image resource.
      Returns:
      the name of the image resource
    • getStartPoint

      public Vector getStartPoint()
      Gets the vector in User space representing the start point of the image.
      Returns:
      the vector in User space representing the start point of the image
    • getImageCtm

      public Matrix getImageCtm()
      Gets the coordinate transformation matrix in User space which was active when this image was rendered.
      Returns:
      the coordinate transformation matrix in User space which was active when this image was rendered
    • getArea

      public float getArea()
      Gets the size of the image in User space units.
      Returns:
      the size of the image, in User space units
    • isInline

      public boolean isInline()
      Gets the inline flag.
      Returns:
      true if image was inlined in original stream
    • getColorSpaceDictionary

      public PdfDictionary getColorSpaceDictionary()
      Gets the color space dictionary of the image.
      Returns:
      the color space dictionary from resources which are associated with the image
    • getCanvasTagHierarchy

      public List<CanvasTag> getCanvasTagHierarchy()
      Gets hierarchy of the canvas tags that wraps given text.
      Returns:
      list of the wrapping canvas tags. The first tag is the innermost (nearest to the text).
    • getMcid

      public int getMcid()
      Gets the marked-content identifier associated with this ImageRenderInfo instance
      Returns:
      associated marked-content identifier or -1 in case content is unmarked
    • hasMcid

      public boolean hasMcid (int mcid)
      Checks if the text belongs to a marked content sequence with a given mcid.
      Parameters:
      mcid - a marked content id
      Returns:
      true if the text is marked with this id
    • hasMcid

      public boolean hasMcid (int mcid, boolean checkTheTopmostLevelOnly)
      Checks if the text belongs to a marked content sequence with a given mcid.
      Parameters:
      mcid - a marked content id
      checkTheTopmostLevelOnly - indicates whether to check the topmost level of marked content stack only
      Returns:
      true if the text is marked with this id