Package org.docx4j.convert.in.xhtml
Interface XHTMLImporter
- All Known Implementing Classes:
XHTMLImporterImpl
public interface XHTMLImporter
- Author:
- jharrop
-
Method Summary
Modifier and TypeMethodDescriptionConvert the well formed XHTML contained in file to a list of WML objects.convert(InputStream is, String baseUrl) Convert the well formed XHTML contained in the string to a list of WML objects.Convert the well formed XHTML found at the specified URI to a list of WML objects.convert(InputSource is, String baseUrl) Convert the well formed XHTML from the specified SAX InputSourceGet the current numbers of SEQ fields, used in image captions.voidsetHyperlinkStyle(String hyperlinkStyleID) Configure, how the Importer styles hyperlinks If hyperlinkStyleId is set tonull, hyperlinks are styled using just the CSS.voidsetMaxWidth(int maxWidth, String tableStyle) Set the maximum width available (in twips); useful for scaling bare images if they are to go in a table cell.voidsetParagraphFormatting(FormattingOption paragraphFormatting) voidsetRunFormatting(FormattingOption runFormatting) voidsetSequenceCounters(Map<String, Integer> sequenceCounters) Set the last used numbers of SEQ fields, used in image captions.voidsetTableFormatting(FormattingOption tableFormatting)
-
Method Details
-
setHyperlinkStyle
Configure, how the Importer styles hyperlinks If hyperlinkStyleId is set tonull, 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.- Parameters:
hyperlinkStyleID- The style to use for hyperlinks (eg Hyperlink)
-
setRunFormatting
-
setParagraphFormatting
-
setTableFormatting
-
convert
List<Object> convert(File file, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException Convert the well formed XHTML contained in file to a list of WML objects.- Parameters:
file-baseUrl-wordMLPackage-- Returns:
- Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
convert
List<Object> convert(InputSource is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException Convert the well formed XHTML from the specified SAX InputSource- Parameters:
is-baseUrl-wordMLPackage-- Returns:
- Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
convert
List<Object> convert(InputStream is, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException - Parameters:
is-baseUrl-wordMLPackage-- Returns:
- Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
convert
List<Object> convert(Node node, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException - Parameters:
node-baseUrl-wordMLPackage-- Returns:
- Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
convert
List<Object> convert(Reader reader, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException - Parameters:
reader-baseUrl-wordMLPackage-- Returns:
- Throws:
IOExceptionorg.docx4j.openpackaging.exceptions.Docx4JException
-
convert
Convert the well formed XHTML found at the specified URI to a list of WML objects.- Parameters:
url-wordMLPackage-- Returns:
- Throws:
org.docx4j.openpackaging.exceptions.Docx4JException
-
convert
List<Object> convert(String content, String baseUrl) throws org.docx4j.openpackaging.exceptions.Docx4JException Convert the well formed XHTML contained in the string to a list of WML objects.- Parameters:
content-baseUrl-wordMLPackage-- Returns:
- Throws:
org.docx4j.openpackaging.exceptions.Docx4JException
-
getSequenceCounters
Get the current numbers of SEQ fields, used in image captions. Typically you'd use this if you are importing multiple times into a single docx (as for example, OpenDoPE does).- Parameters:
sequenceCounters-- Since:
- 3.2.0
-
setSequenceCounters
Set the last used numbers of SEQ fields, used in image captions. Key is sequence name. The default is "Figure", but you can also use others (matching value of @sequence).- Parameters:
sequenceCounters-- Since:
- 3.2.0
-
getBookmarkIdLast
AtomicInteger getBookmarkIdLast() -
setMaxWidth
Set the maximum width available (in twips); useful for scaling bare images if they are to go in a table cell.
Also set table style if images are really to go in a table cell (needed to remove table style margins from final width).- Parameters:
maxWidth-tableStyle- - can be null
-