public class TextLine extends Object implements TextSequence
StyledTexts. It may be terminated by a
new line.| Constructor and Description |
|---|
TextLine() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(StyledText fragment)
Adds a styled text.
|
void |
add(TextLine textLine)
Adds all styled texts of the given text line.
|
void |
drawAligned(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position upperLeft,
Alignment alignment,
float availableLineWidth,
DrawListener drawListener) |
void |
drawText(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position upperLeft,
Alignment alignment,
DrawListener drawListener)
Draws the text of the (PdfBox-) cursor position.
|
protected float |
getAscent() |
float |
getHeight() |
NewLine |
getNewLine() |
List<StyledText> |
getStyledTexts() |
float |
getWidth() |
boolean |
isEmpty() |
Iterator<TextFragment> |
iterator() |
void |
setNewLine(NewLine newLine)
Sets the new line.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic void add(StyledText fragment)
fragment - the fagment to add.public void add(TextLine textLine)
textLine - the text line to add.public NewLine getNewLine()
null.public void setNewLine(NewLine newLine)
newLine - the new line.public List<StyledText> getStyledTexts()
public Iterator<TextFragment> iterator()
iterator in interface Iterable<TextFragment>public boolean isEmpty()
true if the line contains neither styled text nor a
new line.public float getWidth()
throws IOException
getWidth in interface AreaIOException - by pdfboxpublic float getHeight()
throws IOException
getHeight in interface AreaIOException - by pdfboxprotected float getAscent()
throws IOException
IOException - by pdfbox.public void drawText(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position upperLeft,
Alignment alignment,
DrawListener drawListener)
throws IOException
DrawableTextdrawText in interface DrawableTextcontentStream - the content stream used to render.upperLeft - the upper left position to draw to.alignment - the text alignment.drawListener - the listener to
notify on drawn objects.IOException - by pdfbox.public void drawAligned(org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position upperLeft,
Alignment alignment,
float availableLineWidth,
DrawListener drawListener)
throws IOException
IOExceptionCopyright © 2021. All rights reserved.