-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Description
When looking at #2389, I stumbled upon some oddities about how PDF permissions are handled/exposed (#2389 (comment)):
- While we have
PdfReader.decode_permissions(introduced in ENH: Extract document permissions #320), we do not expose the corresponding permissions publicly, but only throughPdfReader._encryption.values. - It is a bit confusing to have both the
PdfReader._encryption.values.Permsand thePdfReader._encryption.Pattributes without any actual documentation.Permsis the permissions dictionary with permission handlers. Our code atandLine 1128 in 4423267
values.Perms = encryption_entry.get("/Perms", ByteStringObject()).original_bytes considers this as bytes instead? (PDF 1.7 section 8.7.3 "Permissions")Line 776 in 4423267
Perms: bytes Pis the actual permission integer value. (PDF 1.7 section 3.5.2 "Standard Security Handler")
I tend to argue that providing a human-readable public API for the P permissions might indeed make sense. Relying on PdfReader._encryption might work, but being an internal API, this is not guaranteed to reliably work in the future as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels