public class TextRenderInfo extends AbstractRenderInfo
PdfCanvasProcessor and
IEventListener objects as text rendering operations are
discoveredgs| Constructor and Description |
|---|
TextRenderInfo(PdfString str,
CanvasGraphicsState gs,
Matrix textMatrix,
Stack<CanvasTag> canvasTagHierarchy)
Creates a new TextRenderInfo object
|
| Modifier and Type | Method and Description |
|---|---|
String |
getActualText()
Gets /ActualText tag entry value if this text chunk is marked content.
|
LineSegment |
getAscentLine()
Gets the ascent line for the text (i.e.
|
LineSegment |
getBaseline()
Gets the baseline for the text (i.e.
|
List<CanvasTag> |
getCanvasTagHierarchy()
Gets hierarchy of the canvas tags that wraps given text.
|
List<TextRenderInfo> |
getCharacterRenderInfos()
Provides detail useful if a listener needs access to the position of each individual glyph in the text render operation
|
float |
getCharSpacing() |
LineSegment |
getDescentLine()
Gets the descent line for the text (i.e.
|
String |
getExpansionText()
Gets /E tag (expansion text) entry value if this text chunk is marked content.
|
Color |
getFillColor() |
PdfFont |
getFont()
Getter for the font
|
float |
getFontSize() |
float |
getHorizontalScaling() |
float |
getLeading() |
int |
getMcid()
Gets the marked-content identifier associated with this
TextRenderInfo instance |
PdfString |
getPdfString() |
float |
getRise()
The rise represents how far above the nominal baseline the text should be rendered.
|
float |
getSingleSpaceWidth() |
Color |
getStrokeColor() |
String |
getText()
Gets the text to be rendered according to canvas operators.
|
Matrix |
getTextMatrix()
Gets original Text matrix.
|
int |
getTextRenderMode() |
LineSegment |
getUnscaledBaseline() |
float |
getUnscaledWidth() |
float |
getWordSpacing() |
boolean |
hasMcid(int mcid)
Checks if the text belongs to a marked content sequence
with a given mcid.
|
boolean |
hasMcid(int mcid,
boolean checkTheTopmostLevelOnly)
Checks if the text belongs to a marked content sequence
with a given mcid.
|
boolean |
isReversedChars()
Determines if the text represented by this
TextRenderInfo instance is written in a text showing operator
wrapped by /ReversedChars marked content sequence |
checkGraphicsState, getGraphicsState, isGraphicsStatePreserved, preserveGraphicsState, releaseGraphicsStatepublic TextRenderInfo(PdfString str, CanvasGraphicsState gs, Matrix textMatrix, Stack<CanvasTag> canvasTagHierarchy)
str - the PDF string that should be displayedgs - the graphics state (note: at this time, this is not immutable, so don't cache it)textMatrix - the text matrix at the time of the render operationcanvasTagHierarchy - the marked content tags sequence, if availablepublic String getText()
public PdfString getPdfString()
public Matrix getTextMatrix()
public boolean hasMcid(int mcid)
mcid - a marked content idpublic boolean hasMcid(int mcid,
boolean checkTheTopmostLevelOnly)
mcid - a marked content idcheckTheTopmostLevelOnly - indicates whether to check the topmost level of marked content stack onlypublic int getMcid()
TextRenderInfo instancepublic LineSegment getBaseline()
getRise() for the amount added by Risepublic LineSegment getUnscaledBaseline()
public LineSegment getAscentLine()
getRise() for the amount added by Rise.public LineSegment getDescentLine()
getRise() for the amount added by Rise.public PdfFont getFont()
public float getRise()
getBaseline(), getAscentLine() and getDescentLine() methods already include Rise.
This method is exposed to allow listeners to determine if an explicit rise was involved in the computation of the baseline (this might be useful, for example, for identifying superscript rendering)public List<TextRenderInfo> getCharacterRenderInfos()
TextRenderInfo objects that represent each glyph used in the draw operation. The next effect is if there was a separate Tj opertion for each character in the rendered stringpublic float getSingleSpaceWidth()
public int getTextRenderMode()
public Color getFillColor()
public Color getStrokeColor()
public float getFontSize()
public float getHorizontalScaling()
public float getCharSpacing()
public float getWordSpacing()
public float getLeading()
public String getActualText()
null if none foundpublic String getExpansionText()
null if none foundpublic boolean isReversedChars()
TextRenderInfo instance is written in a text showing operator
wrapped by /ReversedChars marked content sequencetrue if this text block lies within /ReversedChars block, false otherwisepublic List<CanvasTag> getCanvasTagHierarchy()
public float getUnscaledWidth()
Copyright © 1998–2024 Apryse Group NV. All rights reserved.