Package com.scroogexhtml
Class ScroogeXHTML
java.lang.Object
com.scroogexhtml.converter.ScroogeXHTMLBase
com.scroogexhtml.converter.ScroogeXHTMLMain
com.scroogexhtml.ScroogeXHTML
- All Implemented Interfaces:
ConversionConfiguration
,Serializable
ScroogeXHTML class provides methods to convert RTF documents to XHTML/HTML format.
The class offers multiple overloaded methods to handle conversions from RTF strings,
RTF file paths, and input streams to both markup strings and files, using specified
or default character encodings.
- See Also:
-
Field Summary
Fields inherited from class com.scroogexhtml.converter.ScroogeXHTMLBase
NBSP, NBSPS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionConverts the given RTF input stream into a string using the UTF-8 character encoding.convert
(ByteArrayInputStream rtf, Charset outputCharset) Converts the given RTF input stream into a string using the specified output charset.void
convert
(ByteArrayInputStream rtf, Path outputPath) Converts the given RTF input stream into a markup file at the specified output path using UTF-8 character encoding.Converts an RTF string to a markup string using the UTF-8 output charset.Converts a given RTF string to a markup string using the specified output charset.void
Converts an RTF string to a markup file using the UTF-8 output charset.void
Converts a given RTF string to a markup file at the specified output path using the specified output charset.Converts an RTF file located at the specified path to a markup string using UTF-8 character encoding.Converts an RTF file at the specified path to a markup string using the specified output charset.void
Converts an RTF file located at the specified path to a markup file, saving it at the given output path.void
Converts an RTF file located at the specified path to a markup file, saving it at the given output path.Methods inherited from class com.scroogexhtml.converter.ScroogeXHTMLBase
addPostProcessListener, getCharPropConvConfig, getDefaultFontColor, getDefaultFontName, getDefaultFontSize, getDefaultLanguage, getDocumentType, getFontReplacing, getFontSizeUnit, getHeaderFooterConfiguration, getHtmlHeadConfig, getIndentAmount, getInvalidRtfHeaderAction, getListConversionConfig, getName, getParaPropConvConfig, getPictureAdapter, getPostProcessListeners, getTablePropConvConfig, getTabString, getVersion, isAddOuterHTML, isConvertAlignment, isConvertBookmarks, isConvertEmptyParagraphs, isConvertFontBGColor, isConvertFontColor, isConvertFontHLColor, isConvertFontName, isConvertFontSize, isConvertFontStyle, isConvertFootnotes, isConvertHyperlinks, isConvertIndent, isConvertLanguage, isConvertParagraphMargins, isConvertPictures, isConvertTables, isIncludeDefaultFontStyle, removePostProcessListener, setAddOuterHTML, setConvertBookmarks, setConvertEmptyParagraphs, setConvertFootnotes, setConvertHyperlinks, setConvertPictures, setConvertTables, setDefaultFontColor, setDefaultFontName, setDefaultFontSize, setDefaultLanguage, setDocumentType, setFontReplacing, setIndentAmount, setInvalidRtfHeaderAction, setPictureAdapter, setTabString
-
Constructor Details
-
ScroogeXHTML
public ScroogeXHTML()Constructs a new instance of ScroogeXHTML. If debug logging is enabled, outputs the name and version of the software to the debug log.
-
-
Method Details
-
convert
Converts an RTF string to a markup string using the UTF-8 output charset.- Parameters:
rtf
- the input RTF string- Returns:
- the equivalent XHTML/HTML string
-
convert
Converts a given RTF string to a markup string using the specified output charset.- Parameters:
rtf
- the input RTF string to be convertedoutputCharset
- the charset to be used for the output markup string- Returns:
- the equivalent XHTML/HTML string
- Throws:
ConversionException
- when an IOException occurs during conversion
-
convert
Converts an RTF string to a markup file using the UTF-8 output charset.- Parameters:
rtf
- the RTF input codeoutputPath
- the path where the converted markup file will be saved- Throws:
IOException
- if an I/O error occurs during the conversion process
-
convert
Converts a given RTF string to a markup file at the specified output path using the specified output charset.- Parameters:
rtf
- the RTF input string to be convertedoutputPath
- the path where the converted markup file will be savedoutputCharset
- the charset to use for the output file- Throws:
IOException
- if an I/O error occurs during the file writing process
-
convert
Converts an RTF file located at the specified path to a markup file, saving it at the given output path. The conversion uses the UTF-8 character encoding.- Parameters:
rtfPath
- the path to the RTF file to be convertedoutputPath
- the path where the converted markup file will be saved- Throws:
IOException
- if an I/O error occurs during the conversion process
-
convert
Converts an RTF file located at the specified path to a markup file, saving it at the given output path. The conversion uses the specified character encoding.- Parameters:
rtfPath
- the path to the RTF file to be convertedhtmlPath
- the path where the converted markup file will be savedoutputCharset
- the charset to be used for the output markup file- Throws:
IOException
- if an I/O error occurs during the conversion process
-
convert
Converts an RTF file located at the specified path to a markup string using UTF-8 character encoding.- Parameters:
rtfPath
- the path to the RTF file to be converted- Returns:
- the equivalent markup string in XHTML/HTML format
- Throws:
IOException
- if an I/O error occurs during the conversion process
-
convert
Converts an RTF file at the specified path to a markup string using the specified output charset.- Parameters:
rtfPath
- the path to the RTF file to be convertedoutputCharset
- the charset to be used for the output markup string- Returns:
- the equivalent XHTML/HTML string
- Throws:
IOException
- if an I/O error occurs during the conversion process
-
convert
Converts the given RTF input stream into a string using the UTF-8 character encoding.- Parameters:
rtf
- the ByteArrayInputStream containing the RTF data to be converted- Returns:
- a string representing the equivalent XHTML/HTML markup
-
convert
Converts the given RTF input stream into a markup file at the specified output path using UTF-8 character encoding.- Parameters:
rtf
- the ByteArrayInputStream containing the RTF data to be convertedoutputPath
- the path where the converted markup file will be saved- Throws:
ConversionException
- if an IOException occurs during the conversion process
-
convert
Converts the given RTF input stream into a string using the specified output charset.- Parameters:
rtf
- the ByteArrayInputStream containing the RTF data to be convertedoutputCharset
- the charset to be used for the output string- Returns:
- a string representing the equivalent XHTML/HTML markup
- Throws:
ConversionException
- if an I/O error occurs during the conversion process
-