Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owen-oj/pdf-password-protect
Laravel package to password-protect all pages in PDFs.
https://github.com/owen-oj/pdf-password-protect
laravel laravel-pdf laravel-pdf-password laravel-pdf-password-protect laravel9 password-protect-pdf pdf pdf-encryption pdf-password protect-pdfs
Last synced: 2 days ago
JSON representation
Laravel package to password-protect all pages in PDFs.
- Host: GitHub
- URL: https://github.com/owen-oj/pdf-password-protect
- Owner: Owen-oj
- License: mit
- Created: 2021-02-25T17:49:11.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-12T18:07:34.000Z (7 months ago)
- Last Synced: 2024-09-23T16:32:50.329Z (3 days ago)
- Topics: laravel, laravel-pdf, laravel-pdf-password, laravel-pdf-password-protect, laravel9, password-protect-pdf, pdf, pdf-encryption, pdf-password, protect-pdfs
- Language: PHP
- Homepage:
- Size: 267 KB
- Stars: 3
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Laravel PDF Password Protect
[![Latest Version on Packagist](https://img.shields.io/packagist/v/owenoj/pdf-password-protect.svg?style=flat-square)](https://packagist.org/packages/owenoj/pdf-password-protect)
[![Total Downloads](https://img.shields.io/packagist/dt/owenoj/pdf-password-protect.svg?style=flat-square)](https://packagist.org/packages/owenoj/pdf-password-protect)Simple wrapper package around MPDF's `setProtection` method that allows you to set password on PDF files.
[!["Buy Me A Coffee"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/kkoj)
## Installation
You can install the package via composer:
```bash
composer require owenoj/pdf-password-protect
```## Usage
You can use via Facade like so:
```php
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`
### Testing
```bash
composer test
```### Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.
## Contributing
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
### Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
## Credits
- [Owen Jubilant](https://github.com/owen-oj)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
## Laravel Package Boilerplate
This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).