With zenphi, you can automate different manipulations with PDF files you usually do manually. Here is the overview of all the PDF Actions available to you at the moment:
1. Convert HTML to PDF
Usage
The ‘Convert HTML to PDF’ action enables converting a specified HTML document/markup to a PDF file.
Fields
Section | Field Name | Input Type | Description | Token Picker Support | Mandatory |
HTML Content | HTML Content | Text or Token | The HTML code that needs to be converted. | ✅ | ✅ |
Output Document | File Name | Text or Token | The name of the generated PDF | ✅ | ✅ |
| Password Protect | Boolean/ Toggle | Setting a password to open the document. The generated PDF will be password protected. | ❌ | ❌ |
| Enable Document Restriction | Boolean/ Toggle | Sets printing & copying/ pasting restrictions for the generated PDF. | ❌ | ❌ |
2. Merge Documents
Usage
The ‘Merge Documents’ action enables merging or combining multiple PDF files into one PDF document.
Fields
Section | Field Name | Input Type | Description | Token Picker Support | Mandatory |
Source Documents | Documents | Text or Token | One or more PDF documents that need to be merged. | ✅ | ✅ |
Password | Password | Text or Token | The password of the source PDF document. If the source PDF is not password protected, this field should leave blank. | ✅ | ❌ |
Output Document | File Name | Text or Token | The name of the final PDF document. | ✅ | ✅ |
| Password Protect | Boolean/Toggle | Setting a password to open the document. The generated PDF will be password protected. | ❌ | ❌ |
| Enable Document Restriction | Boolean/Toggle | Sets printing & copying/pasting restrictions for the generated PDF. | ❌ | ❌ |
3. Extract Pages
Usage
The ‘Extract Pages’ action enables extracting one or multiple pages from specified PDF document(s) and generates a new PDF file.
Fields
Section | Field Name | Input Type | Description | Token Picker Support | Mandatory |
Source Document | PDF Document | Text or Token | One or more PDF documents to extract pages.
| ✅ | ✅ |
| Password | Text or Token | The password of the source PDF document. If the source PDF is not password protected, this field should leave blank. | ✅ | ❌ |
Mode | Mode | Dropdown | Two modes are supported.
1. Extract Specific Page Number(s) - The specified page numbers will only be extracted.
2. Extract a Range of Pages - All the pages in the given range will be extracted. |
❌ |
✅ |
| Page Number(s) | Number or Token | The number(s) of the page(s) that need to be extracted. This field displays only when the ‘Extract Specific Page Number(s)’ option is selected in the dropdown. | ✅ | ✅ |
| Start Page Number | Number or Token | The start page number of the range. This field displays only when the ‘Extract a Range of Pages’ option is selected in the dropdown. | ✅ | ✅ |
| End Page Number | Number or Token | The end page number of the range. This field displays only when the ‘Extract a Range of Pages’ option is selected in the dropdown. |
✅ |
✅ |
Output Document | File Name | Text or Token | The name of the final PDF document. | ✅ | ✅ |
| Password Protect | Boolean/Toggle | Setting a password to open the document. The generated PDF will be password protected. | ❌ | ❌ |
| Enable Document Restriction | Boolean/Toggle | Sets printing & copying/pasting restrictions for the generated PDF. | ❌ | ❌ |
4. Update Security Settings
Usage
The ‘Merge Documents’ action enables merging or combining multiple PDF files into one PDF document.
Fields
Section | Field Name | Input Type | Description | Token Picker Support | Mandatory |
Source Documents | Documents | Text or Token | One or more PDF documents that need to be merged. | ✅ | ✅ |
| Password | Text or Token | The password of the source PDF document. If the source PDF is not password protected, this field should leave blank. | ✅ | ❌ |
Output Document | File Name | Text or Token | The name of the final PDF document. | ✅ | ✅ |
| Password Protect | Boolean/ Toggle | Setting a password to open the document. The generated PDF will be password protected. | ❌ | ❌ |
| Enable Document Restriction | Boolean/ Toggle | Sets printing & copying/pasting restrictions for the generated PDF. | ❌ | ❌ |
Use Case
In the following example, we will implement a workflow to create a PDF, manipulate the PDF in different ways, and finally send an email by attaching the generated PDF document.
First, we will convert two given HTML sources to PDF documents. Then, the two PDFs will combine into one PDF document. Furthermore, the generated PDF file from the previous step will be used to extract a page and create a new PDF document that we will use in the next step in the workflow. Finally, the generated PDF document’s security settings will be set to password protected. In addition, we will attach the password-protected PDF file to an email and send it to a specified recipient.
Step 01
Drag and drop the ‘Convert HTML to PDF’ action located in the PDF section as shown in the following.
Click on the settings icon of the ‘Convert HTML to PDF’ action that displays the properties associated with this action item.
In the Settings tab, the ‘HTML Content’ and ‘File Name’ fields are mandatory. The HTML source code and the name of the final PDF document can be specified in the ‘HTML Content’ and ‘File Name’ fields respectively.
In this example, we create two PDF documents out of two HTML scripts. Hence, the 'Convert HTML to PDF' action will be added again in the next step.
The names of the generated PDF documents from the first and second actions are ‘first-document’ and ‘second-document’.
Step 02
Drag and drop the ‘Merge Documents’ action located in the PDF category. In this step, we are going to combine the first-document.pdf and second-document.pdf files into one PDF document.
Let’s edit the properties of the ‘Merge Documents’ action as follows.
The ‘Documents’ and ‘File Name’ fields are mandatory. In the ‘Documents’ field, we should specify the two PDF documents that we are going to merge. Since this field accepts PDF documents as tokens, we click on the insert token button on the right side.
From there, the PDF Document tokens can be added and these will appear as a collection of source PDF documents in the ‘Documents’ field as follows.
The generated PDF document name is specified as the ‘merge-document’ as shown in the following.
The ‘merge-document.pdf’ will contain two pages.
Step 03
Since we already have a PDF with two pages from the earlier steps, Let’s extract one page out of the two pages using the ‘Extract Pages’ action located in the PDF category.
Let’s drag and drop the ‘Extract Pages’ action as follows.
Next, we will edit the settings of this action as shown in the following.
The ‘PDF Document’ field can be used to specify the source PDF document which is the merge-document.pdf coming from the earlier step of the workflow. It can be inserted as a token from the previous step’s output.
The Mode section determines the form to extract pages from the source PDF. In this example, we have used the ‘Extract Specific Page Number(s)’ option where the provided page numbers will be used to extract pages. On the other hand, a range of pages can be specified with the 'Extract a Range of Pages' option. In this example, we extract only the second page of the ‘merge-document.pdf’.
Furthermore, the generated PDF document name will be ‘extracted-doc’ as follows.
Step 04
The ‘extracted-doc.pdf’ file that has been generated in the earlier step will be used as the source document in the ‘Update Security Settings’ action. Let’s drag and drop the ‘Update Security Settings’ actions as shown in the following.
We will make the ‘extracted-doc.pdf’ document a password-protected PDF. In the settings, the ‘PDF Document’ field is used to specify the source document for this action. In this example, we will provide the generated PDF from the earlier step as a token.
In addition, to make it password protected, the ‘Password Protected’ toggle has to be enabled and specify a password in the ‘User Password’ field as follows.
Step 05
Finally, the password-protected document generated from the earlier step will be attached to an email and sent to a recipient. We use the ‘Send Email(Gmail)’ action to send an email with the attachment as follows.
If you have any questions, do not hesitate to ping us in chat! We'll be happy to assist 😊
Learn more
Follow us on Social Media to receive our latest process automation tips and best practices: