Document document = file.getDocument();
// 2. Document parsing.
// 2.1. Showing basic metadata...
System.out.println("\nDocument information:");
Information info = document.getInformation();
if(info == null)
{System.out.println("No information available (Info dictionary doesn't exist).");}
else
{
System.out.println("Author: " + info.getAuthor());
System.out.println("Title: " + info.getTitle());
System.out.println("Subject: " + info.getSubject());
System.out.println("CreationDate: " + info.getCreationDate());
}
System.out.println("\nIterating through the indirect-object collection (please wait)...");
// 2.2. Counting the indirect objects, grouping them by type...