public class XHTMLImporterImpl
extends java.lang.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(java.lang.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(java.lang.String cssFontFamily,
java.lang.String font) |
java.util.List<java.lang.Object> |
convert(java.io.File file,
java.lang.String baseUrl)
Convert the well formed XHTML contained in file to a list of WML objects.
|
java.util.List<java.lang.Object> |
convert(org.xml.sax.InputSource is,
java.lang.String baseUrl)
Convert the well formed XHTML from the specified SAX InputSource
|
java.util.List<java.lang.Object> |
convert(java.io.InputStream is,
java.lang.String baseUrl) |
java.util.List<java.lang.Object> |
convert(org.w3c.dom.Node node,
java.lang.String baseUrl) |
java.util.List<java.lang.Object> |
convert(java.io.Reader reader,
java.lang.String baseUrl) |
java.util.List<java.lang.Object> |
convert(java.lang.String content,
java.lang.String baseUrl)
Convert the well formed XHTML contained in the string to a list of WML objects.
|
java.util.List<java.lang.Object> |
convert(java.net.URL url)
Convert the well formed XHTML found at the specified URI to a list of WML objects.
|
protected int |
getAncestorIndentation(com.openhtmltopdf.layout.Styleable styleable) |
java.util.concurrent.atomic.AtomicInteger |
getBookmarkIdLast() |
java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> |
getCascadedProperties(com.openhtmltopdf.css.style.CalculatedStyle cs) |
protected java.util.LinkedList<org.docx4j.wml.ContentAccessor> |
getContentContextStack() |
static short |
getLengthPrimitiveType(com.openhtmltopdf.css.style.FSDerivedValue val) |
protected ListHelper |
getListHelper() |
protected int |
getLocalIndentation(com.openhtmltopdf.layout.Styleable styleable)
Inside a list item, get the contribution of any div.
|
protected org.docx4j.wml.PPr |
getPPr(com.openhtmltopdf.render.BlockBox blockBox,
java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> cssMap) |
DocxRenderer |
getRenderer() |
java.util.Map<java.lang.String,java.lang.Integer> |
getSequenceCounters()
Get the current numbers of SEQ fields, used in image captions.
|
protected org.docx4j.wml.Style |
getStyleByIdOrName(java.lang.String... parameters)
If one parameter is passed then search style by id (1st parameter),
if style by id is not found then search style by name (also 1st parameter).
|
protected org.docx4j.convert.in.xhtml.FormattingOption |
getTableFormatting() |
protected TableHelper |
getTableHelper() |
protected boolean |
isBidi(java.lang.String pText) |
protected void |
populatePPr(org.docx4j.wml.PPr pPr,
com.openhtmltopdf.layout.Styleable blockBox,
java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> cssMap) |
void |
setBookmarkIdNext(java.util.concurrent.atomic.AtomicInteger val) |
void |
setBookmarkNamePrefix(java.lang.String bookmarkNamePrefix)
The prefix (if any) to be added to bookmark names generated during this run.
|
static void |
setCssWhiteList(java.util.Set<java.lang.String> cssWhiteList)
Deprecated.
|
void |
setDivHandler(DivHandler divHandler) |
void |
setHyperlinkStyle(java.lang.String hyperlinkStyleID)
Configure, how the Importer styles hyperlinks
If hyperlinkStyleId is set to
null, hyperlinks are
styled using just the CSS. |
void |
setMaxWidth(int maxWidth,
java.lang.String tableStyle) |
void |
setParagraphFormatting(org.docx4j.convert.in.xhtml.FormattingOption paragraphFormatting) |
void |
setRenderer(DocxRenderer renderer) |
void |
setRunFormatting(org.docx4j.convert.in.xhtml.FormattingOption runFormatting) |
void |
setSequenceCounters(java.util.Map<java.lang.String,java.lang.Integer> sequenceCounters)
Set the last used numbers of SEQ fields, used in image captions.
|
void |
setTableFormatting(org.docx4j.convert.in.xhtml.FormattingOption tableFormatting) |
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(java.lang.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 void setMaxWidth(int maxWidth,
java.lang.String tableStyle)
setMaxWidth in interface org.docx4j.convert.in.xhtml.XHTMLImporterpublic void setDivHandler(DivHandler divHandler)
protected ListHelper getListHelper()
protected TableHelper getTableHelper()
public DocxRenderer getRenderer()
public void setRenderer(DocxRenderer renderer)
renderer - the renderer to setpublic static void addFontMapping(java.lang.String cssFontFamily,
org.docx4j.wml.RFonts rFonts)
public static void addFontMapping(java.lang.String cssFontFamily,
java.lang.String font)
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 setprotected org.docx4j.convert.in.xhtml.FormattingOption getTableFormatting()
@Deprecated public static void setCssWhiteList(java.util.Set<java.lang.String> cssWhiteList)
cssWhiteList - the cssWhiteList to setpublic java.util.concurrent.atomic.AtomicInteger getBookmarkIdLast()
getBookmarkIdLast in interface org.docx4j.convert.in.xhtml.XHTMLImporterpublic void setBookmarkIdNext(java.util.concurrent.atomic.AtomicInteger val)
public java.util.List<java.lang.Object> convert(java.io.File file,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterfile - baseUrl - wordMLPackage - java.io.IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(org.xml.sax.InputSource is,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporteris - baseUrl - wordMLPackage - java.io.IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(java.io.InputStream is,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporteris - baseUrl - wordMLPackage - java.io.IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(org.w3c.dom.Node node,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporternode - baseUrl - wordMLPackage - java.io.IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(java.io.Reader reader,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterreader - baseUrl - wordMLPackage - java.io.IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(java.net.URL url)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImporterurl - wordMLPackage - org.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.List<java.lang.Object> convert(java.lang.String content,
java.lang.String baseUrl)
throws org.docx4j.openpackaging.exceptions.Docx4JException
convert in interface org.docx4j.convert.in.xhtml.XHTMLImportercontent - baseUrl - wordMLPackage - org.docx4j.openpackaging.exceptions.Docx4JExceptionpublic java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> getCascadedProperties(com.openhtmltopdf.css.style.CalculatedStyle cs)
public static short getLengthPrimitiveType(com.openhtmltopdf.css.style.FSDerivedValue val)
protected java.util.LinkedList<org.docx4j.wml.ContentAccessor> getContentContextStack()
public java.util.Map<java.lang.String,java.lang.Integer> getSequenceCounters()
getSequenceCounters in interface org.docx4j.convert.in.xhtml.XHTMLImportersequenceCounters - public void setSequenceCounters(java.util.Map<java.lang.String,java.lang.Integer> sequenceCounters)
setSequenceCounters in interface org.docx4j.convert.in.xhtml.XHTMLImportersequenceCounters - protected org.docx4j.wml.PPr getPPr(com.openhtmltopdf.render.BlockBox blockBox,
java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> cssMap)
protected boolean isBidi(java.lang.String pText)
protected void populatePPr(org.docx4j.wml.PPr pPr,
com.openhtmltopdf.layout.Styleable blockBox,
java.util.Map<java.lang.String,com.openhtmltopdf.css.parser.PropertyValue> cssMap)
protected org.docx4j.wml.Style getStyleByIdOrName(java.lang.String... parameters)
protected int getLocalIndentation(com.openhtmltopdf.layout.Styleable styleable)
protected int getAncestorIndentation(com.openhtmltopdf.layout.Styleable styleable)
public void setBookmarkNamePrefix(java.lang.String bookmarkNamePrefix)
bookmarkNamePrefix - Copyright © 2013–2021. All rights reserved.