[poppler] poppler/Form.cc poppler/Form.h qt5/src qt6/src
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Apr 14 22:35:38 UTC 2022
poppler/Form.cc | 3 ++-
poppler/Form.h | 2 +-
qt5/src/poppler-form.cc | 5 +++--
qt6/src/poppler-form.cc | 5 +++--
4 files changed, 9 insertions(+), 6 deletions(-)
New commits:
commit 10d74ff226b8b7e930a75b050664272df30c2aba
Author: Alexander Sulfrian <asulfrian at zedat.fu-berlin.de>
Date: Thu Apr 14 00:43:58 2022 +0200
qt: Pass leftFontSize down to `FormWidgetSignature::signDocumentWithAppearence`
A similar issue for `PDFDoc::sign` was already fixed in: 864466a6753014106448f1a6c0000aa68bedf101
diff --git a/poppler/Form.cc b/poppler/Form.cc
index 0aafd912..486a9b4e 100644
--- a/poppler/Form.cc
+++ b/poppler/Form.cc
@@ -687,7 +687,7 @@ bool FormWidgetSignature::signDocument(const char *saveFilename, const char *cer
bool FormWidgetSignature::signDocumentWithAppearance(const char *saveFilename, const char *certNickname, const char *digestName, const char *password, const GooString *reason, const GooString *location,
const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, 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)
+ double leftFontSize, std::unique_ptr<AnnotColor> &&fontColor, double borderWidth, std::unique_ptr<AnnotColor> &&borderColor, std::unique_ptr<AnnotColor> &&backgroundColor)
{
// Set the appearance
GooString *aux = getField()->getDefaultAppearance();
@@ -722,6 +722,7 @@ bool FormWidgetSignature::signDocumentWithAppearance(const char *saveFilename, c
::FormFieldSignature *ffs = static_cast<::FormFieldSignature *>(getField());
ffs->setCustomAppearanceContent(signatureText);
ffs->setCustomAppearanceLeftContent(signatureTextLeft);
+ ffs->setCustomAppearanceLeftFontSize(leftFontSize);
const bool success = signDocument(saveFilename, certNickname, digestName, password, reason, location, ownerPassword, userPassword);
diff --git a/poppler/Form.h b/poppler/Form.h
index 903482a0..1157147b 100644
--- a/poppler/Form.h
+++ b/poppler/Form.h
@@ -312,7 +312,7 @@ public:
// Same as above but adds text, font color, etc.
bool signDocumentWithAppearance(const char *filename, const char *certNickname, const char *digestName, const char *password, const GooString *reason = nullptr, const GooString *location = nullptr,
const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, 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 = {});
+ double leftFontSize = {}, std::unique_ptr<AnnotColor> &&fontColor = {}, double borderWidth = {}, std::unique_ptr<AnnotColor> &&borderColor = {}, std::unique_ptr<AnnotColor> &&backgroundColor = {});
// checks the length encoding of the signature and returns the hex encoded signature
// if the check passed (and the checked file size as output parameter in checkedFileSize)
diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
index 665fb5f4..1144c174 100644
--- a/qt5/src/poppler-form.cc
+++ b/qt5/src/poppler-form.cc
@@ -1102,8 +1102,9 @@ FormFieldSignature::SigningResult FormFieldSignature::sign(const QString &output
const auto gSignatureText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureText()));
const auto gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText()));
- const bool success = fws->signDocumentWithAppearance(outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), "SHA256", data.password().toUtf8().constData(), reason.get(), location.get(), ownerPwd, userPwd,
- *gSignatureText, *gSignatureLeftText, data.fontSize(), convertQColor(data.fontColor()), data.borderWidth(), convertQColor(data.borderColor()), convertQColor(data.backgroundColor()));
+ const bool success =
+ fws->signDocumentWithAppearance(outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), "SHA256", data.password().toUtf8().constData(), reason.get(), location.get(), ownerPwd, userPwd, *gSignatureText,
+ *gSignatureLeftText, data.fontSize(), data.leftFontSize(), convertQColor(data.fontColor()), data.borderWidth(), convertQColor(data.borderColor()), convertQColor(data.backgroundColor()));
return success ? SigningSuccess : GenericSigningError;
}
diff --git a/qt6/src/poppler-form.cc b/qt6/src/poppler-form.cc
index 7e963f0f..e97b327b 100644
--- a/qt6/src/poppler-form.cc
+++ b/qt6/src/poppler-form.cc
@@ -1102,8 +1102,9 @@ FormFieldSignature::SigningResult FormFieldSignature::sign(const QString &output
const auto gSignatureText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureText()));
const auto gSignatureLeftText = std::unique_ptr<GooString>(QStringToUnicodeGooString(data.signatureLeftText()));
- const bool success = fws->signDocumentWithAppearance(outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), "SHA256", data.password().toUtf8().constData(), reason.get(), location.get(), ownerPwd, userPwd,
- *gSignatureText, *gSignatureLeftText, data.fontSize(), convertQColor(data.fontColor()), data.borderWidth(), convertQColor(data.borderColor()), convertQColor(data.backgroundColor()));
+ const bool success =
+ fws->signDocumentWithAppearance(outputFileName.toUtf8().constData(), data.certNickname().toUtf8().constData(), "SHA256", data.password().toUtf8().constData(), reason.get(), location.get(), ownerPwd, userPwd, *gSignatureText,
+ *gSignatureLeftText, data.fontSize(), data.leftFontSize(), convertQColor(data.fontColor()), data.borderWidth(), convertQColor(data.borderColor()), convertQColor(data.backgroundColor()));
return success ? SigningSuccess : GenericSigningError;
}
More information about the poppler
mailing list