[poppler] qt5/src qt6/src
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 20 09:25:10 UTC 2021
qt5/src/poppler-pdf-converter.cc | 13 ++++++++++++-
qt5/src/poppler-qt5.h | 14 +++++++++++++-
qt6/src/poppler-pdf-converter.cc | 13 ++++++++++++-
qt6/src/poppler-qt6.h | 14 +++++++++++++-
4 files changed, 50 insertions(+), 4 deletions(-)
New commits:
commit e43a3d9cff01c7d2b6374b3aa340882528da9c85
Author: Albert Astals Cid <albert.astals.cid at kdab.com>
Date: Tue Apr 13 16:06:48 2021 +0200
qt: Allow to pass the border width when signing
diff --git a/qt5/src/poppler-pdf-converter.cc b/qt5/src/poppler-pdf-converter.cc
index 32910725..d1355764 100644
--- a/qt5/src/poppler-pdf-converter.cc
+++ b/qt5/src/poppler-pdf-converter.cc
@@ -176,7 +176,7 @@ bool PDFConverter::sign(const NewSignatureData &data)
destPage->addAnnot(signatureAnnot);
std::unique_ptr<AnnotBorder> border(new AnnotBorderArray());
- border->setWidth(1.5);
+ border->setWidth(data.borderWidth());
signatureAnnot->setBorder(std::move(border));
FormWidgetSignature *fws = dynamic_cast<FormWidgetSignature *>(formWidget);
@@ -211,6 +211,7 @@ struct PDFConverter::NewSignatureData::NewSignatureDataPrivate
double fontSize = 10.0;
QColor fontColor = Qt::red;
QColor borderColor = Qt::red;
+ double borderWidth = 1.5;
QColor backgroundColor = QColor(240, 240, 240);
QString partialName = QUuid::createUuid().toString();
@@ -308,6 +309,16 @@ QColor PDFConverter::NewSignatureData::backgroundColor() const
return d->backgroundColor;
}
+double PDFConverter::NewSignatureData::borderWidth() const
+{
+ return d->borderWidth;
+}
+
+void PDFConverter::NewSignatureData::setBorderWidth(double width)
+{
+ d->borderWidth = width;
+}
+
void PDFConverter::NewSignatureData::setBackgroundColor(const QColor &color)
{
d->backgroundColor = color;
diff --git a/qt5/src/poppler-qt5.h b/qt5/src/poppler-qt5.h
index 2d879f78..70d2566a 100644
--- a/qt5/src/poppler-qt5.h
+++ b/qt5/src/poppler-qt5.h
@@ -25,6 +25,7 @@
* Copyright (C) 2020 Katarina Behrens <Katarina.Behrens at cib.de>
* Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens at CIB.de>
* Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by Technische Universität Dresden
+ * Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -2137,7 +2138,8 @@ public:
* - rect for the signature annotation
* - text that will be shown inside the rect
* - font size and color
- * - border and background color
+ * - border width and color
+ * - background color
* \since 21.01
*/
class POPPLER_QT5_EXPORT NewSignatureData
@@ -2181,6 +2183,16 @@ public:
QColor borderColor() const;
void setBorderColor(const QColor &color);
+ /**
+ * border width in points
+ *
+ * Default: 1.5
+ *
+ * \since 21.05
+ */
+ double borderWidth() const;
+ void setBorderWidth(double width);
+
/**
* Default: QColor(240, 240, 240)
*/
diff --git a/qt6/src/poppler-pdf-converter.cc b/qt6/src/poppler-pdf-converter.cc
index 3783e9ed..62e6d535 100644
--- a/qt6/src/poppler-pdf-converter.cc
+++ b/qt6/src/poppler-pdf-converter.cc
@@ -176,7 +176,7 @@ bool PDFConverter::sign(const NewSignatureData &data)
destPage->addAnnot(signatureAnnot);
std::unique_ptr<AnnotBorder> border(new AnnotBorderArray());
- border->setWidth(1.5);
+ border->setWidth(data.borderWidth());
signatureAnnot->setBorder(std::move(border));
FormWidgetSignature *fws = dynamic_cast<FormWidgetSignature *>(formWidget);
@@ -211,6 +211,7 @@ struct PDFConverter::NewSignatureData::NewSignatureDataPrivate
double fontSize = 10.0;
QColor fontColor = Qt::red;
QColor borderColor = Qt::red;
+ double borderWidth = 1.5;
QColor backgroundColor = QColor(240, 240, 240);
QString partialName = QUuid::createUuid().toString();
@@ -308,6 +309,16 @@ QColor PDFConverter::NewSignatureData::backgroundColor() const
return d->backgroundColor;
}
+double PDFConverter::NewSignatureData::borderWidth() const
+{
+ return d->borderWidth;
+}
+
+void PDFConverter::NewSignatureData::setBorderWidth(double width)
+{
+ d->borderWidth = width;
+}
+
void PDFConverter::NewSignatureData::setBackgroundColor(const QColor &color)
{
d->backgroundColor = color;
diff --git a/qt6/src/poppler-qt6.h b/qt6/src/poppler-qt6.h
index 5e34dcce..5d38fbdd 100644
--- a/qt6/src/poppler-qt6.h
+++ b/qt6/src/poppler-qt6.h
@@ -25,6 +25,7 @@
* Copyright (C) 2020 Katarina Behrens <Katarina.Behrens at cib.de>
* Copyright (C) 2020 Thorsten Behrens <Thorsten.Behrens at CIB.de>
* Copyright (C) 2020 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>. Work sponsored by Technische Universität Dresden
+ * Copyright (C) 2021 Klarälvdalens Datakonsult AB, a KDAB Group company, <info at kdab.com>.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -1955,7 +1956,8 @@ public:
* - rect for the signature annotation
* - text that will be shown inside the rect
* - font size and color
- * - border and background color
+ * - border width and color
+ * - background color
* \since 21.01
*/
class POPPLER_QT6_EXPORT NewSignatureData
@@ -1999,6 +2001,16 @@ public:
QColor borderColor() const;
void setBorderColor(const QColor &color);
+ /**
+ * border width in points
+ *
+ * Default: 1.5
+ *
+ * \since 21.05
+ */
+ double borderWidth() const;
+ void setBorderWidth(double width);
+
/**
* Default: QColor(240, 240, 240)
*/
More information about the poppler
mailing list