代码源用到引用index.pdf
ApachePOI-HWPF-JavaAPIto
HandleWordFiles
Overview
byNicolaKenBarozzi,AndrewC.Oliver,RyanAckley,RainerKlute
1.Overview
HWPFisthenameofourportoftheWord97(-2007)fileformattopureJava.It
alsoprovideslimitedreadonlysupportfortheolderWord6andWord95fileformats.
ThepartnertoHWPFforthenewWord2007.docxformatisXWPF.WhilstHWPFand
XWPFprovidesimilarfeatures,thereisnotacommoninterfaceacrossthetwoofthemat
thistime.
HWPFisstillinearlydevelopment.ItisinthescratchpadsectionoftheSVN.Youwillneed
toensureyoueitherhavearecentSVNcheckout,orarecentSVNnightlybuild(including
thescratchpadjar!)
Sourcecodeintheorg.apache.poi.hdftreeistheoldlegacycode.Sourceinthe
org.apache.poi.hwpf.modeltreeistheoldlegacycoderefactoredintoannewobjectmodel.
ThosepackagescontainsJavarepresentationofinternalWordformatstructure.Thiscodeis
internal,itshallnotbeusedbyyourcode.Becauseofbackward-compatibilitysomeAPI
stillhasreferencestothosepackages.Theyaresubjecttobedeprecatedandremoved.Code
fromorg.apache.poi.hwpf.usermodelpackageisactualpublicanduser-friendly(asmuchas
possible)APItoaccessdocumentparts.Sourcecodeintheorg.apache.poi.hwpf.extractor
treeisawrapperofthistofacilitateeasyextractionofinterestingthings(egtheText),and
org.apache.poi.hwpf.converterpackagecontainsWord-to-HTMLandWord-to-FO
converters(latestcanbeusedtogeneratePDFfromWordfileswhenusingwithApacheFOP
).Alsothereisasmallfile-structure-dumpingutilityinorg.apache.poi.hwpf.devpackage,
primallyfordevelopingpurposes.
ThemainentrypointtoHWPFisHWPFDocument.Currentlyithasalotofreferencesboth
tointernalinterfaces(org.apache.poi.hwpf.modelpackage)andpublicAPI(
org.apache.poi.hwpf.usermodel)package.Itispossiblethatitwillbesplitintotwodifferent
interfaces(likeWordFileandWordDocument)inlaterversions.
Page1
Copyright©2002-2011TheApacheSoftwareFoundation
ApachePOI-HWPF-JavaAPItoHandleWordFiles
Wor