@Beta public class WordToHtmlConverter extends AbstractWordConverter
This implementation doesn't create images or links to them. This can be
changed by overriding AbstractWordConverter.processImage(Element, boolean, Picture)
method.
UNICODECHAR_NO_BREAK_SPACE, UNICODECHAR_NONBREAKING_HYPHEN, UNICODECHAR_ZERO_WIDTH_SPACE| Constructor and Description |
|---|
WordToHtmlConverter(org.w3c.dom.Document document)
Creates new instance of
WordToHtmlConverter. |
WordToHtmlConverter(HtmlDocumentFacade htmlDocumentFacade) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterProcess()
Special actions that need to be called after processing complete, like
updating stylesheets or building document notes list.
|
org.w3c.dom.Document |
getDocument() |
static void |
main(java.lang.String[] args)
Java main() interface to interact with
WordToHtmlConverter |
protected void |
outputCharacters(org.w3c.dom.Element pElement,
CharacterRun characterRun,
java.lang.String text) |
protected void |
processBookmarks(HWPFDocumentCore wordDocument,
org.w3c.dom.Element currentBlock,
Range range,
int currentTableLevel,
java.util.List<Bookmark> rangeBookmarks)
Wrap range into bookmark(s) and process it.
|
protected void |
processDocumentInformation(SummaryInformation summaryInformation) |
void |
processDocumentPart(HWPFDocumentCore wordDocument,
Range range) |
protected void |
processDrawnObject(HWPFDocument doc,
CharacterRun characterRun,
OfficeDrawing officeDrawing,
java.lang.String path,
org.w3c.dom.Element block) |
protected void |
processDropDownList(org.w3c.dom.Element block,
CharacterRun characterRun,
java.lang.String[] values,
int defaultIndex) |
protected void |
processEndnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
org.w3c.dom.Element block,
Range endnoteTextRange) |
protected void |
processFootnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
org.w3c.dom.Element block,
Range footnoteTextRange) |
protected void |
processHyperlink(HWPFDocumentCore wordDocument,
org.w3c.dom.Element currentBlock,
Range textRange,
int currentTableLevel,
java.lang.String hyperlink) |
protected void |
processImage(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture,
java.lang.String imageSourcePath) |
protected void |
processImageWithoutPicturesManager(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture) |
protected void |
processLineBreak(org.w3c.dom.Element block,
CharacterRun characterRun) |
protected void |
processNoteAutonumbered(HWPFDocument doc,
java.lang.String type,
int noteIndex,
org.w3c.dom.Element block,
Range noteTextRange) |
protected void |
processPageBreak(HWPFDocumentCore wordDocument,
org.w3c.dom.Element flow) |
protected void |
processPageref(HWPFDocumentCore hwpfDocument,
org.w3c.dom.Element currentBlock,
Range textRange,
int currentTableLevel,
java.lang.String pageref) |
protected void |
processParagraph(HWPFDocumentCore hwpfDocument,
org.w3c.dom.Element parentElement,
int currentTableLevel,
Paragraph paragraph,
java.lang.String bulletText) |
protected void |
processSection(HWPFDocumentCore wordDocument,
Section section,
int sectionCounter) |
protected void |
processSingleSection(HWPFDocumentCore wordDocument,
Section section) |
protected void |
processTable(HWPFDocumentCore hwpfDocument,
org.w3c.dom.Element flow,
Table table) |
getCharacterRunTriplet, getFontReplacer, getNumberColumnsSpanned, getNumberRowsSpanned, getPicturesManager, processCharacters, processDeadField, processDocument, processDrawnObject, processField, processImage, processNoteAnchor, processOle2, processParagraphes, processSymbol, setFontReplacer, setPicturesManager, tryDeadFieldpublic WordToHtmlConverter(org.w3c.dom.Document document)
WordToHtmlConverter. Can be used for
output several HWPFDocuments into single HTML document.document - XML DOM Document used as HTML documentpublic WordToHtmlConverter(HtmlDocumentFacade htmlDocumentFacade)
public static void main(java.lang.String[] args)
throws java.io.IOException,
javax.xml.parsers.ParserConfigurationException,
javax.xml.transform.TransformerException
WordToHtmlConverterUsage: WordToHtmlConverter infile outfile
Where infile is an input .doc file ( Word 95-2007) which will be rendered as HTML into outfile
java.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionjavax.xml.transform.TransformerExceptionprotected void afterProcess()
AbstractWordConverterafterProcess in class AbstractWordConverterpublic org.w3c.dom.Document getDocument()
getDocument in class AbstractWordConverterprotected void outputCharacters(org.w3c.dom.Element pElement,
CharacterRun characterRun,
java.lang.String text)
outputCharacters in class AbstractWordConverterprotected void processBookmarks(HWPFDocumentCore wordDocument, org.w3c.dom.Element currentBlock, Range range, int currentTableLevel, java.util.List<Bookmark> rangeBookmarks)
AbstractWordConverterprocessBookmarks in class AbstractWordConverterprotected void processDocumentInformation(SummaryInformation summaryInformation)
processDocumentInformation in class AbstractWordConverterpublic void processDocumentPart(HWPFDocumentCore wordDocument, Range range)
processDocumentPart in class AbstractWordConverterprotected void processDropDownList(org.w3c.dom.Element block,
CharacterRun characterRun,
java.lang.String[] values,
int defaultIndex)
processDropDownList in class AbstractWordConverterprotected void processDrawnObject(HWPFDocument doc, CharacterRun characterRun, OfficeDrawing officeDrawing, java.lang.String path, org.w3c.dom.Element block)
processDrawnObject in class AbstractWordConverterprotected void processEndnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, org.w3c.dom.Element block, Range endnoteTextRange)
processEndnoteAutonumbered in class AbstractWordConverterprotected void processFootnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, org.w3c.dom.Element block, Range footnoteTextRange)
processFootnoteAutonumbered in class AbstractWordConverterprotected void processHyperlink(HWPFDocumentCore wordDocument, org.w3c.dom.Element currentBlock, Range textRange, int currentTableLevel, java.lang.String hyperlink)
processHyperlink in class AbstractWordConverterprotected void processImage(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture,
java.lang.String imageSourcePath)
processImage in class AbstractWordConverterprotected void processImageWithoutPicturesManager(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture)
processImageWithoutPicturesManager in class AbstractWordConverterprotected void processLineBreak(org.w3c.dom.Element block,
CharacterRun characterRun)
processLineBreak in class AbstractWordConverterprotected void processNoteAutonumbered(HWPFDocument doc, java.lang.String type, int noteIndex, org.w3c.dom.Element block, Range noteTextRange)
protected void processPageBreak(HWPFDocumentCore wordDocument, org.w3c.dom.Element flow)
processPageBreak in class AbstractWordConverterprotected void processPageref(HWPFDocumentCore hwpfDocument, org.w3c.dom.Element currentBlock, Range textRange, int currentTableLevel, java.lang.String pageref)
processPageref in class AbstractWordConverterprotected void processParagraph(HWPFDocumentCore hwpfDocument, org.w3c.dom.Element parentElement, int currentTableLevel, Paragraph paragraph, java.lang.String bulletText)
processParagraph in class AbstractWordConverterprotected void processSection(HWPFDocumentCore wordDocument, Section section, int sectionCounter)
processSection in class AbstractWordConverterprotected void processSingleSection(HWPFDocumentCore wordDocument, Section section)
processSingleSection in class AbstractWordConverterprotected void processTable(HWPFDocumentCore hwpfDocument, org.w3c.dom.Element flow, Table table)
processTable in class AbstractWordConverterCopyright 2018 The Apache Software Foundation or its licensors, as applicable.