diff options
author | Albert Astals Cid <aacid@kde.org> | 2024-04-22 14:22:08 +0200 |
---|---|---|
committer | Albert Astals Cid <aacid@kde.org> | 2024-04-23 09:18:13 +0000 |
commit | fe9fe140aee72a41a2add7db7f7b0dae7cb55700 (patch) | |
tree | b3fa96cf02588cc2043121714bfdad0f3210f855 | |
parent | eac1adcbc2246fd1ad22e8336d050a71cbf03804 (diff) |
signing: Fix modifying the AcroForm dict when it's embedded in the Catalog
-rw-r--r-- | poppler/Catalog.cc | 1 | ||||
-rw-r--r-- | poppler/PDFDoc.cc | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/poppler/Catalog.cc b/poppler/Catalog.cc index 2e3dbd5b..56da8b5c 100644 --- a/poppler/Catalog.cc +++ b/poppler/Catalog.cc @@ -1118,6 +1118,7 @@ void Catalog::setAcroFormModified() if (acroFormRef != Ref::INVALID()) { xref->setModifiedObject(&acroForm, acroFormRef); } else { + catDict.dictSet("AcroForm", acroForm.copy()); xref->setModifiedObject(&catDict, { xref->getRootNum(), xref->getRootGen() }); } } diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index 613a1e25..0b23f111 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -2220,6 +2220,8 @@ bool PDFDoc::sign(const std::string &saveFilename, const std::string &certNickna catalog->addFormToAcroForm(ref); // say that there a now signatures and that we should append only catalog->getAcroForm()->dictSet("SigFlags", Object(3)); + catalog->setAcroFormModified(); + form->ensureFontsForAllCharacters(&signatureText, pdfFontName); form->ensureFontsForAllCharacters(&signatureTextLeft, pdfFontName); |