PHPackages                             lpuissantberger/fpdi-protection - 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. lpuissantberger/fpdi-protection

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

lpuissantberger/fpdi-protection
===============================

Composer version of Setasign FPDI-Protection

1.1.2(8y ago)027PHPPHP &gt;=5.3.0

Since Jun 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/lpuissantberger/FPDI-Protection)[ Packagist](https://packagist.org/packages/lpuissantberger/fpdi-protection)[ Docs](https://github.com/lpuissantberger/FPDI-Protection)[ RSS](/packages/lpuissantberger-fpdi-protection/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

FPDI-Protection
===============

[](#fpdi-protection)

Composer version of [Setasign FPDI-Protection](https://www.setasign.com/products/fpdi/downloads/) and [FPDF Protection script](http://www.fpdf.org/en/script/script37.php)

This script allows to protect the PDF, that is to say prevent people from copying its content, print it or modify it.

Install
-------

[](#install)

```
composer require lpuissantberger/fpdi-protection

```

USAGE
-----

[](#usage)

```
SetProtection([array permissions [, string user_pass [, string owner_pass]]])

```

- permissions: the set of permissions. Empty by default (only viewing is allowed).
- user\_pass: user password. Empty by default.
- owner\_pass: owner password. If not specified, a random value is used.

### Permissions

[](#permissions)

The permission array contains values taken from the following list:

- **FPDI\_Protection::CAN\_PRINT**: print the document
- **FPDI\_Protection::CAN\_MODIFY**: modify it (except for annotations and forms)
- **FPDI\_Protection::CAN\_COPY**: copy text and images to the clipboard
- **FPDI\_Protection::CAN\_ANNOT\_FORMS**: add annotations and forms

Example
-------

[](#example)

```
$src_file = 'source.pdf';
$dest_file = 'protected.pdf';

$pdf = new \FPDI_Protection();
$pagecount = $pdf->setSourceFile($src_file);

for ($loop = 1; $loop importPage($loop);
    $pdf->addPage();
    $pdf->useTemplate($tplidx);
}

$pdf->SetProtection(\FPDI_Protection::FULL_PERMISSIONS);
//$pdf->SetProtection(\FPDI_Protection::FULL_PERMISSIONS, '123456');
//$pdf->SetProtection(\FPDI_Protection::FULL_PERMISSIONS, '123456', 'ABCDEF');

$pdf->Output($dest_file, 'F');
```

IMPORTANT
=========

[](#important)

Some PDF readers like Firefox ignore the protection settings, which strongly reduces the usefulness of this script.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~218 days

Total

4

Last Release

2952d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/559444e773e1e5ac4e1cff080dfa312f677ca1d836b360f475a400a7a0e984e1?d=identicon)[Maleas](/maintainers/Maleas)

---

Top Contributors

[![madnh](https://avatars.githubusercontent.com/u/8559855?v=4)](https://github.com/madnh "madnh (4 commits)")[![lpuissantberger](https://avatars.githubusercontent.com/u/7994112?v=4)](https://github.com/lpuissantberger "lpuissantberger (2 commits)")

---

Tags

pdffpdifpdi-protection

### Embed Badge

![Health badge](/badges/lpuissantberger-fpdi-protection/health.svg)

```
[![Health](https://phpackages.com/badges/lpuissantberger-fpdi-protection/health.svg)](https://phpackages.com/packages/lpuissantberger-fpdi-protection)
```

###  Alternatives

[mpdf/mpdf

PHP library generating PDF files from UTF-8 encoded HTML

4.7k77.1M493](/packages/mpdf-mpdf)[setasign/fpdi

FPDI is a collection of PHP classes facilitating developers to read pages from existing PDF documents and use them as templates in FPDF. Because it is also possible to use FPDI with TCPDF, there are no fixed dependencies defined. Please see suggestions for packages which evaluates the dependencies automatically.

1.2k142.4M231](/packages/setasign-fpdi)[setasign/fpdi-protection

A FPDI compatible version of the FPDF\_Protection script.

324.3M2](/packages/setasign-fpdi-protection)[bithost-gmbh/pdfviewhelpers

This is a TYPO3 CMS extension that provides various Fluid ViewHelpers to generate PDF documents.

45242.7k2](/packages/bithost-gmbh-pdfviewhelpers)

PHPackages © 2026

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