[poppler] poppler/PDFDoc.cc qt5/src qt6/src
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Sep 16 10:39:47 UTC 2021
poppler/PDFDoc.cc | 2 +-
qt5/src/poppler-pdf-converter.cc | 2 +-
qt6/src/poppler-pdf-converter.cc | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
New commits:
commit 431d2e6c9e367f8fada13205d527b38282200207
Author: Albert Astals Cid <aacid at kde.org>
Date: Thu Sep 16 12:33:52 2021 +0200
PDFDoc::sign: make page be 1 indexed like on the PDFDoc functions
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index ec59ccad..f3ff38d1 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -2124,7 +2124,7 @@ bool PDFDoc::hasJavascript()
bool PDFDoc::sign(const char *saveFilename, const char *certNickname, const char *password, GooString *partialFieldName, int page, const PDFRectangle &rect, const GooString &signatureText, const GooString &signatureTextLeft,
double fontSize, std::unique_ptr<AnnotColor> &&fontColor, double borderWidth, std::unique_ptr<AnnotColor> &&borderColor, std::unique_ptr<AnnotColor> &&backgroundColor, const GooString *reason, const GooString *location)
{
- ::Page *destPage = getPage(page + 1);
+ ::Page *destPage = getPage(page);
const DefaultAppearance da { { objName, "SigFont" }, fontSize, std::move(fontColor) };
diff --git a/qt5/src/poppler-pdf-converter.cc b/qt5/src/poppler-pdf-converter.cc
index 3dcb4c16..5b2e7c03 100644
--- a/qt5/src/poppler-pdf-converter.cc
+++ b/qt5/src/poppler-pdf-converter.cc
@@ -134,7 +134,7 @@ bool PDFConverter::sign(const NewSignatureData &data)
std::unique_ptr<GooString> gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText()));
const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason()));
const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location()));
- return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page(),
+ return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page() + 1,
boundaryToPdfRectangle(destPage, data.boundingRectangle(), Annotation::FixedRotation), *gSignatureText, *gSignatureLeftText, data.fontSize(), convertQColor(data.fontColor()), data.borderWidth(),
convertQColor(data.borderColor()), convertQColor(data.backgroundColor()), reason.get(), location.get());
}
diff --git a/qt6/src/poppler-pdf-converter.cc b/qt6/src/poppler-pdf-converter.cc
index c74ac2be..1c77146d 100644
--- a/qt6/src/poppler-pdf-converter.cc
+++ b/qt6/src/poppler-pdf-converter.cc
@@ -134,7 +134,7 @@ bool PDFConverter::sign(const NewSignatureData &data)
std::unique_ptr<GooString> gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText()));
const auto reason = std::unique_ptr<GooString>(data.reason().isEmpty() ? nullptr : QStringToUnicodeGooString(data.reason()));
const auto location = std::unique_ptr<GooString>(data.location().isEmpty() ? nullptr : QStringToUnicodeGooString(data.location()));
- return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page(),
+ return doc->sign(d->outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), data.password().toUtf8().constData(), QStringToGooString(data.fieldPartialName()), data.page() + 1,
boundaryToPdfRectangle(destPage, data.boundingRectangle(), Annotation::FixedRotation), *gSignatureText, *gSignatureLeftText, data.fontSize(), convertQColor(data.fontColor()), data.borderWidth(),
convertQColor(data.borderColor()), convertQColor(data.backgroundColor()), reason.get(), location.get());
}
More information about the poppler
mailing list