Detecting the version of a Pdf document The following sample of code will help you to detect the Pdf version a loaded document and extract some additional file format information.
Load a Pdf document Extract the root metadata package Use the getPdfType method to obtain file format information advanced_usage.managing_metadata_for_specific_formats.document.Pdf.PdfReadFileFormatProperties
try (Metadata metadata = new Metadata(Constants.InputPdf)) { PdfRootPackage root = metadata.getRootPackageGeneric(); System.out.println(root.getPdfType().getFileFormat()); System.out.println(root.getPdfType().getVersion()); System.out.println(root.getPdfType().getMimeType()); System.out.println(root.getPdfType().getExtension()); } Reading built-in metadata properties To access built-in metadata of a Pdf document, please use the getDocumentProperties method defined in the DocumentRootPackage class....Annotation Product Solution GroupDocs...metadata in PDF documents Working with metadata in PDF documents...