Class ScroogeXHTMLBase

    • Field Detail

      • NON_BREAKING_SPACE

        public static final Character NON_BREAKING_SPACE
        NON_BREAKING_SPACE - non-breaking space.
    • Constructor Detail

      • ScroogeXHTMLBase

        public ScroogeXHTMLBase()
    • Method Detail

      • nameAndVersion

        public static String nameAndVersion()
        Name and version of ScroogeXHTML.
        Returns:
        Name and version.
      • addPostProcessListener

        public void addPostProcessListener​(PostProcessListener listener)
        Adds a post process listener. The converter executes post process listeners in the order they have been added. The converter creates and adds no post process handlers by default (on creation).
        Parameters:
        listener - the post process listener
        Note:
        Post-processing may cause a significant increase of the conversion time.
      • removePostProcessListener

        public void removePostProcessListener​(PostProcessListener listener)
        Removes a post process listener.
        Parameters:
        listener - the post process listener
      • setAddOuterHTML

        public void setAddOuterHTML​(boolean newValue)
        Set this property to true to include the HTML header section, and place the generated HTML between the <body> and </body> tags. This allows to create 'stand-alone' HTML output documents.
        Parameters:
        newValue - The new addOuterHTML value
        See Also:
        isAddOuterHTML()
        Default value:
        false
      • setConvertAlignment

        @Deprecated
        public void setConvertAlignment​(boolean newValue)
        Deprecated.
        use getParaPropConvConfig().setConvertAlignment(boolean) instead.
        Set this property to false to disable paragraph alignment conversion.
        Parameters:
        newValue - the new convertAlignment value
        Default value:
        true
      • setConvertBookmarks

        public void setConvertBookmarks​(boolean newValue)
        Set this property to true to activate bookmark conversion.
        Parameters:
        newValue - the new convertBookmarks value
        See Also:
        isConvertBookmarks()
        Default value:
        false
      • setConvertEmptyParagraphs

        public void setConvertEmptyParagraphs​(boolean newValue)
        Enable conversion of empty paragraphs to line break tags (<br />).
        Parameters:
        newValue - The new convertEmptyParagraphs value
        See Also:
        isConvertEmptyParagraphs()
        Default value:
        false
        Note:
        'Strict' document types do not allow the element "br"
      • setConvertFields

        public void setConvertFields​(boolean newValue)
        Set this property to true to enable processing of RTF field expressions.
        Parameters:
        newValue - the new convertFields value
        See Also:
        isConvertFields()
        Default value:
        false
      • setConvertFontBGColor

        @Deprecated
        public void setConvertFontBGColor​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontBGColor(boolean) instead.
        Set ConvertFontBGColor to true to enable conversion of text background colors. Code Example:

         // switch off background color conversion 
         scrooge.setConvertBGColor(false); 
         // switch off higlight color conversion 
         scrooge.setConvertHLColor(false);
         
        Parameters:
        newValue - The new convertFontBGColor value
        Default value:
        true
        Note:
        in RTF documents, background colors may also be defined as 'highlight colors'. If the background colors do not appear in the output document, try setting the ConvertFontHLColor property.
      • setConvertFontColor

        @Deprecated
        public void setConvertFontColor​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontColor(boolean) instead.
        Set this property to true to enable conversion of font colors.
        Parameters:
        newValue - The new convertFontColor value
        Default value:
        true
      • setConvertFontHLColor

        @Deprecated
        public void setConvertFontHLColor​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontHLColor(boolean) instead.
        Set ConvertFontHLColor to true to enable conversion of text highlight colors. Code Example:

         // switch off background color conversion
         scrooge.setConvertBGColor(false);
         // switch off highlight color conversion
         scrooge.setConvertHLColor(false);
         

        Parameters:
        newValue - The new convertFontHLColor value
        Default value:
        true
        Note:
        in RTF documents, highlight colors may also be defined as 'background colors'. If the highlight colors do not appear in the output document, try setting the ConvertFontBGColor property.
      • setConvertFontName

        @Deprecated
        public void setConvertFontName​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontName(boolean) instead.
        Set this property to true to enable conversion of font names.
        Parameters:
        newValue - The new convertFontName value
        Default value:
        true
      • setConvertFontSize

        @Deprecated
        public void setConvertFontSize​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontSize(boolean) instead.
        Set this property to true to enable conversion of font sizes.
        Parameters:
        newValue - The new convertFontSize value
        Default value:
        true
      • setConvertFontStyle

        @Deprecated
        public void setConvertFontStyle​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontStyle(boolean) instead.
        Set this property to true to enable conversion of font styles (bold, italic, strike, underline, subscript, superscript).
        Parameters:
        newValue - The new convertFontStyle value
        Default value:
        true
      • setConvertFootnotes

        public void setConvertFootnotes​(boolean newValue)
        Set this property to true to enable conversion of footnotes.
        Parameters:
        newValue - The new convertFootnotes value
        See Also:
        isConvertFootnotes()
        Default value:
        false
      • setConvertHyperlinks

        public void setConvertHyperlinks​(boolean newValue)
        Set this property to true to enable conversion of hyperlinks.
        Parameters:
        newValue - The new convertHyperlinks value
        See Also:
        isConvertHyperlinks()
        Default value:
        false
        Note:
        To enable hyperlink conversion, ConvertFields must also be set to true (as RTF uses fields to represent hyperlinks).
      • setConvertIndent

        @Deprecated
        public void setConvertIndent​(boolean newValue)
        Deprecated.
        use getParaPropConvConfig().setConvertIndent(boolean) instead.
        Set this property to true to enable conversion of indents.
        Parameters:
        newValue - The new convertIndent value
        Default value:
        false
        Note:
        The right indent in the output document is relative to the browser window, if you change the browser window size, the text area will adjust its size.
      • setConvertLanguage

        @Deprecated
        public void setConvertLanguage​(boolean newValue)
        Deprecated.
        use getCharPropConvConfig().setConvertFontLanguage(boolean) instead.
        Set this property to true to enable generation of lang attributes.
        Parameters:
        newValue - The new convertLanguage value
        Default value:
        false
      • setConvertParagraphMargins

        @Deprecated
        public void setConvertParagraphMargins​(boolean newValue)
        Deprecated.
        use getParaPropConvConfig().setConvertPargraphMargins(boolean) instead.
        Set this property to true to enable conversion of paragraph margins.
        Parameters:
        newValue - The new convertParagraphMargins value
        Default value:
        true
      • setConvertPictures

        public void setConvertPictures​(boolean newValue)
        Set this property to true to processing of picture data.
        Parameters:
        newValue - The new convertPictures value
        See Also:
        isConvertPictures()
        Default value:
        false
      • setConvertTables

        public void setConvertTables​(boolean newValue)
        Set this property to true to enable table conversion.
        Parameters:
        newValue - The new convertTables value
        See Also:
        isConvertTables()
        Default value:
        false
      • setDefaultFontColor

        public void setDefaultFontColor​(String newValue)
        Use this property to optimize the HTML code generation. For example, if most of the document uses black text, define black (#000000) as the default font color in the component and in the style sheet. The converter will now only create a font color attribute if the text color is not black.
        Parameters:
        newValue - The new defaultFontColor value
        See Also:
        getDefaultFontColor()
        Default value:
        DEFAULT_FONT_COLOR
        Note:
        this property is only effective if the property IncludeDefaultFontStyle is set to true.
      • setDefaultFontName

        public void setDefaultFontName​(String newValue)
        Use this property to optimize the HTML code generation. For example, if most of the document uses the font 'Times', just define it as the default font name in the component and in the style sheet. The converter will now only create a font name attribute if it is not 'Times'.
        Parameters:
        newValue - The new defaultFontName value
        See Also:
        getDefaultFontName()
        Default value:
        DEFAULT_FONT_NAME
        Note:
        this property is only effective if the property IncludeDefaultFontStyle is set to true.
      • setDefaultFontSize

        public void setDefaultFontSize​(int newValue)
        Use this property to optimize the HTML code generation. For example, if most of the document uses a 10 point font, just define 10 as the default font size in the component and in the style sheet. The converter will now only create a font size attribute if it is not 10 pt.
        Parameters:
        newValue - The new defaultFontSize value
        See Also:
        getDefaultFontSize()
        Default value:
        DEFAULT_FONT_SIZE
        Note:
        this property is only effective if the property IncludeDefaultFontStyle is set to true.
      • setDefaultLanguage

        public void setDefaultLanguage​(String newValue)
        Set the default language code.
        Parameters:
        newValue - the new defaultLanguage value.
        See Also:
        getDefaultLanguage()
        Default value:
        empty
      • setDocumentTitle

        public void setDocumentTitle​(String newValue)
        Sets the document title.
        Parameters:
        newValue - The new documentTitle value
        See Also:
        getDocumentTitle()
        Default value:
        "Untitled document"
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setDocumentType

        public void setDocumentType​(DocumentType newValue)
        Sets the documentType property.
        Parameters:
        newValue - the new documentType value
        See Also:
        getDocumentType()
      • setFontReplacing

        public void setFontReplacing​(FontReplacing fontReplacing)
        Sets the FontReplacing object.
        Parameters:
        fontReplacing - the new FontReplacing value.
      • setFontSizeUnit

        public void setFontSizeUnit​(FontSizeUnit newValue)
        Set the fontSizeUnit property.
        Parameters:
        newValue - the new FontSizeUnit value
        See Also:
        getFontSizeUnit()
      • setFontStatistics

        public void setFontStatistics​(FontStatisticsCollecting fontStatistics)
        Set the FontStatistics property.
        Parameters:
        fontStatistics - the new FontStatistics value
      • setIncludeDefaultFontStyle

        @Deprecated
        public void setIncludeDefaultFontStyle​(boolean newValue)
        Deprecated.
        use getHtmlHeadConfig().setIncludeDefaultFontStyle(boolean) instead.
        If this property is set to true, the HTML head section will include a CSS definition for the default font style.
        Parameters:
        newValue - The new includeDefaultFontStyle value
        Default value:
        false
      • setIndentAmount

        public void setIndentAmount​(int newValue)
        This property specifies the indentation level.
        Parameters:
        newValue - the new indentAmount value
        See Also:
        getIndentAmount()
        Default value:
        2
      • setMetaAuthor

        @Deprecated
        public void setMetaAuthor​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().getMetaAuthor(String) instead.
        This property may be used to specify a META tag which contains the document author.
        Parameters:
        newValue - The new metaAuthor value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setMetaDescription

        @Deprecated
        public void setMetaDescription​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().getMetaDescription(String) instead.
        This property may be used to specify a document description.
        Parameters:
        newValue - The new metaDescription value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setMetaGenerator

        @Deprecated
        public void setMetaGenerator​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().setMetaGenerator(String) instead.
        This property may be used to specify the content of the generator meta element.
        Parameters:
        newValue - The new metaGenerator value
        Default value:
        name and version of the converter
      • setMetaKeywords

        @Deprecated
        public void setMetaKeywords​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().getMetaKeywords(String) instead.
        This property may be used to specify keywords for the document.
        Parameters:
        newValue - The new metaKeywords value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setMetaViewport

        @Deprecated
        public void setMetaViewport​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().getMetaDescription(String) instead.
        Use this property to define the meta viewport tag manually.
        Parameters:
        newValue - The new viewport value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setOutputProperty

        public final void setOutputProperty​(String name,
                                            String value)
        Set an output property that will be in effect for the conversion.
        Parameters:
        name - A non-null String that specifies an output property name
        value - The non-null string value of the output property.
        Throws:
        IllegalArgumentException - If the property is not supported.
        See Also:
        getOutputProperty(java.lang.String)
      • setPictureAdapter

        public void setPictureAdapter​(PictureAdapter newValue)
        Set the picture adapter.
        Parameters:
        newValue - the new pictureAdapter value
        See Also:
        getPictureAdapter()
      • setStyleSheetInclude

        @Deprecated
        public void setStyleSheetInclude​(String newValue)
        Deprecated.
        use getHtmlHeadConfig().setStyleSheetInclude(String) instead.
        Additional style sheet definitions which are stored in the HTML document.
        Parameters:
        newValue - The new styleSheetInclude value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setStyleSheetLink

        @Deprecated
        public void setStyleSheetLink​(String href)
        Deprecated.
        use getHtmlHeadConfig().setStyleSheetLink(String) instead.
        URL of a file which contains external CSS style sheet definitions for the HTML document.
        Parameters:
        href - The new styleSheetLink value
        Default value:
        empty
        Note:
        This property is only effective if the property AddOuterHTML is set to true.
      • setTabString

        public void setTabString​(String newValue)
        Sets the string which will be used to replace a \\tab token in the RTF document.
        Parameters:
        newValue - The new tabString
        See Also:
        getTabString()
        Default value:
        A sequence of eight non-breaking space characters (nbsp)
      • isConvertEmptyParagraphs

        public boolean isConvertEmptyParagraphs()
        Description copied from interface: ConversionConfiguration
        This property controls the conversion of empty paragraphs to linebreaks. If enabled, the result markup will contain <br> or <br /> instead of empty <p> elements.
        Specified by:
        isConvertEmptyParagraphs in interface ConversionConfiguration
        Returns:
        true if the conversion of bookmarks to linebreaks is enabled.
      • isIncludeDefaultFontStyle

        public boolean isIncludeDefaultFontStyle()
        Description copied from interface: ConversionConfiguration
        If this property is set to true, the HTML head section will include a CSS definition for the default font style.
        Specified by:
        isIncludeDefaultFontStyle in interface ConversionConfiguration
        Returns:
        true if the CSS definition for the default font style will be included.
      • getIndentAmount

        public int getIndentAmount()
        Description copied from interface: ConversionConfiguration
        This property contains the number of blanks in the output indentation.
        Specified by:
        getIndentAmount in interface ConversionConfiguration
        Returns:
        the number of blanks in the output indentation.
      • getVersion

        public String getVersion()
      • getCharPropConvConfig

        public CharPropConfiguration getCharPropConvConfig()
        Returns:
        the configuration bean for character conversion options.
      • getParaPropConvConfig

        public ParaPropConfiguration getParaPropConvConfig()
        Returns:
        the configuration bean for paragraph conversion options.
      • getHtmlHeadConfig

        public HtmlHeadConfiguration getHtmlHeadConfig()
        Returns:
        the configuration bean for HTML head section options.