Class PlainTextFormatter

java.lang.Object
org.apache.pdfbox.pdmodel.interactive.form.PlainTextFormatter

class PlainTextFormatter extends Object
TextFormatter to handle plain text formatting. The text formatter will take a single value or an array of values which are treated as paragraphs.
  • Field Details

    • FONTSCALE

      private static final int FONTSCALE
      The scaling factor for font units to PDF units
      See Also:
    • appearanceStyle

      private final AppearanceStyle appearanceStyle
    • wrapLines

      private final boolean wrapLines
    • width

      private final float width
    • contents

      private final PDPageContentStream contents
    • textContent

      private final PlainText textContent
    • textAlignment

      private final PlainTextFormatter.TextAlign textAlignment
    • horizontalOffset

      private float horizontalOffset
    • verticalOffset

      private float verticalOffset
  • Constructor Details

  • Method Details

    • format

      public void format() throws IOException
      Format the text block.
      Throws:
      IOException - if there is an error writing to the stream.
    • processLines

      private void processLines(List<PlainText.Line> lines, boolean isFirstParagraph) throws IOException
      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.