diff options
author | Jay Berkenbilt <ejb@ql.org> | 2012-12-27 21:17:39 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2012-12-31 11:36:50 +0100 |
commit | 774584163ff3d310e7c932e2a6f63b590cb736ac (patch) | |
tree | 7b92b086ab258e49f95189c2dd860ee615faba6c /libqpdf/QPDF.cc | |
parent | 3101955ac0f7f3818dca53d285f5ccd60ccdddea (diff) | |
download | qpdf-774584163ff3d310e7c932e2a6f63b590cb736ac.tar.zst |
Add ExtensionLevel support to version handling
All version operations are now fully aware of extension levels.
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r-- | libqpdf/QPDF.cc | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index fac79796..9d5d8240 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -1872,6 +1872,30 @@ QPDF::getPDFVersion() const return this->pdf_version; } +int +QPDF::getExtensionLevel() +{ + int result = 0; + QPDFObjectHandle obj = getRoot(); + if (obj.hasKey("/Extensions")) + { + obj = obj.getKey("/Extensions"); + if (obj.isDictionary() && obj.hasKey("/ADBE")) + { + obj = obj.getKey("/ADBE"); + if (obj.isDictionary() && obj.hasKey("/ExtensionLevel")) + { + obj = obj.getKey("/ExtensionLevel"); + if (obj.isInteger()) + { + result = obj.getIntValue(); + } + } + } + } + return result; +} + QPDFObjectHandle QPDF::getTrailer() { |