Package com.itextpdf.text.pdf.parser
Class ImageRenderInfo
java.lang.Object
com.itextpdf.text.pdf.parser.ImageRenderInfo
Represents image data from a PDF
- Since:
- 5.0.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final PdfDictionarythe color space associated with the imageprivate final GraphicsStateThe graphics state that was in effect when the image was renderedprivate PdfImageObjectthe image object to be rendered, if it has been parsed already.private final InlineImageInfoA reference to an inline imageprivate final Collection<MarkedContentInfo> Array containing marked content info for the text.private final PdfIndirectReferenceA reference to the image XObject -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateImageRenderInfo(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, Collection<MarkedContentInfo> markedContentInfo) privateImageRenderInfo(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, Collection<MarkedContentInfo> markedContentInfo) -
Method Summary
Modifier and TypeMethodDescriptionprotected static ImageRenderInfocreateForEmbeddedImage(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, 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, Collection<MarkedContentInfo> markedContentInfo) Create an ImageRenderInfo object based on an XObject (this is the most common way of including an image in PDF)floatgetArea()getImage()Gets an object containing the image dictionary and bytes.getMcid()getRef()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 void
-
Field Details
-
gs
The graphics state that was in effect when the image was rendered -
ref
A reference to the image XObject -
inlineImageInfo
A reference to an inline image -
colorSpaceDictionary
the color space associated with the image -
imageObject
the image object to be rendered, if it has been parsed already. Null otherwise. -
markedContentInfos
Array containing marked content info for the text.- Since:
- 5.0.2
-
-
Constructor Details
-
ImageRenderInfo
private ImageRenderInfo(GraphicsState gs, PdfIndirectReference ref, PdfDictionary colorSpaceDictionary, Collection<MarkedContentInfo> markedContentInfo) -
ImageRenderInfo
private ImageRenderInfo(GraphicsState gs, InlineImageInfo inlineImageInfo, PdfDictionary colorSpaceDictionary, Collection<MarkedContentInfo> markedContentInfo)
-
-
Method Details
-
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, 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, Collection<MarkedContentInfo> markedContentInfo) Create an ImageRenderInfo object based on inline image data.- Parameters:
gs- graphic state of the XObjectcolorSpaceDictionary- colourspace of the imagemarkedContentInfo- marked content information for the XObjectInlineImageInfo- a reference to the inline image- Returns:
- the ImageRenderInfo representing the rendered embedded image
- Since:
- 5.0.1
-
getImage
Gets an object containing the image dictionary and bytes.- Returns:
- an object containing the image dictionary and byte[]
- Throws:
IOException- Since:
- 5.0.2
-
prepareImageObject
- Throws:
IOException
-
getStartPoint
- Returns:
- a vector in User space representing the start point of the xobject
-
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
- Returns:
- an indirect reference to the image
- Since:
- 5.0.2
-
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
- Returns:
- the marked content associated with the TextRenderInfo instance.
-