Document Permissions #2836
-
Hello, I am trying to set the document permissions at saving. I have found the different macro here. I would like to enable printing with Thank you for your help 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
"Permisions" is an integer representing a bit field. You should start with a bit that always must be on, perm = fitz.PDF_PERM_ACCESSIBILITY | fitz.PDF_PERM_PRINT | fitz.PDF_PERM_PRINT_HQ
doc.save(.., permissions=perm) This leaves the other 5 possible permission bits off. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
The situation is a bit ambiguous - I am sure you are aware.
First of all I forgot to mention that the save must include encrypting the file (with an owner pw and no user pw).
Then accessing the properties with e.g. Foxit Reader shows this:
In my Adobe Acrobat and Foxit, I can still mark text on the page and press the -copy key, but nothing in effect will be copied.
So a PDF viewer must be so kind and comply: my SumatraPDF for example still copies stuff!