@OpenApiAll public class RTFCreator extends AbstractDocumentCreator implements IHTMLHandler
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
HTML_TABLE_COLUMN_MINWIDTH_DEFAULT |
Constructor and Description |
---|
RTFCreator() |
Modifier and Type | Method and Description |
---|---|
void |
addTableProperties(java.lang.String tagName,
java.lang.String attributeName,
java.lang.String value)
Add tag and value of align/valign or bgcolor to stack.
|
java.lang.String |
changeColorFormat(java.lang.String color)
Change color(3-digits RGB, 6-digits RGB and color name) to RGB format.
|
void |
characters(char[] data)
Receive notification of character data inside a tag.
|
void |
checkRowSpan()
check rowspan when creator received tag td, th or tr.
|
void |
comment(char[] data)
Receive notification of comment data.
|
void |
convert(java.io.Reader reader,
java.io.Writer writer)
Convert the HTML content from reader into RTF document.
|
void |
endDocument()
The Override Method.
|
void |
endTag(javax.swing.text.html.HTML.Tag tag)
Receive notification of the end of a tag.
|
double |
getPaperHeight()
Get paper height.
|
double |
getPaperWidth()
Get paper width.
|
java.util.Properties |
getProperties()
Get properties.
|
void |
setDocumentPage(DocumentPage page)
set document page property.
|
void |
setPaperHeight(float h)
set paper height.
|
void |
setPaperWidth(float w)
set paper width.
|
void |
setProperties(java.util.Properties properties)
Set properties.
|
void |
startTag(javax.swing.text.html.HTML.Tag tag,
javax.swing.text.AttributeSet attributes)
Receive notification of the start of a tag.
|
createImageTool, getFormatter, getStyleByCSSParser, getStyledDocument, setFormatter, setStyledDocument
public static final java.lang.String HTML_TABLE_COLUMN_MINWIDTH_DEFAULT
public void convert(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException
convert
in interface IDocumentCreator
reader
- the reader containing HTML source.writer
- the writer containing RTF document.java.io.IOException
- If any IO errors occur.public void comment(char[] data)
comment
in interface IHTMLHandler
data
- An array holding the characters in the comment.public void startTag(javax.swing.text.html.HTML.Tag tag, javax.swing.text.AttributeSet attributes)
startTag
in interface IHTMLHandler
tag
- HTML tagattributes
- The attributes attached to the tag. If there are no attributes, it shall be an empty
Attributes object.public void endTag(javax.swing.text.html.HTML.Tag tag)
endTag
in interface IHTMLHandler
tag
- HTML tagpublic void characters(char[] data)
characters
in interface IHTMLHandler
data
- The characters.public void addTableProperties(java.lang.String tagName, java.lang.String attributeName, java.lang.String value)
tagName
- tagNameattributeName
- attributeNamevalue
- valuepublic void setPaperHeight(float h)
setPaperHeight
in interface IDocumentCreator
h
- paper height.IDocumentCreator.setPaperHeight(float)
public double getPaperHeight()
public void setPaperWidth(float w)
setPaperWidth
in interface IDocumentCreator
w
- paper width.IDocumentCreator.setPaperWidth(float)
public double getPaperWidth()
public void setProperties(java.util.Properties properties)
setProperties
in interface IDocumentCreator
properties
- propertiespublic java.util.Properties getProperties()
public void checkRowSpan()
public void endDocument()
endDocument
in interface IHTMLHandler
IHTMLHandler.endDocument()
public java.lang.String changeColorFormat(java.lang.String color)
color
- color formatpublic void setDocumentPage(DocumentPage page)
IDocumentCreator
setDocumentPage
in interface IDocumentCreator
page
- page property.Copyright © 2010 - No Magic Asia