Class PlainTextFormatter


  • public class PlainTextFormatter
    extends java.lang.Object
    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.
    • Field Detail

      • FONTSCALE

        private static final int FONTSCALE
        The scaling factor for font units to PDF units
        See Also:
        Constant Field Values
      • wrapLines

        private final boolean wrapLines
      • width

        private final float width
      • textContent

        private final PlainText textContent
      • horizontalOffset

        private float horizontalOffset
      • verticalOffset

        private float verticalOffset
    • Method Detail

      • format

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

        private void processLines​(java.util.List<PlainText.Line> lines,
                                  boolean isFirstParagraph)
                           throws java.io.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:
        java.io.IOException - if there is an error writing to the stream.