PHPackages                             owenoj/pdf-password-protect - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [PDF &amp; Document Generation](/categories/documents)
4. /
5. owenoj/pdf-password-protect

ActiveLibrary[PDF &amp; Document Generation](/categories/documents)

owenoj/pdf-password-protect
===========================

Laravel package to password protect pdfs

v0.9(1y ago)32.9k↓40%2MITPHPPHP ^7.4|^8.0

Since Sep 27Pushed 1y ago1 watchersCompare

[ Source](https://github.com/Owen-oj/pdf-password-protect)[ Packagist](https://packagist.org/packages/owenoj/pdf-password-protect)[ Docs](https://github.com/owen-oj/pdf-password-protect)[ RSS](/packages/owenoj-pdf-password-protect/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (4)Versions (12)Used By (0)

Laravel PDF Password Protect
============================

[](#laravel-pdf-password-protect)

[![Latest Version on Packagist](https://camo.githubusercontent.com/ebb7a4ae851d2902e2c54327ac8ccb6bc14401dbab548eb73dda2e4ae7cccc53/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f77656e6f6a2f7064662d70617373776f72642d70726f746563742e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/owenoj/pdf-password-protect)[![Total Downloads](https://camo.githubusercontent.com/cbabf091bbaa1b83fabe8f63f858453919d76eba20bd7d4249340e3924972b7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6f77656e6f6a2f7064662d70617373776f72642d70726f746563742e7376673f7374796c653d666c61742d737175617265)](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://camo.githubusercontent.com/9f44ce2dc3b3eecdd02598900866ffc518801df1932849703dae1e5ce5031070/68747470733a2f2f7777772e6275796d6561636f666665652e636f6d2f6173736574732f696d672f637573746f6d5f696d616765732f6f72616e67655f696d672e706e67)](https://www.buymeacoffee.com/kkoj)

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require owenoj/pdf-password-protect
```

Usage
-----

[](#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

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

### Security

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Owen Jubilant](https://github.com/owen-oj)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

Laravel Package Boilerplate
---------------------------

[](#laravel-package-boilerplate)

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance49

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~165 days

Recently: every ~290 days

Total

9

Last Release

372d ago

PHP version history (2 changes)v0.1PHP ^7.3

v0.2PHP ^7.4|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/696072a2631e412e7034cdffb063a41ea7754c8a719e66cfed044004a9ac5d10?d=identicon)[Owen-oj](/maintainers/Owen-oj)

---

Top Contributors

[![Owen-oj](https://avatars.githubusercontent.com/u/13623015?v=4)](https://github.com/Owen-oj "Owen-oj (26 commits)")

---

Tags

laravellaravel-pdflaravel-pdf-passwordlaravel-pdf-password-protectpassword-protect-pdfpdfpdf-encryptionpdf-passwordprotect-pdfsowenojpdf-password-protectpdf protectionpdf passwordlaravel pdf passwordlaravel pdf protect

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/owenoj-pdf-password-protect/health.svg)

```
[![Health](https://phpackages.com/badges/owenoj-pdf-password-protect/health.svg)](https://phpackages.com/packages/owenoj-pdf-password-protect)
```

###  Alternatives

[maatwebsite/excel

Supercharged Excel exports and imports in Laravel

12.7k144.3M712](/packages/maatwebsite-excel)[barryvdh/laravel-dompdf

A DOMPDF Wrapper for Laravel

7.3k87.6M278](/packages/barryvdh-laravel-dompdf)[barryvdh/laravel-snappy

Snappy PDF/Image for Laravel

2.8k24.8M48](/packages/barryvdh-laravel-snappy)[elibyy/tcpdf-laravel

tcpdf support for Laravel 6, 7, 8, 9, 10, 11

3542.7M5](/packages/elibyy-tcpdf-laravel)[stevebauman/autodoc-facades

Auto-generate PHP doc annotations for Laravel facades

98186.6k9](/packages/stevebauman-autodoc-facades)[lukasss93/laravel-larex

Translate your Laravel application from a single CSV file!

9790.3k2](/packages/lukasss93-laravel-larex)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
