Get PDF Version

Get PDF version

Use this workflow when you need to check file compatibility or route a document through version-specific processing logic.

Steps

  1. Create a PdfFileInfo object for the PDF file.
  2. Call getPdfVersion() to retrieve the reported version.
  3. Use or print the version value.
  4. Close the PdfFileInfo instance.

Java example

public static void getPdfVersion(Path inputFile) {
    PdfFileInfo pdfInfo = new PdfFileInfo(inputFile.toString());
    System.out.println();
    System.out.println("PDF Version: " + pdfInfo.getPdfVersion());
    pdfInfo.close();
}