iText 8.0.2 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)
  Creates an ImageRenderInfo. More...
 
virtual PdfImageXObject  GetImage ()
  Gets the image wrapped in ImageXObject. More...
 
virtual PdfName  GetImageResourceName ()
  Gets the name of the image resource. More...
 
virtual Vector  GetStartPoint ()
  Gets the vector in User space representing the start point of the image. More...
 
virtual Matrix  GetImageCtm ()
  Gets the coordinate transformation matrix in User space which was active when this image was rendered. More...
 
virtual float  GetArea ()
  Gets the size of the image in User space units. More...
 
virtual bool  IsInline ()
  Gets the inline flag. More...
 
virtual PdfDictionary  GetColorSpaceDictionary ()
  Gets the color space dictionary of the image. More...
 
virtual IList< CanvasTag GetCanvasTagHierarchy ()
  Gets hierarchy of the canvas tags that wraps given text. More...
 
virtual int  GetMcid ()
  Gets the marked-content identifier associated with this ImageRenderInfo instance More...
 
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

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

Member Function Documentation

◆ GetArea()

virtual float iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetArea ( )
inlinevirtual

Gets the size of the image in User space units.

Returns
the size of the image, in User space units

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

◆ GetColorSpaceDictionary()

virtual PdfDictionary iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetColorSpaceDictionary ( )
inlinevirtual

Gets the color space dictionary of the image.

Returns
the color space dictionary from resources which are associated with the image

◆ GetImage()

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

Gets the image wrapped in ImageXObject.

Gets the 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 System.Drawing.Bitmap with iText.Kernel.Pdf.Xobject.PdfImageXObject.GetBufferedImage() ;
Returns
the image

◆ GetImageCtm()

virtual Matrix iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetImageCtm ( )
inlinevirtual

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

◆ GetImageResourceName()

virtual PdfName iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetImageResourceName ( )
inlinevirtual

Gets the name of the image resource.

Returns
the name of the image resource

◆ GetMcid()

virtual int iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetMcid ( )
inlinevirtual

Gets the marked-content identifier associated with this ImageRenderInfo instance

Returns
associated marked-content identifier or -1 in case content is unmarked

◆ GetStartPoint()

virtual Vector iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.GetStartPoint ( )
inlinevirtual

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

◆ 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

◆ IsInline()

virtual bool iText.Kernel.Pdf.Canvas.Parser.Data.ImageRenderInfo.IsInline ( )
inlinevirtual

Gets the inline flag.

Returns

true if image was inlined in original stream