XmlApi - pdx:encryptPDF

pdx:encryptPDF

Encrypts a PDF file.

Description

Element definition

This element allows to encrypt a PDF file. The final user will be prompted to introduce the password included in the $options array to access the contents of the resulting PDF file.

You may find a detailed description of this package in the cryptophpdocx section of the API documentation.

Attributes and sub-elements

src

Path to the PDF document that you want to encrypt.

target

Path to the resulting encrypted PDF document.

options

The possible keys and values are (required options are shown with red background):

Key Description
password String of 15 or less characters
mode
  • 0, RSA 40 bit;
  • 1, RSA 128 bit;
  • 2, AES 128 bit;
  • 3, AES 256 bit
  • Optional
  • default 0
Code samples

Example #1

config.xml

content.xml

settings.xml

PHP code

The resulting Word document looks like: