承接 madnh/fpdi-protection 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

madnh/fpdi-protection

Composer 安装命令:

composer require madnh/fpdi-protection

包简介

Composer version of Setasign FPDI-Protection

README 文档

README

Composer version of Setasign FPDI-Protection and FPDF Protection script

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

Install

composer require madnh/fpdi-protection

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

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

$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.

统计信息

  • 总下载量: 13.68k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 5
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Setasign
  • 更新时间: 2016-06-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固