Repository navigation
Document Permissions #2836
Answered
by
JorjMcKie
claudinecombe
asked this question in
Q&A
|
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 🙏 |
Answered by
JorjMcKie
Nov 23, 2023
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. |
0 replies
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


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!