Simple wrapper package around MPDF's setProtection
method that allows you to set password on PDF files.
You can install the package via composer:
composer require owenoj/pdf-password-protect
You can use via Facade like so:
PDFPasswordProtect::encrypt(storage_path('pdf/document.pdf'),storage_path('pdf/'.'encrypted-documented.pdf'),'janedoe');
Encrypt method in detail
- $inputFile and $outputFile has to be a path like
storage_path("pdf/document.pdf")
PDFPasswordProtect::encrypt($inputFile,outputFile,$password)
The final file will be located in storage/pdf
as encrypted-document.pdf
composer test
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.
This package was generated using the Laravel Package Boilerplate.