|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.itextpdf.tool.xml.XMLWorkerHelper
public class XMLWorkerHelper
A helper class for parsing XHTML/CSS or XML flow to PDF.
Method Summary | |
---|---|
static CssFile |
getCSS(InputStream in)
|
CssFile |
getDefaultCSS()
|
CSSResolver |
getDefaultCssResolver(boolean addDefaultCss)
Get a CSSResolver implementation. |
protected TagProcessorFactory |
getDefaultTagProcessorFactory()
Retrieves the default factory for processing HTML tags from Tags.getHtmlTagProcessorFactory() . |
static XMLWorkerHelper |
getInstance()
Get a Singleton XMLWorkerHelper |
static ElementList |
parseToElementList(String html,
String css)
Parses an HTML string and a string containing CSS into a list of Element objects. |
void |
parseXHtml(ElementHandler d,
InputStream in,
Charset charset)
|
void |
parseXHtml(ElementHandler d,
Reader in)
Parses the xml data in the given reader and sends created Element
s to the defined ElementHandler. |
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in,
Charset charset)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in,
InputStream inCssFile)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in,
InputStream inCssFile,
Charset charset)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in,
InputStream inCssFile,
Charset charset,
FontProvider fontProvider)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
InputStream in,
InputStream inCssFile,
FontProvider fontProvider)
|
void |
parseXHtml(PdfWriter writer,
Document doc,
Reader in)
Parses the xml data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static XMLWorkerHelper getInstance()
public static CssFile getCSS(InputStream in)
public CssFile getDefaultCSS()
public void parseXHtml(ElementHandler d, Reader in) throws IOException
Element
s to the defined ElementHandler.
d
- the handlerin
- the reader
IOException
- thrown when something went wrong with the IOpublic void parseXHtml(PdfWriter writer, Document doc, Reader in) throws IOException
writer
- the PdfWriterdoc
- the Documentin
- the reader
IOException
- thrown when something went wrong with the IOpublic void parseXHtml(PdfWriter writer, Document doc, InputStream in) throws IOException
writer
- the writer to usedoc
- the document to usein
- the InputStream
of the XHTML source.
IOException
- if the InputStream
could not be read.public void parseXHtml(PdfWriter writer, Document doc, InputStream in, Charset charset) throws IOException
writer
- the writer to usedoc
- the document to usein
- the InputStream
of the XHTML source.charset
- the charset to use
IOException
- if the InputStream
could not be read.public void parseXHtml(PdfWriter writer, Document doc, InputStream in, InputStream inCssFile, Charset charset, FontProvider fontProvider) throws IOException
writer
- the writer to usedoc
- the document to usein
- the InputStream
of the XHTML source.in
- the CssFiles
of the css files.charset
- the charset to use
IOException
- if the InputStream
could not be read.public void parseXHtml(PdfWriter writer, Document doc, InputStream in, InputStream inCssFile) throws IOException
IOException
public void parseXHtml(PdfWriter writer, Document doc, InputStream in, InputStream inCssFile, FontProvider fontProvider) throws IOException
IOException
public void parseXHtml(PdfWriter writer, Document doc, InputStream in, InputStream inCssFile, Charset charset) throws IOException
IOException
public void parseXHtml(ElementHandler d, InputStream in, Charset charset) throws IOException
d
- the ElementHandlerin
- the InputStreamcharset
- the charset to use
IOException
- if something went seriously wrong with IO.public CSSResolver getDefaultCssResolver(boolean addDefaultCss)
addDefaultCss
- true if the defaultCss should already be added.
protected TagProcessorFactory getDefaultTagProcessorFactory()
Tags.getHtmlTagProcessorFactory()
. On subsequent calls the same
TagProcessorFactory
is returned every time.
DefaultTagProcessorFactory that maps HTML tags to TagProcessor
s
public static ElementList parseToElementList(String html, String css) throws IOException
html
- a String containing an XHTML snippetcss
- a String containing CSS
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |