Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write_fill_pdf flatten parameter now preserves multiline edit fields #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

josevenceslau
Copy link

write_fill_pdf flatten option must set first bit of /Ff field but must preserve the other bits.

Form fields with multiline option (bitmask 4096) where being transformed into single line by setting /Ff to 1, this patch preserves the Ff bit mask if fields any form field has multiple line bit set.

See https://stackoverflow.com/questions/68119744/python-how-to-properly-fill-a-multiline-text-field-in-pdf-form-using-pdfrw and https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.4.pdf, page 552 for a description of /Ff bitmask

write_fill_pdf flatten option must set first bit of /Ff field but must preserve the other bits.
Form fields with multiline option (bitmask 4096) where being transformed into single line
by setting /Ff to 1.
See https://stackoverflow.com/questions/68119744/python-how-to-properly-fill-a-multiline-text-field-in-pdf-form-using-pdfrw
and https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.4.pdf, page 552 for a
description of /Ff bitmask
Additional field in write_fillable_pdf has addition fontinfo parameter.

None by default, uses PDF DA format, as example 'Arial 8.00 Tf 0 g' and changes the
edit fields to this font, instead of the font present in the pdf template.
@t-houssian t-houssian self-requested a review May 3, 2024 17:55
Copy link
Owner

@t-houssian t-houssian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I just pulled in another PR that I believe has fixed part of this. If you could edit the PR to just have the fontinfo part and fix the merge conflict I can merge this in! @josevenceslau

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants