Home > Backend Development > PHP Tutorial > PHP generates PDF format files and encrypts them_PHP tutorial

PHP generates PDF format files and encrypts them_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 09:49:07
Original
1410 people have browsed it

php generates PDF format files and encrypts them

This article will introduce to you how to use php to generate pdf files, and encrypt the files or set access passwords, if necessary Friends can refer to it.

Project requirements: PHP generates pdf files, and encrypts the files or sets access passwords

The open source TCPDF is a set of class libraries based on PHP, which can generate documents in PDF format very well. It also supports file encryption and is widely used in current open source PHP frameworks, systems, and applications. Here is the method prototype for setting the relevant properties of a PDF document, in which you can set a password

 ?

1

2

3

4

5

6

7

8

TCPDF::SetProtection

(

$permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'),

$user_pass = '',

$owner_pass = null,

$mode = 0,

$pubkeys = null

)

1

2 3

45 6 7 8
TCPDF::SetProtection ( $permissions = array('print', 'modify', 'copy', 'annot-forms', 'fill-forms', 'extract', 'assemble', 'print-high'),
$user_pass = '', $owner_pass = null, $mode = 0, $pubkeys = null )
After setting through the SetProtection() method, the generated PDF document is encrypted, and the user will be asked to enter the access password when opening the PDF document http://www.bkjia.com/PHPjc/1020280.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1020280.htmlTechArticlephp generates PDF format files and encrypts them. This article introduces how to use php to generate pdf files and encrypt the files. For methods of encrypting or setting access passwords, friends in need can refer to...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template