Class FormattedTextHtmlConverter


  • public class FormattedTextHtmlConverter
    extends Object
    Allows conversion of HTML to formatted text representation and formatted text to HTML representation.
    • Constructor Detail

      • FormattedTextHtmlConverter

        public FormattedTextHtmlConverter​(FormattedTextEncoder encoder)
        Creates new instance of the converter.
        Parameters:
        encoder - the encoder to encode/decode fonts and colors, cannot be null
    • Method Detail

      • toHtml

        public String toHtml​(String formattedText,
                             double scaleFactor)
        Converts formatted text string to html
        Parameters:
        formattedText - formatted text to be converted, cannot be null
        scaleFactor - scale factor based on current DPI settings
        Returns:
        html text, never null
      • generateFormattedText

        public String generateFormattedText​(Document document)
        Converts content from specified HTML document into formatted text.
        Parameters:
        document - the org.w3c.document to convert
        Returns:
        formatted text representation