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
- Author:
- Sergey Vladimirov (vlsergey {at} gmail {dot} com)
Method Summary |
protected org.w3c.dom.Element |
createNoteInline(java.lang.String noteIndexText)
|
protected java.lang.String |
createPageMaster(Section section,
java.lang.String type,
int sectionIndex)
|
org.w3c.dom.Document |
getDocument()
|
boolean |
isOutputCharactersLanguage()
|
static void |
main(java.lang.String[] args)
Java main() interface to interact with WordToFoConverter |
protected void |
outputCharacters(org.w3c.dom.Element block,
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)
|
protected void |
processDrawnObject(HWPFDocument doc,
CharacterRun characterRun,
OfficeDrawing officeDrawing,
java.lang.String path,
org.w3c.dom.Element block)
|
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)
This method shall store image bytes in external file and convert it if
necessary. |
protected void |
processImage(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture,
java.lang.String url)
|
protected void |
processLineBreak(org.w3c.dom.Element block,
CharacterRun characterRun)
|
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 parentFopElement,
int currentTableLevel,
Paragraph paragraph,
java.lang.String bulletText)
|
protected void |
processSection(HWPFDocumentCore wordDocument,
Section section,
int sectionCounter)
|
protected void |
processTable(HWPFDocumentCore wordDocument,
org.w3c.dom.Element flow,
Table table)
|
protected boolean |
setId(org.w3c.dom.Element element,
java.lang.String id)
|
void |
setOutputCharactersLanguage(boolean outputCharactersLanguage)
|
Methods inherited from class org.apache.poi.hwpf.converter.AbstractWordConverter |
afterProcess, getCharacterRunTriplet, getFontReplacer, getNumberColumnsSpanned, getNumberRowsSpanned, getPicturesManager, getTableCellEdgesIndexSkipCount, processCharacters, processDeadField, processDeadField, processDocument, processDocumentPart, processDrawnObject, processField, processNoteAnchor, processOle2, processParagraphes, processSingleSection, setFontReplacer, setPicturesManager, tryDeadField |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
foDocumentFacade
protected final FoDocumentFacade foDocumentFacade
WordToFoConverter
public WordToFoConverter(org.w3c.dom.Document document)
- Creates new instance of
WordToFoConverter
. Can be used for output
several HWPFDocument
s into single FO document.
- Parameters:
document
- XML DOM Document used as XSL FO document. Shall support
namespaces
main
public static void main(java.lang.String[] args)
- Java main() interface to interact with
WordToFoConverter
Usage: WordToFoConverter infile outfile
Where infile is an input .doc file ( Word 97-2007) which will be rendered
as XSL-FO into outfile
createNoteInline
protected org.w3c.dom.Element createNoteInline(java.lang.String noteIndexText)
createPageMaster
protected java.lang.String createPageMaster(Section section,
java.lang.String type,
int sectionIndex)
getDocument
public org.w3c.dom.Document getDocument()
- Specified by:
getDocument
in class AbstractWordConverter
isOutputCharactersLanguage
public boolean isOutputCharactersLanguage()
outputCharacters
protected void outputCharacters(org.w3c.dom.Element block,
CharacterRun characterRun,
java.lang.String text)
- Specified by:
outputCharacters
in class AbstractWordConverter
processBookmarks
protected void processBookmarks(HWPFDocumentCore wordDocument,
org.w3c.dom.Element currentBlock,
Range range,
int currentTableLevel,
java.util.List<Bookmark> rangeBookmarks)
- Description copied from class:
AbstractWordConverter
- Wrap 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:
processBookmarks
in class AbstractWordConverter
processDocumentInformation
protected void processDocumentInformation(SummaryInformation summaryInformation)
- Specified by:
processDocumentInformation
in class AbstractWordConverter
processDrawnObject
protected void processDrawnObject(HWPFDocument doc,
CharacterRun characterRun,
OfficeDrawing officeDrawing,
java.lang.String path,
org.w3c.dom.Element block)
- Specified by:
processDrawnObject
in class AbstractWordConverter
processEndnoteAutonumbered
protected void processEndnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
org.w3c.dom.Element block,
Range endnoteTextRange)
- Specified by:
processEndnoteAutonumbered
in class AbstractWordConverter
processFootnoteAutonumbered
protected void processFootnoteAutonumbered(HWPFDocument wordDocument,
int noteIndex,
org.w3c.dom.Element block,
Range footnoteTextRange)
- Specified by:
processFootnoteAutonumbered
in class AbstractWordConverter
processHyperlink
protected void processHyperlink(HWPFDocumentCore wordDocument,
org.w3c.dom.Element currentBlock,
Range textRange,
int currentTableLevel,
java.lang.String hyperlink)
- Specified by:
processHyperlink
in class AbstractWordConverter
processImage
protected void processImage(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture)
- This method shall store image bytes in external file and convert it if
necessary. Images shall be stored using PNG format (for bitmap) or SVG
(for vector). Other formats may be not supported by your XSL FO
processor.
Please note the
WordToFoUtils.setPictureProperties(Picture, Element)
method.
- Specified by:
processImage
in class AbstractWordConverter
- Parameters:
currentBlock
- currently processed FO element, like fo:block. Shall
be used as parent of newly created
fo:external-graphic or
fo:instream-foreign-objectinlined
- if image is inlinedpicture
- HWPF object, contained picture data and properties
processImage
protected void processImage(org.w3c.dom.Element currentBlock,
boolean inlined,
Picture picture,
java.lang.String url)
processLineBreak
protected void processLineBreak(org.w3c.dom.Element block,
CharacterRun characterRun)
- Specified by:
processLineBreak
in class AbstractWordConverter
processPageBreak
protected void processPageBreak(HWPFDocumentCore wordDocument,
org.w3c.dom.Element flow)
- Specified by:
processPageBreak
in class AbstractWordConverter
processPageref
protected void processPageref(HWPFDocumentCore hwpfDocument,
org.w3c.dom.Element currentBlock,
Range textRange,
int currentTableLevel,
java.lang.String pageref)
- Specified by:
processPageref
in class AbstractWordConverter
processParagraph
protected void processParagraph(HWPFDocumentCore hwpfDocument,
org.w3c.dom.Element parentFopElement,
int currentTableLevel,
Paragraph paragraph,
java.lang.String bulletText)
- Specified by:
processParagraph
in class AbstractWordConverter
processSection
protected void processSection(HWPFDocumentCore wordDocument,
Section section,
int sectionCounter)
- Specified by:
processSection
in class AbstractWordConverter
processTable
protected void processTable(HWPFDocumentCore wordDocument,
org.w3c.dom.Element flow,
Table table)
- Specified by:
processTable
in class AbstractWordConverter
setId
protected boolean setId(org.w3c.dom.Element element,
java.lang.String id)
setOutputCharactersLanguage
public void setOutputCharactersLanguage(boolean outputCharactersLanguage)
Copyright 2011 The Apache Software Foundation or
its licensors, as applicable.