iText 7 7.1.10 API
iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo Class Reference

Represents image data from a PDF More...

Inheritance diagram for iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo:
iText.Kernel.Pdf.Canvas.Parser.Data.AbstractRenderInfo iText.Kernel.Pdf.Canvas.Parser.Data.IEventData

Public Member Functions

  ImageRenderInfo (Stack< CanvasTag > canvasTagHierarchy, CanvasGraphicsState gs, Matrix ctm, PdfStream imageStream, PdfName resourceName, PdfDictionary colorSpaceDictionary, bool isInline)
  Create an ImageRenderInfo More...
 
virtual PdfImageXObject  GetImage ()
  Gets an image wrapped in ImageXObject. More...
 
virtual PdfName  GetImageResourceName ()
 
virtual Vector  GetStartPoint ()
 
Returns
a vector in User space representing the start point of the image

 
virtual Matrix  GetImageCtm ()
 
virtual float  GetArea ()
 
Returns
the size of the image, in User space units

 
virtual bool  IsInline ()
 
Returns
true if image was inlined in original stream.

 
virtual PdfDictionary  GetColorSpaceDictionary ()
 
Returns
the color space dictionary from resources which are associated with the image

 
virtual IList< CanvasTag GetCanvasTagHierarchy ()
  Gets hierarchy of the canvas tags that wraps given text. More...
 
virtual int  GetMcid ()
 
Returns
the marked content associated with the TextRenderInfo instance.

 
virtual bool  HasMcid (int mcid)
  Checks if the text belongs to a marked content sequence with a given mcid. More...
 
virtual bool  HasMcid (int mcid, bool checkTheTopmostLevelOnly)
  Checks if the text belongs to a marked content sequence with a given mcid. More...
 
- Public Member Functions inherited from iText.Kernel.Pdf.Canvas.Parser.Data.AbstractRenderInfo
  AbstractRenderInfo (CanvasGraphicsState gs)
 
virtual CanvasGraphicsState  GetGraphicsState ()
 
virtual bool  IsGraphicsStatePreserved ()
 
virtual void  PreserveGraphicsState ()
 
virtual void  ReleaseGraphicsState ()
 

Detailed Description

Represents image data from a PDF

Constructor & Destructor Documentation

◆ ImageRenderInfo()

iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.ImageRenderInfo ( Stack< CanvasTag canvasTagHierarchy,
CanvasGraphicsState  gs,
Matrix  ctm,
PdfStream  imageStream,
PdfName  resourceName,
PdfDictionary  colorSpaceDictionary,
bool  isInline 
)
inline

Create an ImageRenderInfo

Parameters
ctm the coordinate transformation matrix at the time the image is rendered
imageStream image stream object
resourceName
Parameters
colorSpaceDictionary the color space dictionary from resources which are associated with the image
isInline defines if the encountered image was inline

Member Function Documentation

◆ GetCanvasTagHierarchy()

virtual IList<CanvasTag> iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetCanvasTagHierarchy ( )
inlinevirtual

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).

◆ GetImage()

virtual PdfImageXObject iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetImage ( )
inlinevirtual

Gets an image wrapped in ImageXObject.

Gets an image wrapped in ImageXObject. You can:

  • get image bytes with iText.Kernel.Pdf.Xobject.PdfImageXObject.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 iText.Kernel.Pdf.PdfObjectWrapper.GetPdfObject() method;
  • convert image to Java.Awt.Image.BufferedImage with iText.Kernel.Pdf.Xobject.PdfImageXObject.GetBufferedImage() ;

◆ GetImageCtm()

virtual Matrix iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetImageCtm ( )
inlinevirtual
Returns
The coordinate transformation matrix which was active when this image was rendered. Coordinates are in User space.

◆ HasMcid() [1/2]

virtual bool iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.HasMcid ( int  mcid )
inlinevirtual

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() [2/2]

virtual bool iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.HasMcid ( int  mcid,
bool  checkTheTopmostLevelOnly 
)
inlinevirtual

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