pdfEncryptSecure Step
Description:
The PDF Encrypt Secure step enables a FlowWright workflow to encrypt an existing PDF document and apply password-based security.
Organizations frequently exchange documents that contain confidential, financial, legal, or regulated information. This step automates the process of securing PDF documents by applying encryption, defining user and owner passwords, and saving the protected document as a new PDF file.
The workflow specifies the source PDF document, the user password, the owner password, the encryption type, the output file location, and the FlowWright virtual file path associated with the secured document.
Typical uses include:
- Protecting confidential business documents
- Securing financial reports
- Encrypting legal agreements
- Distributing password-protected invoices
- Protecting customer records
- Securing HR and payroll documents
- Protecting engineering documentation
- Supporting regulatory and compliance requirements
This step helps organizations automate PDF security while ensuring that sensitive documents remain protected throughout their lifecycle.
Inputs
- Input File Path - Specifies the full path of the PDF document that will be encrypted.
- User Password - Specifies the password required to open the encrypted PDF document.
- Owner Password - Specifies the password used to manage document permissions and ownership settings.
- Encryption Type - Specifies the encryption method that will be applied to secure the PDF document. The available options are determined by the configured PdfEncryptionType data type.
- Output File Path – Specifies the location where the encrypted PDF document will be saved.
- PDF Virtual File Path – Specifies the FlowWright virtual file path associated with the encrypted PDF document for use by subsequent workflow activities.
Returns
- True – The PDF document was successfully encrypted and saved to the specified output location. Workflow execution continues through the success path.
- False – The encryption process could not be completed because of an invalid input file, invalid password configuration, inaccessible output location, unsupported encryption type, or another execution error. Workflow execution follows the alternate path.
Usage:
The PDF Encrypt Secure step is typically used after a PDF document has been generated or modified and before it is distributed, archived, or transferred to external users.
During execution:
- Read the configured input PDF file.
- Read the user password and owner password.
- Apply the selected encryption type.
- Encrypt the PDF document.
- Save the encrypted document to the configured output location.
- Associate the document with the configured PDF virtual file path.
- Continue workflow execution through either the True or False return path.
A typical workflow might look like this:

Typical workflow scenarios include:
- Encrypting payroll reports before distribution
- Securing customer invoices
- Protecting confidential legal contracts
- Encrypting medical records before archival
- Securing engineering specifications
- Protecting financial statements
- Preparing documents for secure customer download
Example:
Let’s build and execute the “pdfEncryptSecureDef” example.
- Create a new process definition named “pdfEncryptSecureDef” and open it in Designer mode.
- Drag the “pdfEncryptSecure” step to the canvas.
- Connect the dots between the “Start” step and the “pdfEncryptSecure” step, as shown above.
- Define a variable or a global variable to store the file path.
- Click the "pdfEncryptSecure" step to configure its "Required" properties. Provide a name for the step. Provide the source file path on the application server. Provide the user and owner passwords. Select one of the encryption types (AESx128, AESx192, AESx256). Provide variable references to hold the Output and Virtual PDF file paths. Click the Save button. Note: Click the "AI Predict" button to have Copilot add new process steps that match your process description.

- The “Logging” configuration setting is necessary for documentation and for tracking workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure the “Logging” using the following properties.

- Save the process definition, create a new instance, and execute it. Render the process instance. Click the “pdfEncryptSecure” process step to view its properties. The step creates a copy of the PDF with encryption and security features using a security algorithm and passwords. Copy and paste the “pdfVirtualPath” variable value into a browser window to view the secured PDF file.
Tips:
- Use strong user and owner passwords that comply with your organization's security policies.
- Store passwords securely and avoid hard-coding them into workflow definitions.
- Select an encryption type that satisfies your organization's security and compliance requirements.
- Retain an unencrypted copy only when business or regulatory requirements permit.
- Verify that the output location has appropriate write permissions.
- Configure the PDF virtual file path when downstream FlowWright workflow steps need to reference the encrypted document.
- Route the False path to logging or notification activities for easier troubleshooting.
- Combine this step with PDF Optimize File, PDF Flatten File, Redact PDF, PDF Validate Standard, or Send Email to build secure end-to-end document processing workflows.
Notes:
- A valid input PDF file is required.
- Both the User Password and Owner Password must be configured.
- An encryption type must be selected before execution.
- The output file path must reference a writable location.
- The encrypted PDF is saved to the configured output location.
- The configured PDF virtual file path enables subsequent FlowWright workflow activities to reference the secured document.
- Both the True and False return paths should be implemented to provide complete workflow handling.
- Execution details and PDF encryption activities are recorded in the FlowWright workflow execution log.
PDF Encrypt Secure vs. PDF Optimize File:
Both workflow steps process PDF documents, but they serve different business purposes.
| PDF Encrypt Secure | PDF Optimize File |
|---|---|
| Encrypts a PDF document using passwords and a selected encryption type. | Optimizes a PDF document to reduce its file size. |
| Focuses on document security and access protection. | Focuses on storage efficiency and document performance. |
| Requires a user password, owner password, and encryption type. | Requires only input and output file locations. |
| Produces a password-protected PDF document. | Produces a smaller, optimized version of the original PDF. |
| Ideal for confidential document distribution, regulatory compliance, and secure document storage. | Ideal for reducing storage requirements, improving upload/download performance, and minimizing email attachment sizes. |
As a general guideline:
- Use PDF Encrypt Secure when workflows need to protect PDF documents from unauthorized access by applying password-based encryption.
- Use PDF Optimize File when workflows need to reduce the size of PDF documents for storage, transmission, or archival without changing their accessibility.
Definition Sample:
You may download the sample workflow definition from the link provided and import it into your FlowWright environment.
Note: Verify and complete any missing configuration after importing the sample, including:
- Input PDF file path
- User password
- Owner password
- Encryption type
- Output PDF file path
- PDF virtual file path
- Success and failure workflow branches
- Required file system permissions
After verifying the configuration, save and publish the workflow before execution.