NAME
CAM::PDF::Decrypt - PDF security helper
LICENSE
See CAM::PDF.
SYNOPSIS
use CAM::PDF;
my $pdf = CAM::PDF->new($filename);
DESCRIPTION
This class is used invisibly by CAM::PDF whenever it detects that a document is encrypted. See new(), getPrefs() and setPrefs() in that module.
FUNCTIONS
- new PDF, OWNERPASS, USERPASS, PROMPT
-
Create and validate a new decryption object. If this fails, it will set $CAM::PDF::errstr and return undef.
PROMPT is a boolean that says whether the user should be prompted for a password on the command line.
- decode_permissions FIELD
-
Given a binary encoded permissions string from a PDF document, return the four individual boolean fields as an array:
print boolean modify boolean copy boolean add boolean
- encode_permissions PRINT, MODIFY, COPY, ADD
-
Given four booleans, pack them into a single field in the PDF style that decode_permissions can understand. Returns that scalar.
- set_passwords OWNERPASS, USERPASS
- set_passwords OWNERPASS, USERPASS, PERMISSIONS
-
Change the PDF passwords to the specified values. When the PDF is output, it will be encrypted with the new passwords.
PERMISSIONS is an optional scalar of the form that decode_permissions can understand. If not specified, the existing values will be retained.
- encrypt STRING
-
Encrypt the scalar using the passwords previously specified.
- decrypt STRING
-
Decrypt the scalar using the passwords previously specified.
AUTHOR
Clotho Advanced Media Inc., cpan@clotho.com