| Package | Description |
|---|---|
| rst.pdfbox.layout.elements | |
| rst.pdfbox.layout.text |
| Modifier and Type | Class and Description |
|---|---|
class |
Paragraph
A paragraph is used as a container for
text that is drawn as
one element. |
| Modifier and Type | Class and Description |
|---|---|
class |
TextFlow
A text flow is a text sequence that
respects a given
width by word wrapping the text. |
class |
TextLine
A text of line containing only
StyledTexts. |
| Modifier and Type | Method and Description |
|---|---|
TextSequence |
StyledText.asSequence() |
| Modifier and Type | Method and Description |
|---|---|
void |
TextFlow.add(TextSequence sequence)
Adds a text sequence to this flow.
|
static TextFlow |
TextSequenceUtil.deWrap(TextSequence text)
De-wraps the given text, means any new lines introduced by wrapping will
be removed.
|
static Dividable.Divided |
TextSequenceUtil.divide(TextSequence text,
float maxWidth,
float maxHeight)
Word-wraps and divides the given text sequence.
|
static void |
TextSequenceUtil.drawText(TextSequence text,
org.apache.pdfbox.pdmodel.PDPageContentStream contentStream,
Position upperLeft,
DrawListener drawListener,
Alignment alignment,
float maxWidth,
float lineSpacing,
boolean applyLineSpacingToFirstLine)
Draws the given text sequence to the PDPageContentStream at the given
position.
|
static float |
TextSequenceUtil.getHeight(TextSequence textSequence,
float maxWidth,
float lineSpacing,
boolean applyLineSpacingToFirstLine)
Calculates the height of the text
|
static List<TextLine> |
TextSequenceUtil.getLines(TextSequence text)
Dissects the given sequence into
TextLines. |
static float |
TextSequenceUtil.getOffset(TextSequence textLine,
float targetWidth,
Alignment alignment)
Gets the (left) offset of the line with respect to the target width and
alignment.
|
static float |
TextSequenceUtil.getWidth(TextSequence textSequence,
float maxWidth)
Calculates the width of the text
|
static TextFlow |
TextSequenceUtil.wordWrap(TextSequence text,
float maxWidth)
Word-wraps the given text sequence in order to fit the max width.
|
static List<TextLine> |
TextSequenceUtil.wordWrapToLines(TextSequence text,
float maxWidth)
Convencience function that
word-wraps into TextSequenceUtil.getLines(TextSequence). |
Copyright © 2022. All rights reserved.