public class XHTMLImporterImpl extends Object implements org.docx4j.convert.in.xhtml.XHTMLImporter
| Modifier and Type | Class and Description |
|---|---|
static class |
XHTMLImporterImpl.TableProperties |
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
log |
protected org.docx4j.openpackaging.packages.WordprocessingMLPackage |
wordMLPackage |
| Constructor and Description |
|---|
XHTMLImporterImpl(org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addFontMapping(String cssFontFamily,
org.docx4j.wml.RFonts rFonts)
Map a font family, for example "Century Gothic" in:
font-family:"Century Gothic", Helvetica, Arial, sans-serif;
to a w:rFonts object, for example:
|
static void |
addFontMapping(String cssFontFamily,
String font) |
List<Object> |
convert(File file,
String baseUrl)
Convert the well formed XHTML contained in file to a list of WML objects.
|
List<Object> |
convert(InputSource is,
String baseUrl)
Convert the well formed XHTML from the specified SAX InputSource
|
List<Object> |
convert(InputStream is,
String baseUrl) |
List<Object> |
convert(Node node,
String baseUrl) |
List<Object> |
convert(Reader reader,
String baseUrl) |
List<Object> |
convert(Source source,
String baseUrl) |
List<Object> |
convert(String content,
String baseUrl)
Convert the well formed XHTML contained in the string to a list of WML objects.
|
List<Object> |
convert(URL url)
Convert the well formed XHTML found at the specified URI to a list of WML objects.
|
protected org.docx4j.wml.PPr |
getPPr(org.docx4j.org.xhtmlrenderer.render.BlockBox blockBox,
Map<String,org.w3c.dom.css.CSSValue> cssMap) |
org.docx4j.org.xhtmlrenderer.docx.DocxRenderer |
getRenderer() |
Map<String,Integer> |
getSequenceCounters()
Get the current numbers of SEQ fields, used in image captions.
|
protected void |
populatePPr(org.docx4j.wml.PPr pPr,
org.docx4j.org.xhtmlrenderer.render.BlockBox blockBox,
Map<String,org.w3c.dom.css.CSSValue> cssMap) |
static void |
setCssWhiteList(Set<String> cssWhiteList)
Deprecated.
|
void |
setHyperlinkStyle(String hyperlinkStyleID)
Configure, how the Importer styles hyperlinks
If hyperlinkStyleId is set to
null, hyperlinks are
styled using just the CSS. |
void |
setParagraphFormatting(org.docx4j.convert.in.xhtml.FormattingOption paragraphFormatting) |
void |
setRenderer(org.docx4j.org.xhtmlrenderer.docx.DocxRenderer renderer) |
void |
setRunFormatting(org.docx4j.convert.in.xhtml.FormattingOption runFormatting) |
void |
setSequenceCounters(Map<String,Integer> sequenceCounters)
Set the last used numbers of SEQ fields, used in image captions.
|
void |
setTableFormatting(org.docx4j.convert.in.xhtml.FormattingOption tableFormatting) |
protected void |
setupTblGrid(org.docx4j.org.xhtmlrenderer.newtable.TableBox cssTable,
org.docx4j.wml.Tbl tbl,
XHTMLImporterImpl.TableProperties tableProperties) |
protected void |
setupTblPr(org.docx4j.org.xhtmlrenderer.newtable.TableBox cssTable,
org.docx4j.wml.Tbl tbl,
XHTMLImporterImpl.TableProperties tableProperties) |
protected void |
setupTcPr(org.docx4j.org.xhtmlrenderer.newtable.TableCellBox tcb,
org.docx4j.wml.Tc tc,
XHTMLImporterImpl.TableProperties tableProperties) |
protected void |
setupTrPr(org.docx4j.org.xhtmlrenderer.newtable.TableRowBox trBox,
org.docx4j.wml.Tr tr) |
void |
setXHTMLImageHandler(XHTMLImageHandler xHTMLImageHandler)
If you have your own implementation of the XHTMLImageHandler interface
which you'd like to use.
|
public static org.slf4j.Logger log
protected org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage
public XHTMLImporterImpl(org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage)
public void setHyperlinkStyle(String hyperlinkStyleID)
null, hyperlinks are
styled using just the CSS. This is the default behavior.
If hyperlinkStyleId is set to "someWordHyperlinkStyleName",
that style is used. The default Word hyperlink style name is "Hyperlink".
It is currently your responsibility to define that style in your
styles definition part.setHyperlinkStyle in interface org.docx4j.convert.in.xhtml.XHTMLImporterhyperlinkStyleID - The style to use for hyperlinks (eg Hyperlink)public void setXHTMLImageHandler(XHTMLImageHandler xHTMLImageHandler)
public org.docx4j.org.xhtmlrenderer.docx.DocxRenderer getRenderer()
public void setRenderer(org.docx4j.org.xhtmlrenderer.docx.DocxRenderer renderer)
renderer - the renderer to setpublic static void addFontMapping(String cssFontFamily, org.docx4j.wml.RFonts rFonts)
public void setRunFormatting(org.docx4j.convert.in.xhtml.FormattingOption runFormatting)
setRunFormatting in interface org.docx4j.convert.in.xhtml.XHTMLImporterrunFormatting - the runFormatting to setpublic void setParagraphFormatting(org.docx4j.convert.in.xhtml.FormattingOption paragraphFormatting)
setParagraphFormatting in interface org.docx4j.convert.in.xhtml.XHTMLImporterparagraphFormatting - the paragraphFormatting to setpublic void setTableFormatting(org.docx4j.convert.in.xhtml.FormattingOption tableFormatting)
setTableFormatting in interface org.docx4j.convert.in.xhtml.XHTMLImportertableFormatting - the tableFormatting to set@Deprecated public static void setCssWhiteList(Set<String> cssWhiteList)
cssWhiteList - the cssWhiteList to setpublic List<Object> convert(File file, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterfile - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(InputSource is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporteris - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(InputStream is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporteris - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(Node node, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporternode - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(Reader reader, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterreader - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(Source source, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImportersource - baseUrl - wordMLPackage - IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(URL url) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterurl - wordMLPackage - org.docx4j.openpackaging.exceptions.Docx4JExceptionpublic List<Object> convert(String content, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImportercontent - baseUrl - wordMLPackage - org.docx4j.openpackaging.exceptions.Docx4JExceptionpublic Map<String,Integer> getSequenceCounters()
getSequenceCounters in interface org.docx4j.convert.in.xhtml.XHTMLImportersequenceCounters - public void setSequenceCounters(Map<String,Integer> sequenceCounters)
setSequenceCounters in interface org.docx4j.convert.in.xhtml.XHTMLImportersequenceCounters - protected org.docx4j.wml.PPr getPPr(org.docx4j.org.xhtmlrenderer.render.BlockBox blockBox,
Map<String,org.w3c.dom.css.CSSValue> cssMap)
protected void populatePPr(org.docx4j.wml.PPr pPr,
org.docx4j.org.xhtmlrenderer.render.BlockBox blockBox,
Map<String,org.w3c.dom.css.CSSValue> cssMap)
protected void setupTblPr(org.docx4j.org.xhtmlrenderer.newtable.TableBox cssTable,
org.docx4j.wml.Tbl tbl,
XHTMLImporterImpl.TableProperties tableProperties)
protected void setupTblGrid(org.docx4j.org.xhtmlrenderer.newtable.TableBox cssTable,
org.docx4j.wml.Tbl tbl,
XHTMLImporterImpl.TableProperties tableProperties)
protected void setupTrPr(org.docx4j.org.xhtmlrenderer.newtable.TableRowBox trBox,
org.docx4j.wml.Tr tr)
protected void setupTcPr(org.docx4j.org.xhtmlrenderer.newtable.TableCellBox tcb,
org.docx4j.wml.Tc tc,
XHTMLImporterImpl.TableProperties tableProperties)
Copyright © 2013-2014. All Rights Reserved.