Let poppler pick the font size when signing signature fields

Currently we use the default font sizes for NewSignatureData, which are 10 for fontSize and 20 for leftFontSize

This can be too large for a small signature field, leasing to cut-off text

When passing 0 poppler picks a suitable size depending on the size of the signature field

CCBUG: 443403
This commit is contained in:
Nicolas Fella 2024-04-03 19:29:24 +02:00
parent ee58e07e0f
commit 465b9ff5ce

View File

@ -463,5 +463,10 @@ bool PopplerFormFieldSignature::sign(const Okular::NewSignatureData &oData, cons
{
Poppler::PDFConverter::NewSignatureData pData;
PDFGenerator::okularToPoppler(oData, &pData);
#if POPPLER_VERSION_MACRO >= QT_VERSION_CHECK(24, 03, 0)
// 0 means "Chose an appropriate size"
pData.setFontSize(0);
pData.setLeftFontSize(0);
#endif
return m_field->sign(newPath, pData) == Poppler::FormFieldSignature::SigningSuccess;
}