Package org.apache.poi.hwpf.converter
Class WordToFoConverter
- java.lang.Object
-
- org.apache.poi.hwpf.converter.AbstractWordConverter
-
- org.apache.poi.hwpf.converter.WordToFoConverter
-
@Beta public class WordToFoConverter extends AbstractWordConverter
-
-
Field Summary
Fields Modifier and Type Field Description protected FoDocumentFacadefoDocumentFacade-
Fields inherited from class org.apache.poi.hwpf.converter.AbstractWordConverter
UNICODECHAR_NO_BREAK_SPACE, UNICODECHAR_NONBREAKING_HYPHEN, UNICODECHAR_ZERO_WIDTH_SPACE
-
-
Constructor Summary
Constructors Constructor Description WordToFoConverter(FoDocumentFacade foDocumentFacade)WordToFoConverter(Document document)Creates new instance ofWordToFoConverter.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ElementcreateNoteInline(String noteIndexText)protected StringcreatePageMaster(Section section, String type, int sectionIndex)DocumentgetDocument()booleanisOutputCharactersLanguage()static voidmain(String[] args)Java main() interface to interact withWordToFoConverterprotected voidoutputCharacters(Element block, CharacterRun characterRun, String text)protected voidprocessBookmarks(HWPFDocumentCore wordDocument, Element currentBlock, Range range, int currentTableLevel, List<Bookmark> rangeBookmarks)Wrap range into bookmark(s) and process it.protected voidprocessDocumentInformation(SummaryInformation summaryInformation)protected voidprocessDrawnObject(HWPFDocument doc, CharacterRun characterRun, OfficeDrawing officeDrawing, String path, Element block)protected voidprocessEndnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range endnoteTextRange)protected voidprocessFootnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range footnoteTextRange)protected voidprocessHyperlink(HWPFDocumentCore wordDocument, Element currentBlock, Range textRange, int currentTableLevel, String hyperlink)protected voidprocessImage(Element currentBlock, boolean inlined, Picture picture, String url)protected voidprocessImageWithoutPicturesManager(Element currentBlock, boolean inlined, Picture picture)protected voidprocessLineBreak(Element block, CharacterRun characterRun)protected voidprocessPageBreak(HWPFDocumentCore wordDocument, Element flow)protected voidprocessPageref(HWPFDocumentCore hwpfDocument, Element currentBlock, Range textRange, int currentTableLevel, String pageref)protected voidprocessParagraph(HWPFDocumentCore hwpfDocument, Element parentFopElement, int currentTableLevel, Paragraph paragraph, String bulletText)protected voidprocessSection(HWPFDocumentCore wordDocument, Section section, int sectionCounter)protected voidprocessTable(HWPFDocumentCore wordDocument, Element flow, Table table)protected booleansetId(Element element, String id)voidsetOutputCharactersLanguage(boolean outputCharactersLanguage)-
Methods inherited from class org.apache.poi.hwpf.converter.AbstractWordConverter
afterProcess, getCharacterRunTriplet, getFontReplacer, getNumberColumnsSpanned, getNumberRowsSpanned, getPicturesManager, processCharacters, processDeadField, processDocument, processDocumentPart, processDrawnObject, processDropDownList, processField, processImage, processNoteAnchor, processOle2, processParagraphes, processSingleSection, processSymbol, setFontReplacer, setPicturesManager, tryDeadField
-
-
-
-
Field Detail
-
foDocumentFacade
protected final FoDocumentFacade foDocumentFacade
-
-
Constructor Detail
-
WordToFoConverter
public WordToFoConverter(Document document)
Creates new instance ofWordToFoConverter. Can be used for output severalHWPFDocuments into single FO document.- Parameters:
document- XML DOM Document used as XSL FO document. Shall support namespaces
-
WordToFoConverter
public WordToFoConverter(FoDocumentFacade foDocumentFacade)
-
-
Method Detail
-
main
public static void main(String[] args) throws Exception
Java main() interface to interact withWordToFoConverterUsage: WordToFoConverter infile outfile
Where infile is an input .doc file ( Word 97-2007) which will be rendered as XSL-FO into outfile- Throws:
Exception
-
getDocument
public Document getDocument()
- Specified by:
getDocumentin classAbstractWordConverter
-
isOutputCharactersLanguage
public boolean isOutputCharactersLanguage()
-
outputCharacters
protected void outputCharacters(Element block, CharacterRun characterRun, String text)
- Specified by:
outputCharactersin classAbstractWordConverter
-
processBookmarks
protected void processBookmarks(HWPFDocumentCore wordDocument, Element currentBlock, Range range, int currentTableLevel, List<Bookmark> rangeBookmarks)
Description copied from class:AbstractWordConverterWrap range into bookmark(s) and process it. All bookmarks have starts equal to range start and ends equal to range end. Usually it's only one bookmark.- Specified by:
processBookmarksin classAbstractWordConverter
-
processDocumentInformation
protected void processDocumentInformation(SummaryInformation summaryInformation)
- Specified by:
processDocumentInformationin classAbstractWordConverter
-
processDrawnObject
protected void processDrawnObject(HWPFDocument doc, CharacterRun characterRun, OfficeDrawing officeDrawing, String path, Element block)
- Specified by:
processDrawnObjectin classAbstractWordConverter
-
processEndnoteAutonumbered
protected void processEndnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range endnoteTextRange)
- Specified by:
processEndnoteAutonumberedin classAbstractWordConverter
-
processFootnoteAutonumbered
protected void processFootnoteAutonumbered(HWPFDocument wordDocument, int noteIndex, Element block, Range footnoteTextRange)
- Specified by:
processFootnoteAutonumberedin classAbstractWordConverter
-
processHyperlink
protected void processHyperlink(HWPFDocumentCore wordDocument, Element currentBlock, Range textRange, int currentTableLevel, String hyperlink)
- Specified by:
processHyperlinkin classAbstractWordConverter
-
processImage
protected void processImage(Element currentBlock, boolean inlined, Picture picture, String url)
- Specified by:
processImagein classAbstractWordConverter
-
processImageWithoutPicturesManager
protected void processImageWithoutPicturesManager(Element currentBlock, boolean inlined, Picture picture)
- Specified by:
processImageWithoutPicturesManagerin classAbstractWordConverter
-
processLineBreak
protected void processLineBreak(Element block, CharacterRun characterRun)
- Specified by:
processLineBreakin classAbstractWordConverter
-
processPageBreak
protected void processPageBreak(HWPFDocumentCore wordDocument, Element flow)
- Specified by:
processPageBreakin classAbstractWordConverter
-
processPageref
protected void processPageref(HWPFDocumentCore hwpfDocument, Element currentBlock, Range textRange, int currentTableLevel, String pageref)
- Specified by:
processPagerefin classAbstractWordConverter
-
processParagraph
protected void processParagraph(HWPFDocumentCore hwpfDocument, Element parentFopElement, int currentTableLevel, Paragraph paragraph, String bulletText)
- Specified by:
processParagraphin classAbstractWordConverter
-
processSection
protected void processSection(HWPFDocumentCore wordDocument, Section section, int sectionCounter)
- Specified by:
processSectionin classAbstractWordConverter
-
processTable
protected void processTable(HWPFDocumentCore wordDocument, Element flow, Table table)
- Specified by:
processTablein classAbstractWordConverter
-
setOutputCharactersLanguage
public void setOutputCharactersLanguage(boolean outputCharactersLanguage)
-
-