final class PdfConverterImpl extends java.lang.Object implements PdfConverter
Modifier and Type | Field and Description |
---|---|
private PdfConverterConfiguration |
configuration |
Constructor and Description |
---|
PdfConverterImpl(PdfConverterConfiguration configuration) |
Modifier and Type | Method and Description |
---|---|
void |
convert(java.lang.String html,
java.io.OutputStream out) |
private void |
createPdf(org.w3c.dom.Document dom,
org.xhtmlrenderer.pdf.ITextRenderer renderer,
java.io.OutputStream out) |
private boolean |
isSinglePageDoc(org.xhtmlrenderer.pdf.ITextRenderer renderer) |
void |
isValid(java.lang.String htmlCode)
feed ITextRenderer with html string to detect parsing errors
|
private void |
mapBoxFonts(org.xhtmlrenderer.render.Box boxObj) |
private void |
mapXmlFonts(org.w3c.dom.Element e)
This function looks for dom elements with "style" attributes and replaces
all font families with their substitutes
|
private java.lang.String |
matchFontFamilies(java.lang.String style,
java.lang.String[] fontFamilies) |
private org.w3c.dom.Document |
parseHtmlDoc(java.lang.String htmlCode) |
private void |
removePageNumber(org.w3c.dom.Document dom) |
private PdfConverterConfiguration configuration
@Inject public PdfConverterImpl(PdfConverterConfiguration configuration) throws java.io.IOException
java.io.IOException
public void convert(java.lang.String html, java.io.OutputStream out) throws com.lowagie.text.DocumentException
convert
in interface PdfConverter
com.lowagie.text.DocumentException
private void createPdf(org.w3c.dom.Document dom, org.xhtmlrenderer.pdf.ITextRenderer renderer, java.io.OutputStream out) throws com.lowagie.text.DocumentException
com.lowagie.text.DocumentException
private void removePageNumber(org.w3c.dom.Document dom)
private boolean isSinglePageDoc(org.xhtmlrenderer.pdf.ITextRenderer renderer)
private org.w3c.dom.Document parseHtmlDoc(java.lang.String htmlCode)
private void mapXmlFonts(org.w3c.dom.Element e)
e
- private void mapBoxFonts(org.xhtmlrenderer.render.Box boxObj)
private java.lang.String matchFontFamilies(java.lang.String style, java.lang.String[] fontFamilies)
public void isValid(java.lang.String htmlCode) throws org.xhtmlrenderer.util.XRRuntimeException
isValid
in interface PdfConverter
htmlCode
- org.xhtmlrenderer.util.XRRuntimeException