t-houssian / fillpdf

A python library to make filling pdfs much easier
MIT License
134 stars 23 forks source link

Fix flattening process to allow for additional field format options #52

Closed sachahu1 closed 6 months ago

sachahu1 commented 11 months ago

Several issues like #31 #39 are caused by the flattening process which is slightly too simplified. According to the PDF specifications, the field format ("/Ff") is a 32 bit integer where only the last bit is relevant to make a pdf read-only. By setting the entire field to 1 as is done here we are losing out on quite a lot of functionality.

This patch fixes these issues by only setting the read-only bit to 1 and leaving all the other bits as they are.

sachahu1 commented 11 months ago

@t-houssian Thanks for the great work, this is a nice package to work with. Are you happy to merge this fix?

t-houssian commented 6 months ago

Looks great! Thanks @sachahu1