public class ParsedText extends ParsedTextImpl
Modifier and Type | Field and Description |
---|---|
protected GraphicsState |
gs |
protected PdfString |
pdfText
retain original PdfString as we need to distinguish between the code points contained there,
and the stadnard Java (Unicode strings) that actually represent the content of this text.
|
protected Matrix |
textToUserSpaceTransformMatrix |
Modifier and Type | Method and Description |
---|---|
void |
accumulate(TextAssembler p,
String contextName)
We pass ourselves to the assembler, which is a visitor, so that it can
accumulate information on this text depending on its type.
|
void |
assemble(TextAssembler p) |
boolean |
breakBefore() |
protected String |
decode(PdfString in)
This constructor should only be called when the origin for text display is at (0,0) and the
graphical state reflects all transformations of the baseline.
|
protected String |
decode(String in)
Decodes a Java String containing glyph ids encoded in the font's encoding, and determine the
unicode equivalent
|
List<Word> |
getAsPartialWords()
Break this string if there are spaces within it.
|
FinalText |
getFinalText(PdfReader reader,
int page,
TextAssembler assembler,
boolean useMarkup) |
String |
getFontCodes() |
String |
getText()
when returning the text from this item, we need to decode the code points we have.
|
float |
getUnscaledTextWidth(GraphicsState gs) |
boolean |
shouldNotSplit() |
String |
toString() |
getAscent, getBaseline, getDescent, getEndPoint, getSingleSpaceWidth, getStartPoint, getWidth
protected final Matrix textToUserSpaceTransformMatrix
protected final GraphicsState gs
protected PdfString pdfText
protected String decode(String in)
in
- the String that needs to be decodedprotected String decode(PdfString in)
in
- the String that needs to be encodedpublic List<Word> getAsPartialWords()
public float getUnscaledTextWidth(GraphicsState gs)
gs
- graphic state including current transformation to page coordinates from text
measurementpublic void accumulate(TextAssembler p, String contextName)
TextAssemblyBuffer
p
- the assembler that is visiting us.contextName
- Name of the surrounding markup element/"context" if
we're generating tagged output.TextAssemblyBuffer.accumulate(com.lowagie.text.pdf.parser.TextAssembler, String)
public void assemble(TextAssembler p)
p
- we may pass ourselves to this assembler again during the final
assembly process.TextAssemblyBuffer.assemble(com.lowagie.text.pdf.parser.TextAssembler)
public String getText()
getText
in interface TextAssemblyBuffer
getText
in class ParsedTextImpl
ParsedTextImpl.getText()
public String getFontCodes()
public FinalText getFinalText(PdfReader reader, int page, TextAssembler assembler, boolean useMarkup)
reader
- pdfReader that knows about our document. (size, etc. available
here).page
- which page are we extracting text from.assembler
- Builds result by accepting content from text components of
various sorts.useMarkup
- Should we generate tagged text, or just plain text.TextAssemblyBuffer.getFinalText(com.lowagie.text.pdf.PdfReader,
int, com.lowagie.text.pdf.parser.TextAssembler, boolean)
public String toString()
toString
in class Object
Object.toString()
public boolean shouldNotSplit()
shouldNotSplit
in class ParsedTextImpl
ParsedTextImpl.shouldNotSplit()
public boolean breakBefore()
breakBefore
in class ParsedTextImpl
ParsedTextImpl.breakBefore()
Copyright © 2018. All rights reserved.