Class ImageRenderInfo

    • Field Detail

      • ctm

        private final Matrix ctm
        The coordinate transformation matrix that was in effect when the image was rendered.
      • colorSpaceDictionary

        private final PdfDictionary colorSpaceDictionary
        The color space dictionary from resources which are associated with the image.
      • isInline

        private final boolean isInline
        Defines if the encountered image was inline.
      • resourceName

        private final PdfName resourceName
      • canvasTagHierarchy

        private final java.util.List<CanvasTag> canvasTagHierarchy
        Hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer.
    • Constructor Detail

      • ImageRenderInfo

        public ImageRenderInfo​(java.util.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 Detail

      • 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 java.util.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 this ImageRenderInfo instance is associated with a marked content sequence with a given mcid.
        Parameters:
        mcid - a marked content id
        Returns:
        true if the image is marked with this id, false otherwise
      • hasMcid

        public boolean hasMcid​(int mcid,
                               boolean checkTheTopmostLevelOnly)
        Checks if this ImageRenderInfo instance is associated with 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 this ImageRenderInfo instance is marked with this id, false otherwise