PHP generates PDF files and encrypts _php tutorials

Source: Internet
Author: User
Tags php framework

PHP generates PDF files and encrypts


This article is to introduce how to use PHP to generate PDF files, and the file encryption or set access password method, the need for small partners to refer to.

Project requirements: PHP generates a PDF file and encrypts or sets the access password for the file

The open source tcpdf is a PHP-based class library that is able to produce PDF documents in a very good format. and support file encryption, in the current open source PHP framework, systems, applications are also widely used. Here is a method prototype that sets the relevant properties of the PDF document, where you can set the 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

)

After the Setprotection () method is set, the resulting PDF document is encrypted, and the user is asked to enter the access password when the PDF document is opened.

http://www.bkjia.com/PHPjc/1020280.html www.bkjia.com true http://www.bkjia.com/PHPjc/1020280.html techarticle PHP generate PDF file and encrypt this article is to introduce how to use PHP to generate PDF files, and the file to encrypt or set the way to access the password, the need for small partners can participate ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.