Get PDF Version
Contents
[
Hide
]
Get PDF version
Use this workflow when you need to check file compatibility or route a document through version-specific processing logic.
Steps
- Create a
PdfFileInfoobject for the PDF file. - Call
getPdfVersion()to retrieve the reported version. - Use or print the version value.
- Close the
PdfFileInfoinstance.
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();
}