2017 © Pedro Peláez
 

library fpdi-protection

Composer version of Setasign FPDI-Protection

image

lpuissantberger/fpdi-protection

Composer version of Setasign FPDI-Protection

  • Friday, April 13, 2018
  • by Maleas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

FPDI-Protection

Composer version of Setasign FPDI-Protection and FPDF Protection script, (*1)

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

Install

composer require lpuissantberger/fpdi-protection

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

The permission array contains values taken from the following list:, (*3)

  • 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

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

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

for ($loop = 1; $loop <= $pagecount; $loop++) {
    $tplidx = $pdf->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

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

The Versions

13/04 2018

dev-master

9999999-dev https://github.com/lpuissantberger/FPDI-Protection

Composer version of Setasign FPDI-Protection

  Sources   Download

The Requires

 

pdf fpdi fpdi-protection

13/04 2018

1.1.2

1.1.2.0 https://github.com/lpuissantberger/FPDI-Protection

Composer version of Setasign FPDI-Protection

  Sources   Download

The Requires

 

pdf fpdi fpdi-protection

13/04 2018

1.1.1

1.1.1.0 https://github.com/lpuissantberger/FPDI-Protection

Composer version of Setasign FPDI-Protection

  Sources   Download

The Requires

 

pdf fpdi fpdi-protection

13/04 2018

1.1

1.1.0.0 https://github.com/lpuissantberger/FPDI-Protection

Composer version of Setasign FPDI-Protection

  Sources   Download

The Requires

 

pdf fpdi fpdi-protection

28/06 2016

1.0.6

1.0.6.0 https://github.com/madnh/FPDI-Protection

Composer version of Setasign FPDI-Protection

  Sources   Download

Setasign FPDI-Protection

The Requires

 

pdf fpdi fpdi-protection