Class ParsedText

    • Method Detail

      • decode

        protected String decode​(String in)
        Decodes a Java String containing glyph ids encoded in the font's encoding, and determine the unicode equivalent
        Parameters:
        in - the String that needs to be decoded
        Returns:
        the decoded String
      • decode

        protected String decode​(PdfString pdfString)
        This constructor should only be called when the origin for text display is at (0,0) and the graphical state reflects all transformations of the baseline. This is in text space units.

        Decodes a PdfString (which will contain glyph ids encoded in the font's encoding) based on the active font, and determine the unicode equivalent

        Parameters:
        pdfString - the String that needs to be encoded
        Returns:
        the encoded String
        Since:
        2.1.7
      • getAsPartialWords

        public List<Word> getAsPartialWords()
        Break this string if there are spaces within it. If so, we mark the new Words appropriately for later assembly.

        We are guaranteed that every space (internal word break) in this parsed text object will create a new word in the result of this method. We are not guaranteed that these Word objects are actually words until they have been assembled.

        The word following any space preserves that space in its string value, so that the assembler will not erroneously merge words that should be separate, regardless of the spacing.

        Returns:
        list of Word objects.
      • getUnscaledTextWidth

        public float getUnscaledTextWidth​(GraphicsState gs)
        Parameters:
        gs - graphic state including current transformation to page coordinates from text measurement
        Returns:
        the unscaled (i.e. in Text space) width of our text
      • accumulate

        public void accumulate​(TextAssembler textAssembler,
                               String contextName)
        We pass ourselves to the assembler, which is a visitor, so that it can accumulate information on this text depending on its type. The result is calculated by a final "assembly" phase, after accumulation is done. This is because we may have non-contiguous items in a PDF text stream.
        Parameters:
        textAssembler - the assembler that is visiting us.
        contextName - Name of the surrounding markup element/"context" if we're generating tagged output.
        See Also:
        TextAssemblyBuffer.accumulate(com.lowagie.text.pdf.parser.TextAssembler, String)
      • getFontCodes

        public String getFontCodes()
        Returns:
        a string whose characters represent code points in a possibly two-byte font