Class PlainTextFormatter
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.annotation.layout.PlainTextFormatter
TextFormatter to handle plain text formatting for annotation rectangles.
The text formatter will take a single value or an array of values which
are treated as paragraphs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
(package private) static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AppearanceStyle
private final PDAppearanceContentStream
private static final int
The scaling factor for font units to PDF unitsprivate float
private final PlainTextFormatter.TextAlign
private final PlainText
private float
private final float
private final boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
format()
Format the text block.private void
processLines
(List<PlainText.Line> lines, boolean isFirstParagraph) Process lines for output.
-
Field Details
-
FONTSCALE
private static final int FONTSCALEThe scaling factor for font units to PDF units- See Also:
-
appearanceStyle
-
wrapLines
private final boolean wrapLines -
width
private final float width -
contents
-
textContent
-
textAlignment
-
horizontalOffset
private float horizontalOffset -
verticalOffset
private float verticalOffset
-
-
Constructor Details
-
PlainTextFormatter
-
-
Method Details
-
format
Format the text block.- Throws:
IOException
- if there is an error writing to the stream.
-
processLines
Process lines for output. Process lines for an individual paragraph and generate the commands for the content stream to show the text.- Parameters:
lines
- the lines to process.- Throws:
IOException
- if there is an error writing to the stream.
-