PHP code example of tecnickcom / tc-lib-pdf-encrypt
1. Go to this page and download the library: Download tecnickcom/tc-lib-pdf-encrypt library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ss the encryption dictionary produced by the Encrypt instance.
$decrypt = new \Com\Tecnick\Pdf\Encrypt\Decrypt($encrypt->getEncryptionData());
if ($decrypt->authenticate('userpassword')) {
$plain = $decrypt->decryptString($cipher, $objectNumber = 1);
// For AES modes the output is zero-padded to the block size;
// trim trailing null bytes when the original was not block-aligned.
echo rtrim($plain, "\x00");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.