PdfEncrypt
in package
FinalYes
Apply, change, or remove encryption on existing PDFs.
Usage: PdfEncrypt::open('doc.pdf') ->encrypt('user', 'owner', EncryptionMethod::Aes256) ->save('encrypted.pdf');
PdfEncrypt::open('encrypted.pdf', 'password') ->decrypt() ->save('decrypted.pdf');
Table of Contents
Methods
- changePasswords() : self
- decrypt() : self
- encrypt() : self
- getPageCount() : int
- getReader() : PdfReader
- getVersionWarnings() : array<int, string>
- isEncrypted() : bool
- open() : self
- openString() : self
- save() : void
- setPermissions() : self
- toBytes() : string
Methods
changePasswords()
public
changePasswords(string $newUserPassword, string $newOwnerPassword) : self
Parameters
- $newUserPassword : string
- $newOwnerPassword : string
Return values
selfdecrypt()
public
decrypt() : self
Return values
selfencrypt()
public
encrypt(string $userPassword, string $ownerPassword[, EncryptionMethod $method = EncryptionMethod::Aes256 ][, int $permissions = Permission::ALL ]) : self
Parameters
- $userPassword : string
- $ownerPassword : string
- $method : EncryptionMethod = EncryptionMethod::Aes256
- $permissions : int = Permission::ALL
Return values
selfgetPageCount()
public
getPageCount() : int
Return values
intgetReader()
public
getReader() : PdfReader
Return values
PdfReadergetVersionWarnings()
public
getVersionWarnings() : array<int, string>
Return values
array<int, string>isEncrypted()
public
isEncrypted() : bool
Return values
boolopen()
public
static open(string $path[, string $password = '' ]) : self
Parameters
- $path : string
- $password : string = ''
Return values
selfopenString()
public
static openString(string $pdfBytes[, string $password = '' ]) : self
Parameters
- $pdfBytes : string
- $password : string = ''
Return values
selfsave()
public
save(string $path) : void
Parameters
- $path : string
setPermissions()
public
setPermissions(int $permissions) : self
Parameters
- $permissions : int
Return values
selftoBytes()
public
toBytes() : string