New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
permissions: calculation #473
Comments
according to this table
according to this table
so I should define I tried, but it not works like this , and, const (
PermissionPrint = 1 << 3
PermissionModifyDocContent = 1 << 4
PermissionCopyDocText = 1 << 5
PermissionModifyTextAnnotationsOrInteractiveForm = 1 << 6
PermissionFillExistsForm = 1 << 9
//..........
) and set permission like this |
The example from the spec turns on bits 3 and 5: 1111 1111 1101 0100 = -44 When you count the bit positions you start with 1 (not with 0). The example assumes security handler rev 2 so bits 9-12 are disregarded. In order to calculate specific permissions you just turn on the corresponding bits which will get you a two's complement binary integer for which you define the corresponding negative integer value in your code. It's all explained in the screenshot above. |
Please see the optimized |
YES
Linux
pdfcpu/pkg/pdfcpu/configuration.go
Lines 170 to 171 in 11d755a
I can only find 3 permission listed here
pdfcpu/pkg/pdfcpu/configuration.go
Lines 46 to 52 in 11d755a
But there is more permission bit listed here
https://pdfcpu.io/encrypt/perm_list.html#examples
How can I calc them myself ?
The text was updated successfully, but these errors were encountered: