Class RTFCreator
java.lang.Object
com.nomagic.magicreport.format.html.AbstractDocumentCreator
com.nomagic.magicreport.format.html.RTFCreator
- All Implemented Interfaces:
IHTMLHandler,IDocumentCreator
The class use for create RTF content.
- Since:
- May 22, 2009
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTableProperties(String tagName, String attributeName, String value) Add tag and value of align/valign or bgcolor to stack.changeColorFormat(String color) Change color(3-digits RGB, 6-digits RGB and color name) to RGB format.voidcharacters(char[] data) Receive notification of character data inside a tag.voidcheck rowspan when creator received tag td, th or tr.voidcomment(char[] data) Receive notification of comment data.voidConvert the HTML content from reader into RTF document.voidThe Override Method.voidReceive notification of the end of a tag.doubleGet paper height.doubleGet paper width.Get properties.voidsetDocumentPage(com.nomagic.magicreport.DocumentPage page) set document page property.voidsetPaperHeight(float h) set paper height.voidsetPaperWidth(float w) set paper width.voidsetProperties(Properties properties) Set properties.voidstartTag(HTML.Tag tag, AttributeSet attributes) Receive notification of the start of a tag.Methods inherited from class com.nomagic.magicreport.format.html.AbstractDocumentCreator
createImageTool, getFormatter, getStyleByCSSParser, getStyledDocument, setFormatter, setStyledDocument
-
Field Details
-
HTML_TABLE_COLUMN_MINWIDTH_DEFAULT
- See Also:
-
-
Constructor Details
-
RTFCreator
public RTFCreator()
-
-
Method Details
-
convert
Convert the HTML content from reader into RTF document.- Specified by:
convertin interfaceIDocumentCreator- Parameters:
reader- the reader containing HTML source.writer- the writer containing RTF document.- Throws:
IOException- If any IO errors occur.
-
comment
public void comment(char[] data) Receive notification of comment data.- Specified by:
commentin interfaceIHTMLHandler- Parameters:
data- An array holding the characters in the comment.
-
startTag
Receive notification of the start of a tag.- Specified by:
startTagin interfaceIHTMLHandler- Parameters:
tag- HTML tagattributes- The attributes attached to the tag. If there are no attributes, it shall be an empty Attributes object.
-
endTag
Receive notification of the end of a tag.- Specified by:
endTagin interfaceIHTMLHandler- Parameters:
tag- HTML tag
-
characters
public void characters(char[] data) Receive notification of character data inside a tag.- Specified by:
charactersin interfaceIHTMLHandler- Parameters:
data- The characters.
-
addTableProperties
Add tag and value of align/valign or bgcolor to stack.- Parameters:
tagName- tagNameattributeName- attributeNamevalue- value
-
setPaperHeight
public void setPaperHeight(float h) set paper height.- Specified by:
setPaperHeightin interfaceIDocumentCreator- Parameters:
h- paper height.- See Also:
-
getPaperHeight
public double getPaperHeight()Get paper height.- Returns:
- paper height
-
setPaperWidth
public void setPaperWidth(float w) set paper width.- Specified by:
setPaperWidthin interfaceIDocumentCreator- Parameters:
w- paper width.- See Also:
-
getPaperWidth
public double getPaperWidth()Get paper width.- Returns:
- paper width
-
setProperties
Set properties.- Specified by:
setPropertiesin interfaceIDocumentCreator- Parameters:
properties- properties
-
getProperties
Get properties.- Returns:
- properties
-
checkRowSpan
public void checkRowSpan()check rowspan when creator received tag td, th or tr. -
endDocument
public void endDocument()The Override Method.- Specified by:
endDocumentin interfaceIHTMLHandler- See Also:
-
changeColorFormat
Change color(3-digits RGB, 6-digits RGB and color name) to RGB format.- Parameters:
color- color format- Returns:
- RGB format and return empty String when invalid color format.
-
setDocumentPage
public void setDocumentPage(com.nomagic.magicreport.DocumentPage page) Description copied from interface:IDocumentCreatorset document page property.- Specified by:
setDocumentPagein interfaceIDocumentCreator- Parameters:
page- page property.
-