PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The "Delete Blank Pages From PDF" operation in this node allows users to remove blank pages from a PDF document based on specific criteria. This is useful for cleaning up scanned documents, reports, or any PDFs where unwanted blank pages may have been inserted during creation or scanning.

Common scenarios include:

  • Automating the cleanup of scanned multi-page documents by removing pages that contain no text or images.
  • Preparing PDFs for distribution or archiving by eliminating unnecessary blank pages.
  • Reducing file size and improving readability by deleting empty pages.

Practical example:

  • A user uploads a scanned PDF with occasional blank pages between sections. Using this operation, they can automatically delete all pages that contain neither text nor images, resulting in a concise, clean PDF.

Properties

Name Meaning
Input Data Type Choose how to provide the PDF file to delete blank pages from. Options:
• Binary Data (from previous node)
• Base64 String (provide PDF content as base64 encoded string)
• URL (provide URL to PDF file)
Input Binary Field Name of the binary property containing the PDF file (usually "data"). Required if Input Data Type is Binary Data.
Base64 PDF Content Base64 encoded PDF document content. Required if Input Data Type is Base64 String.
PDF URL URL to the PDF file to delete blank pages from. Required if Input Data Type is URL.
Document Name Name of the output PDF document after blank pages are deleted. Defaults to "output.pdf".
Delete Page Option Criteria for deleting blank pages. Options:
• No Text, No Images (delete pages with neither text nor images)
• No Text (delete pages without text)
• No Images (delete pages without images)
Output Binary Field Name Name of the binary property to store the output PDF file. Defaults to "data".
Advanced Options Optional JSON string to specify custom profiles or additional API options for advanced use cases. Users can adjust properties according to external API documentation for more control over processing behavior.

Output

The node outputs the processed PDF file with blank pages removed according to the selected criteria. The output is provided as binary data under the specified binary field name (default "data"). This binary data represents the cleaned PDF document ready for further use or download.

No additional JSON structure details are exposed; the main output is the binary PDF file.

Dependencies

  • Requires an active connection to the PDF processing service API that supports deleting blank pages from PDFs.
  • Needs appropriate API authentication credentials configured in n8n to authorize requests.
  • The node relies on the external PDF4me API or similar service to perform the actual blank page detection and deletion.

Troubleshooting

  • Common issues:

    • Providing incorrect input data type or mismatched binary field names may cause failures.
    • Invalid or inaccessible URLs when using the URL input option will result in errors.
    • Improperly formatted base64 strings can cause decoding errors.
    • Insufficient permissions or invalid API credentials will prevent successful API calls.
  • Error messages and resolutions:

    • "File not found" or "Unable to fetch PDF from URL": Verify the URL is correct and publicly accessible.
    • "Invalid base64 content": Ensure the base64 string is properly encoded and complete.
    • "Missing binary data": Confirm the binary property name matches the actual input binary data field.
    • API authentication errors: Check that API keys or tokens are correctly set up in n8n credentials.
    • Unexpected API response or timeout: Retry the operation or check network connectivity.

Links and References

Discussion