//TODO: Let's try to move this into PDFBox.
//Attempt to determine Adobe extension level, if present:
COSDictionary root = document.getDocumentCatalog().getCOSDictionary();
COSDictionary extensions = (COSDictionary) root.getDictionaryObject(COSName.getPDFName("Extensions") );
if( extensions != null ) {
for( COSName extName : extensions.keySet() ) {
// If it's an Adobe one, interpret it to determine the extension level:
if( extName.equals( COSName.getPDFName("ADBE") )) {
COSDictionary adobeExt = (COSDictionary) extensions.getDictionaryObject(extName);
if( adobeExt != null ) {
String baseVersion = adobeExt.getNameAsString(COSName.getPDFName("BaseVersion"));