CAM::P...Decrypt(3pm)
β¨ NAME β¨
CAM::PDF::Decrypt β it's the PDF security helper bestie, the little backstage icon that handles all the locked-document drama π
π LICENSE π
See CAM::PDF. (that's the whole vibe, go read that one π«Ά)
πΈ SYNOPSIS πΈ
use CAM::PDF;
my $pdf = CAM::PDF->new($filename);
and that's literally it, that's the whole flex β¨
π¦ DESCRIPTION π¦
Okay so, bestie, listen: this class is used invisibly by CAM::PDF whenever it detects that a document is encrypted. Like, it does not want to be perceived, it's giving backstage crew at the Eras Tour π
If you wanna actually know what it's doing, go check out new(), getPrefs() and setPrefs() in that module. iykyk π
π FUNCTIONS π
$pkg->new($pdf, $ownerpass, $userpass, $prompt)β creates and validates a brand new decryption object β¨ If this fails (π) it will set$CAM::PDF::errstrand returnundef. Rude but fair.
$prompt is a boolean, and it's the one that decides whether the user should get prompted for a password on the command line. So like, do we ask them, or do we just go for it π«£
$self->decode_permissions($field)β hand it a binary encoded permissions string from a PDF document, and it hands you back the four individual boolean fields as an array π
print boolean
modify boolean
copy boolean
add boolean
four lil booleans, all lined up, slay π
$self->encode_permissions($print, $modify, $copy, $add)β give it four booleans and it packs them into a single field in the PDF style thatdecode_permissionscan understand. Returns that scalar. It's the reverse of the above, the remix π$self->set_passwords($doc, $ownerpass, $userpass)$self->set_passwords($doc, $ownerpass, $userpass, $permissions)β changes the PDF passwords to the values you specify π When the PDF is output, it will be encrypted with the new passwords. Glow-up complete β¨
PERMISSIONS is an optional scalar of the form that decode_permissions can understand. If you don't specify it, the existing values will be retained. No notes, we keep the old ones π
Note: we only support writing using encryption version 1, even though we can read encryption version 2 as well. So like, we're bilingual but we only speak one of them out loud, no cap π
$self->encrypt($doc, $string)β encrypts the scalar using the passwords previously specified π₯$self->decrypt($doc, $string)β decrypts the scalar using the passwords previously specified π
π AUTHOR π
See CAM::PDF π«Ά
mwah π that's the whole page. This lil gem is from perl v5.36.0, dated 2022-12-08, and it lives its life as CAM::P...Decrypt(3pm) in the User Contributed Perl Documentation. bye bestie, go encrypt something responsibly πβ¨
π¦ where this page comes from
- debian bookworm: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcam-pdf-perl 1.60-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms