diff options
Diffstat (limited to 'libqpdf/QPDF.cc')
-rw-r--r-- | libqpdf/QPDF.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libqpdf/QPDF.cc b/libqpdf/QPDF.cc index 812fb127..583a028c 100644 --- a/libqpdf/QPDF.cc +++ b/libqpdf/QPDF.cc @@ -2777,3 +2777,14 @@ QPDF::everPushedInheritedAttributesToPages() const { return this->m->ever_pushed_inherited_attributes_to_pages; } + +void +QPDF::removeSecurityRestrictions() +{ + auto root = getRoot(); + root.removeKey("/Perms"); + auto acroform = root.getKey("/AcroForm"); + if (acroform.isDictionary() && acroform.hasKey("/SigFlags")) { + acroform.replaceKey("/SigFlags", QPDFObjectHandle::newInteger(0)); + } +} |