New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

owenoj/pdf-password-protect

Laravel package to password protect pdfs
4,299 3
Install
composer require owenoj/pdf-password-protect
Latest Version:v0.9
PHP:^7.4|^8.0
Laravel:8 – 12
Older releases:6 · 7
License:MIT
Last Updated:May 12, 2025
Links: GitHub  ·  Packagist
Maintainer: Owen-oj

Laravel PDF Password Protect

Latest Version on Packagist Total Downloads

Simple wrapper package around MPDF's setProtection method that allows you to set password on PDF files.

"Buy Me A Coffee"

Installation

You can install the package via composer:

composer require owenoj/pdf-password-protect

Usage

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

Testing

composer test

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email owen.j@terktrendz.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

Laravel Package Boilerplate

This package was generated using the Laravel Package Boilerplate.

Related Packages

doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

660,512,042 9,702
laravel/framework

The Laravel Framework.

617,629,957 34,997
laravel/tinker

Powerful REPL for the Laravel framework.

524,145,802 7,444
laravel/serializable-closure

Laravel Serializable Closure provides an easy and secure way to serialize closur...

442,489,569 607
nunomaduro/collision

Cli error handling for console/command-line PHP applications.

418,503,470 4,663

Version History

Version Released PHP Laravel License
v0.9 ^7.4|^8.0 ^8.0|^9.0|^10.0|^11.0|^12.0 MIT
v0.8 ^7.4|^8.0 ^8.0|^9.0|^10.0|^11.0 MIT
v0.7 ^7.4|^8.0 ^8.0|^9.0|^10.0 MIT
v0.6 ^7.4|^8.0 ^7.0|^8.0|^9.0 MIT
v0.5 ^7.4|^8.0 ^7.0|^8.0|^9.0 MIT