Java Reference
In-Depth Information
• The first approach uses the getMetadataTextExtractor method and then
the getText method, as shown here:
POITextExtractor metaExtractor =
textExtractor.getMetadataTextExtractor();
System.out.println(metaExtractor.getText());
• The second approach creates an instance of the POIXMLPropertiesTextEx-
tractor class using XWPFDocument representing the Word document, as il-
lustrated here:
fis = new FileInputStream("TestDocument.docx");
POIXMLPropertiesTextExtractor properties =
new POIXMLPropertiesTextExtractor(new
XWPFDocument(fis));
System.out.println(properties.getText());
The output of either approach is shown here:
Created = Sat Jan 03 18:27:00 CST 2015
CreatedString = 2015-01-04T00:27:00Z
Creator = Richard
LastModifiedBy = Richard
LastPrinted = Sat Jan 03 18:27:00 CST 2015
LastPrintedString = 2015-01-04T00:27:00Z
Modified = Mon Jan 05 14:01:00 CST 2015
ModifiedString = 2015-01-05T20:01:00Z
Revision = 3
Application = Microsoft Office Word
AppVersion = 12.0000
Characters = 762
CharactersWithSpaces = 894
Company =
HyperlinksChanged = false
Lines = 6
LinksUpToDate = false
Pages = 1
Paragraphs = 1
Search WWH ::




Custom Search