System.out.println("============ Custom Properties ============");
for (DocumentProperty prop : doc.getCustomDocumentProperties())
System.out.println(MessageFormat.format("{0} : {1}", prop.getName(), prop.getValue()));
FileFormatInfo info = FileFormatUtil.detectFileFormat("data/docx4j/document.doc");
System.out.println("The document format is: " + FileFormatUtil.loadFormatToExtension(info.getLoadFormat()));
System.out.println("Document is encrypted: " + info.isEncrypted());
System.out.println("Document has a digital signature: " + info.hasDigitalSignature());
}