Description:
The PDF Optimize File step enables a FlowWright workflow to optimize an existing PDF document by reducing its file size.
Large PDF files can increase storage requirements, consume additional network bandwidth, and slow document transfers. This step automates the optimization process by generating a smaller version of the PDF document that can be stored, transmitted, or archived more efficiently.
The workflow specifies the source PDF document, the output location for the optimized file, and a FlowWright virtual file path for subsequent workflow activities.
Typical uses include:
- Reducing document storage requirements
- Preparing PDF documents for email distribution
- Optimizing scanned documents
- Improving upload and download performance
- Preparing documents for archival
- Reducing document transfer times
- Optimizing reports before customer delivery
- Improving document management efficiency
This step helps organizations automate PDF optimization as part of their document processing workflows without requiring manual intervention.
Inputs
- Input File Path - Specifies the full path of the PDF document that will be optimized.
- Output File Path – Specifies the location where the optimized PDF document will be saved.
- PDF Virtual File Path – Specifies the FlowWright virtual file path associated with the optimized PDF document for use by subsequent workflow activities.
Returns
- True – The PDF document was successfully optimized and saved to the specified output location. Workflow execution continues through the success path.
- False – The optimization could not be completed because of an invalid input file, inaccessible output location, insufficient permissions, or another execution error. Workflow execution follows the alternate path.
Usage:
The PDF Optimize File step is typically used after PDF documents have been generated, merged, scanned, or modified and before they are distributed, archived, or uploaded.
During execution:
- Read the configured input PDF file.
- Optimize the document to reduce its file size.
- Save the optimized PDF to the configured output location.
- Associate the optimized 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:
- Optimizing scanned documents before archival
- Reducing report sizes before emailing customers
- Preparing engineering drawings for download
- Compressing generated invoices
- Optimizing large compliance reports
- Improving performance for cloud document storage
- Reducing storage requirements within document repositories
Example:
Let’s build and execute the “pdfOptimizeFileDef” example.
- Create a new process definition named “pdfOptimizeFileDef” and open it in Designer mode.
- Drag the “pdfOptimizeFile” step to the canvas.
- Connect the dots between the “Start” step and “pdfOptimizeFile” steps, as shown above.
- Define a variable or a global to store the file path result.
- Click the "pdfOptimizeFile" step to configure its "Required" properties. Provide a name for the step. Provide the source file path on the application server. Select the time zone from the drop-down list. Select the expiration date and time. Provide variable or global references to store 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 is necessary for documentation and also measures workflow progress and percent complete. This is achieved by configuring the step state and percent fields individually, as shown in the images below. Configure “Logging” using the following properties.

- Save the process definition, create a new instance, and execute it. Render the process instance. Click the “pdfOptimizeFile” process step to view its properties. This step optimizes the PDF document to reduce its file size. Copy and paste the “pdfVirtualPath” variable value into a browser window to download the optimized PDF file.
Tips:
- Optimize PDF documents before emailing them to reduce attachment sizes.
- Store optimized documents separately if the original file must be retained.
- Verify that the output folder has appropriate write permissions.
- Use descriptive output file names to distinguish optimized documents from the originals.
- Configure the PDF virtual file path when subsequent FlowWright workflow steps need to reference the optimized document.
- Route the False path to logging or notification activities to simplify troubleshooting.
- Combine this step with Remove Blank Pages, PDF Create From Pages, PDF Validate Standard, Merge PDF Files, or Send Email to build complete PDF processing workflows.
Notes:
- A valid input PDF file is required.
- The output file path must reference a writable location.
- The original PDF document is not modified unless the output path intentionally overwrites it.
- The optimized PDF is saved to the configured output location.
- The configured PDF virtual file path enables subsequent workflow components to access the optimized document.
- Both the True and False return paths should be implemented to provide complete workflow handling.
- Execution details and optimization activities are recorded in the FlowWright workflow execution log.
PDF Optimize File vs. PDF Validate Standard:
Both workflow steps process PDF documents, but they serve different purposes.
| PDF Optimize File | PDF Validate Standard |
|---|---|
| Optimizes a PDF document by reducing its file size. | Validates a PDF document against a selected PDF standard. |
| Focuses on improving storage efficiency and document performance. | Focuses on verifying compliance with PDF standards and document quality. |
| Generates an optimized version of the original PDF. | Generates validation results based on the selected validation type. |
| Does not require a validation standard. | Requires a Validation Type to specify the PDF standard to validate against. |
| Ideal for email delivery, document storage, and bandwidth optimization. | Ideal for regulatory compliance, archival verification, and quality assurance workflows. |
As a general guideline:
- Use PDF Optimize File when workflows need to reduce the size of PDF documents before storing, uploading, or distributing them.
- Use PDF Validate Standard when workflows must verify that PDF documents comply with a required validation standard before archival, regulatory submission, or external distribution.
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
- 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.