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....Metadata Product Solution GroupDocs...GroupDocs.Metadata Product Family / GroupDocs.Metadata for Java...