The following example shows how to get document info:
// Create an instance of Parser class
try(Parserparser=newParser(Constants.SampleDocx)){// Get the document info
IDocumentInfoinfo=parser.getDocumentInfo();// Print document information
System.out.println(String.format("FileType: %s",info.getFileType()));System.out.println(String.format("PageCount: %d",info.getPageCount()));System.out.println(String.format("Size: %d",info.getSize()));}
More resources
Advanced usage topics
To learn more about document data extraction features and get familiar how to extract text, images, forms and more, please refer to the advanced usage section.
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples: