This example displays the format of the document.
System.out.println(document.getSaveFormat());
Related information
SaveFormat property