Class ImageRenderInfo
Represents image data from a PDF.
public class ImageRenderInfo : AbstractRenderInfo, IEventData
- Inheritance
-
ImageRenderInfo
- Implements
- Inherited Members
Constructors
ImageRenderInfo(Stack<CanvasTag>, CanvasGraphicsState, Matrix, PdfStream, PdfName, PdfDictionary, bool)
Creates an ImageRenderInfo.
public ImageRenderInfo(Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Matrix ctm, PdfStream imageStream, PdfName resourceName, PdfDictionary colorSpaceDictionary, bool isInline)
Parameters
canvasTagHierarchy
Stack<CanvasTag>the hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer
gs
CanvasGraphicsStatectm
Matrixthe coordinate transformation matrix at the time the image is rendered
imageStream
PdfStreamthe image stream object
resourceName
PdfNamethe name of the image resource
colorSpaceDictionary
PdfDictionarythe color space dictionary from resources which are associated with the image
isInline
booldefines if the encountered image was inline
Methods
GetArea()
Gets the size of the image in User space units.
public virtual float GetArea()
Returns
- float
the size of the image, in User space units
GetCanvasTagHierarchy()
Gets hierarchy of the canvas tags that wraps given text.
public virtual IList<CanvasTag> GetCanvasTagHierarchy()
Returns
- IList<CanvasTag>
list of the wrapping canvas tags. The first tag is the innermost (nearest to the text).
GetColorSpaceDictionary()
Gets the color space dictionary of the image.
public virtual PdfDictionary GetColorSpaceDictionary()
Returns
- PdfDictionary
the color space dictionary from resources which are associated with the image
GetImage()
Gets the image wrapped in ImageXObject.
public virtual PdfImageXObject GetImage()
Returns
- PdfImageXObject
the image
Remarks
Gets the image wrapped in ImageXObject. You can:
- get image bytes with GetImageBytes(bool) , these image bytes represent native image, i.e you can write these bytes to disk and get just an usual image;
- obtain PdfStream object which contains image dictionary with GetPdfObject() method;
- convert image to
with ; // Android-Conversion-Skip-Line (java.awt library isn't available on Android)
GetImageCtm()
Gets the coordinate transformation matrix in User space which was active when this image was rendered.
public virtual Matrix GetImageCtm()
Returns
- Matrix
the coordinate transformation matrix in User space which was active when this image was rendered
GetImageResourceName()
Gets the name of the image resource.
public virtual PdfName GetImageResourceName()
Returns
GetMcid()
Gets the marked-content identifier associated with this ImageRenderInfo instance.
public virtual int GetMcid()
Returns
- int
associated marked-content identifier or -1 in case content is unmarked
GetStartPoint()
Gets the vector in User space representing the start point of the image.
public virtual Vector GetStartPoint()
Returns
HasMcid(int)
Checks if this ImageRenderInfo instance is associated with a marked content sequence with a given mcid.
public virtual bool HasMcid(int mcid)
Parameters
mcid
inta marked content id
Returns
HasMcid(int, bool)
Checks if this ImageRenderInfo instance is associated with a marked content sequence with a given mcid.
public virtual bool HasMcid(int mcid, bool checkTheTopmostLevelOnly)
Parameters
mcid
inta marked content id
checkTheTopmostLevelOnly
boolindicates whether to check the topmost level of marked content stack only
Returns
- bool
true if this ImageRenderInfo instance is marked with this id, false otherwise
IsInline()
Gets the inline flag.
public virtual bool IsInline()