pdfRemoveBlankPages Step
Description:
The PDF Remove Blank Pages step enables a FlowWright workflow to remove unnecessary blank pages from an existing PDF document. Optionally, the workflow can specify a comma-separated list of page numbers to remove, allowing targeted page removal in addition to automatic blank-page cleanup.
Scanned documents, merged reports, and generated PDFs often contain unwanted blank pages or pages that should not be included in the final document. This step automates the cleanup process by generating a new PDF with the unnecessary pages removed, improving document readability and reducing document size.
The workflow specifies the source PDF document, the output location, the FlowWright virtual file path, and optionally a list of page numbers to remove.
Typical uses include:
- Removing blank pages from scanned documents
- Cleaning automatically generated reports
- Removing separator pages after document merging
- Preparing customer-ready PDF documents
- Improving document readability
- Reducing unnecessary page count
- Preparing documents for archival
- Streamlining document packages before distribution
This step helps organizations automate PDF cleanup while improving document quality and reducing manual editing.
Inputs
- Input File Path - Specifies the full path of the PDF document that will be processed.
- Output File Path – Specifies the location where the cleaned PDF document will be saved.
- PDF Virtual File Path – Specifies the FlowWright virtual file path associated with the cleaned PDF document for use by subsequent workflow activities.
- Comma Separated List of Pages to Remove - (Optional) Specifies a comma-separated list of page numbers to remove from the PDF document. If left empty, the step removes blank pages automatically.
Returns
- True – The blank pages or specified pages were successfully removed, and the updated PDF document was created. Workflow execution continues through the success path.
- False – The page removal operation could not be completed because of an invalid input file, inaccessible output location, invalid page numbers, or another execution error. Workflow execution follows the alternate path.
Usage:
The PDF Remove Blank Pages step is typically used after PDF documents have been scanned, merged, generated, or imported and before they are archived, distributed, or processed further.
During execution:
- Read the configured input PDF file.
- Determine whether a list of page numbers has been supplied.
- If page numbers are provided, remove those pages from the document.
- Otherwise, automatically detect and remove blank pages.
- Save the cleaned PDF 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:
- Removing blank pages from scanned contracts
- Cleaning purchase orders before approval
- Removing separator pages after PDF merging
- Preparing invoices for customer delivery
- Cleaning engineering documentation
- Preparing legal documents for electronic filing
- Optimizing document packages before archival
Example:
Let’s build and execute the “pdfRemoveBlankPagesDef” example.
- Create a new process definition named “pdfRemoveBlankPagesDef” and open it in designer mode.
- Drag the “pdfRemoveBlankPages” step to the canvas.
- Connect the dots between the “Start” step and “pdfRemoveBlankPages” steps, as shown above.
- Define a variable or a global variable to store the file path result.
- Click the "pdfRemoveBlankPages" step to configure its "Required" properties. Provide a name for the step. Provide the source file path on the application server. Provide variable references to store the Output and Virtual PDF file paths. Click the Save button. Note: Click the "AI Predict" button for the Copilot to add new process steps that match your process description.

- Click the "pdfRemoveBlankPages" step to configure its "Optional" properties. Enter the page numbers to remove. This configuration is optional. Click the Save button.

- 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 the “Logging” using the following properties.

- Save the process definition, create a new instance, and execute it. Render the process instance. Click the “pdfRemoveBlankPages” process step to view its properties. The process step creates a copy of the PDF without blank pages. Copy and paste the “pdfVirtualPath” variable value into a browser window to view the PDF file.
Tips:
- Leave the Comma Separated List of Pages to Remove property empty when only blank pages should be removed automatically.
- Use explicit page numbers when known unwanted pages should always be removed.
- Preserve the original PDF if an unmodified version must be retained.
- Verify that the output directory has appropriate write permissions.
- Configure the PDF virtual file path when downstream FlowWright workflow steps need to reference the cleaned 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 Encrypt Secure, or Send Email to build complete PDF document processing workflows.
Notes:
- A valid input PDF file is required.
- The output file path must reference a writable location.
- The Comma Separated List of Pages to Remove property is optional.
- If no page list is supplied, the step automatically removes blank pages.
- The cleaned PDF is saved to the configured output location.
- The configured PDF virtual file path enables subsequent FlowWright workflow activities to reference the processed document.
- Both the True and False return paths should be implemented to provide complete workflow handling.
- Execution details and PDF cleanup activities are recorded in the FlowWright workflow execution log.
PDF Remove Blank Pages vs. Redact PDF:
Both workflow steps modify PDF documents, but they solve different document processing requirements.
| PDF Remove Blank Pages | Redact PDF |
|---|---|
| Removes blank pages or specified pages from a PDF document. | Redacts specified keywords by blanking out matching content within a PDF document. |
| Focuses on document cleanup and improving document structure. | Focuses on protecting confidential or sensitive information. |
| Optionally accepts a comma-separated list of page numbers to remove. | Requires a keyword list to identify content that should be redacted. |
| Produces a streamlined PDF with unnecessary pages removed. | Produces a sanitized PDF with sensitive information concealed. |
| Ideal for scanned documents, merged reports, and document preparation. | Ideal for privacy compliance, confidential document sharing, and regulatory requirements. |
As a general guideline:
- Use PDF Remove Blank Pages when workflows need to remove unnecessary blank pages or specified pages to improve document quality and readability.
- Use Redact PDF when workflows must permanently conceal confidential information before documents are shared, archived, or published.
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
- Optional comma-separated page list
- Success and failure workflow branches
- Required file system permissions
After verifying the configuration, save and publish the workflow before execution.
Click here to download the sample file.