Add possibility to adjust the font size for PDF form filling

Pratham Gandhi ppg.1382 at gmail.com
Wed Jul 24 10:08:49 BST 2024


Hey Andy,
I am already working on this. Will try to raise an MR for this by this or
next weekend. If you'd still like to take this up, I can share my progress
with you.
The same issue exists with combo box, list box, etc. Not sure, but some
change could be required on poppler end as well.

Cheers,
Pratham

On Wed, 24 Jul, 2024, 1:05 pm Andy Sardina, <andysardina22 at gmail.com> wrote:

> Cool!
>
> I’ll work on a PR and avoid sharing pointers between the two levels.
>
> On Wed, 24 Jul 2024 at 1:11 AM Albert Astals Cid <aacid at kde.org> wrote:
>
>> El dimarts, 23 de juliol del 2024, a les 12:46:59 (CEST), Andy Sardina va
>> escriure:
>> > Hi,
>> >
>> >    I have used Okular recently to fill a PDF form and I haven't found a
>> way
>> > (in the UI) to adjust the font size for text fields. This is a problem
>> > because for some text fields, specially the ones where one has to write
>> an
>> > address, even if the text fits perfectly in the Okular::FormLineEdit,
>> when
>> > it gets rendered, the text could be cut.
>> >
>> >  For example:
>> >
>> > [image: form-show.png]
>> >
>> > but when the form is hidden:
>> >
>> > [image: form-hidden.png]
>> >
>> > The problem seems to be that the font (and font size) for the
>> > Okular::FormLineEdit is different from the one in the Default Appearance
>> > (DA) in the PDF.
>> >
>> > My proposal is to take advantage of the method
>> > Poppler::FormFieldText::setTextFontSize to adjust the font size in
>> > the PopplerFormFieldText (Poppler Generator).
>> >
>> > Ideally, Poppler::FormFieldText could have a member function that
>> returns a
>> > pointer (to avoid duplicating the same object if many text files share
>> the
>> > same font) to
>> > the font defined in the DA (implies changes in Poppler itself). This
>> font
>> > can then be used on the constructor of Okular::FormLineEdit to "sync"
>> both
>> > fonts.
>> >
>> > What do you think? Is this a change that could be accepted?
>>
>> Setting the font & font size is possibly a valid feature, we do that
>> already
>> for annotations so i don't see why we would not do it for Forms.
>>
>> What you suggest of sharing pointers between poppler and okular, that's
>> possibly a bad idea.
>>
>> Cheers,
>>   Albert
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/okular-devel/attachments/20240724/7fbc608b/attachment.htm>


More information about the Okular-devel mailing list