Package com.itextpdf.text.pdf.parser
Class ImageRenderInfo
- java.lang.Object
-
- com.itextpdf.text.pdf.parser.ImageRenderInfo
-
public class ImageRenderInfo extends java.lang.ObjectRepresents image data from a PDF- Since:
- 5.0.1
-
-
Field Summary
Fields Modifier and Type Field Description private PdfDictionarycolorSpaceDictionarythe color space associated with the imageprivate GraphicsStategsThe graphics state that was in effect when the image was renderedprivate PdfImageObjectimageObjectthe image object to be rendered, if it has been parsed already.private InlineImageInfoinlineImageInfoA reference to an inline imageprivate java.util.Collection<MarkedContentInfo>markedContentInfosArray containing marked content info for the text.private PdfIndirectReferencerefA reference to the image XObject
-
Constructor Summary
Constructors Modifier Constructor Description privateImageRenderInfo(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)privateImageRenderInfo(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static ImageRenderInfocreateForEmbeddedImage(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)Create an ImageRenderInfo object based on inline image data.static ImageRenderInfocreateForXObject(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary)Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)static ImageRenderInfocreateForXObject(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)floatgetArea()BaseColorgetCurrentFillColor()PdfImageObjectgetImage()Gets an object containing the image dictionary and bytes.MatrixgetImageCTM()java.lang.IntegergetMcid()PdfIndirectReferencegetRef()VectorgetStartPoint()booleanhasMcid(int mcid)Checks if the text belongs to a marked content sequence with a given mcid.booleanhasMcid(int mcid, boolean checkTheTopmostLevelOnly)Checks if the text belongs to a marked content sequence with a given mcid.private voidprepareImageObject()
-
-
-
Field Detail
-
gs
private final GraphicsState gs
The graphics state that was in effect when the image was rendered
-
ref
private final PdfIndirectReference ref
A reference to the image XObject
-
inlineImageInfo
private final InlineImageInfo inlineImageInfo
A reference to an inline image
-
colorSpaceDictionary
private final PdfDictionary colorSpaceDictionary
the color space associated with the image
-
imageObject
private PdfImageObject imageObject
the image object to be rendered, if it has been parsed already. Null otherwise.
-
markedContentInfos
private final java.util.Collection<MarkedContentInfo> markedContentInfos
Array containing marked content info for the text.- Since:
- 5.0.2
-
-
Constructor Detail
-
ImageRenderInfo
private ImageRenderInfo(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)
-
ImageRenderInfo
private ImageRenderInfo(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)
-
-
Method Detail
-
createForXObject
public static ImageRenderInfo createForXObject(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary)
Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)- Parameters:
gs- graphic state of the XObjectref- a reference to the image XObjectcolorSpaceDictionary- colourspace of the image- Returns:
- the ImageRenderInfo representing the rendered XObject
- Since:
- 5.0.1
-
createForXObject
public static ImageRenderInfo createForXObject(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)
Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)- Parameters:
gs- graphic state of the XObjectref- a reference to the image XObjectcolorSpaceDictionary- colourspace of the imagemarkedContentInfo- marked content information for the XObject- Returns:
- the ImageRenderInfo representing the rendered XObject
- Since:
- 5.5.11
-
createForEmbeddedImage
protected static ImageRenderInfo createForEmbeddedImage(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, java.util.Collection<MarkedContentInfo> markedContentInfo)
Create an ImageRenderInfo object based on inline image data.- Parameters:
gs- graphic state of the XObjectInlineImageInfo- a reference to the inline imagecolorSpaceDictionary- colourspace of the imagemarkedContentInfo- marked content information for the XObject- Returns:
- the ImageRenderInfo representing the rendered embedded image
- Since:
- 5.0.1
-
getImage
public PdfImageObject getImage() throws java.io.IOException
Gets an object containing the image dictionary and bytes.- Returns:
- an object containing the image dictionary and byte[]
- Throws:
java.io.IOException- Since:
- 5.0.2
-
prepareImageObject
private void prepareImageObject() throws java.io.IOException- Throws:
java.io.IOException
-
getStartPoint
public Vector getStartPoint()
- Returns:
- a vector in User space representing the start point of the xobject
-
getImageCTM
public Matrix getImageCTM()
- Returns:
- The coordinate transformation matrix active when this image was rendered. Coordinates are in User space.
- Since:
- 5.0.3
-
getArea
public float getArea()
- Returns:
- the size of the image, in User space units
- Since:
- 5.0.3
-
getRef
public PdfIndirectReference getRef()
- Returns:
- an indirect reference to the image
- Since:
- 5.0.2
-
getCurrentFillColor
public BaseColor getCurrentFillColor()
- Returns:
- the current fill color from the graphics state at the time this render operation occured
- Since:
- 5.5.7
-
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
- Since:
- 5.5.11
-
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 idcheckTheTopmostLevelOnly- indicates whether to check the topmost level of marked content stack only- Returns:
- true if the text is marked with this id
- Since:
- 5.5.11
-
getMcid
public java.lang.Integer getMcid()
- Returns:
- the marked content associated with the TextRenderInfo instance.
-
-