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

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

madnh/fpdi-protection
=====================

Composer version of Setasign FPDI-Protection

1.0.6(9y ago)513.0k↓32.1%6[2 issues](https://github.com/madnh/FPDI-Protection/issues)Setasign FPDI-ProtectionPHPPHP &gt;=5.3.0

Since Jun 28Pushed 9y ago1 watchersCompare

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

READMEChangelog (1)Dependencies (1)Versions (2)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 madnh/fpdi-protection

```

USAGE
-----

[](#usage)

```
SetProtection([number 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

32

—

LowBetter than 72% of packages

Maintenance12

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

3612d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8559855?v=4)[Đỗ Danh Mạnh](/maintainers/madnh)[@madnh](https://github.com/madnh)

---

Top Contributors

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

---

Tags

pdffpdifpdi-protection

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/madnh-fpdi-protection/health.svg)](https://phpackages.com/packages/madnh-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)
