PYPDF how to set restriction during pdf encryption

34 views Asked by At

When i use pymupdf, i can set restriction based on the criteria i needs by using command. refer below example :

Using PYMUPDF :

perm = (fitz.PDF_PERM_PRINT # permit printing )

but when i use pypdf, i only have one way to set restriction by using permission_flag. refer below example :

**Using PYPDF **

writer.encrypt(user_password='', owner_password=password, algorithm="AES-128", permissions_flag=0b0100, )

my question : is there any table or commands to use to set restriction for pypdf? can anyone share with me?

Thank you

I expect that pypdf allows to set pdf restriction using commands instead of permission flag. Hope that somebody can teach me. thanks

0

There are 0 answers