Class PlainTextFormatter
java.lang.Object
org.apache.pdfbox.pdmodel.interactive.form.PlainTextFormatter
TextFormatter to handle plain text formatting.
The text formatter will take a single value or an array of values which
are treated as paragraphs.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class(package private) static enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final AppearanceStyleprivate final PDPageContentStreamprivate static final intThe scaling factor for font units to PDF unitsprivate floatprivate final PlainTextFormatter.TextAlignprivate final PlainTextprivate floatprivate final floatprivate final boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidformat()Format the text block.private voidprocessLines(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.
-