Get Viewer Preferences

Get the current viewer preference

  1. Bind the source PDF to the PdfContentEditor facade.
  2. Call getViewerPreference() to read the current value.
  3. Inspect or print the returned preference flag.
public static void getViewerPreferences(Path inputFile) {
    PdfContentEditor editor = new PdfContentEditor();
    try {
        editor.bindPdf(inputFile.toString());
        System.out.println("Current viewer preference: " + editor.getViewerPreference());
    } finally {
        editor.close();
    }
}