fpdm icon indicating copy to clipboard operation
fpdm copied to clipboard

Need Readonly PDF

Open johndave8116 opened this issue 7 years ago • 6 comments

Hello Team,

Your code and this library is perfect and awesome - I really liked it. But I have only one concern - once the data is merged into the PDF - I want the final PDF but not in Editable mode. Is it possible? If Yes then please let me know how. Really Appreciate your earliest reply.

Thank you.

johndave8116 avatar Apr 11 '18 11:04 johndave8116

I was looking for the very same thing. Currently I am using FPDI to do this, but the problem is that when you change the form, you have to painstakingly go through the coordinates. Being able just to pass an array and have it produce an uneditable file would be great.

judodan avatar Oct 19 '18 00:10 judodan

Same problem here, some solution for that?

mgip avatar May 27 '20 20:05 mgip

All that's needed is a flag added to the field: /Ff 1 . See PDF Reference

There's a lot of repeated code for calculating the offset which could probably be consolidated into a single method. But for this feature, would it be enough to be able to pass a "read_only" option when merging or setting a field's value?

imclean557 avatar Jun 05 '20 01:06 imclean557

#31

imclean557 avatar Jun 05 '20 03:06 imclean557

Adding support in the linked PR might help move things along. Does it work for you?

imclean557 avatar Oct 28 '20 00:10 imclean557

I was able to accomplish this simply by using readonly pdf form. Using something like https://www.pdfescape.com you can edit your form, right click on every field and in setting set it as read-only. If you use that template, values will then be added in it and will not be editable. OFC in my case i had to run template through pdftk before I could use it with script.

Don't know your exact usage and process, but give it a try, maybe it will work for you too s181

BeRightBaack avatar Dec 20 '21 13:12 BeRightBaack