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

This node operation "Delete Blank Pages From PDF" processes PDF documents to remove pages that are considered blank based on specified criteria. It is useful in workflows where PDFs may contain unnecessary empty pages, such as scanned documents, reports, or forms, helping to reduce file size and improve document clarity.

Typical use cases include:

  • Cleaning up scanned multi-page PDFs by removing blank pages.
  • Preparing documents for archiving or sharing without redundant pages.
  • Automating document processing pipelines where blank pages interfere with downstream tasks.

For example, a user can input a PDF file from a previous node (binary data), specify the criteria for what constitutes a blank page (e.g., no text and no images), and receive a cleaned PDF output with those pages removed.

Properties

Name Meaning
Input Data Type How the PDF file is provided:
- Binary Data: Use PDF file from previous node.
- Base64 String: Provide PDF content as a base64 encoded string.
- URL: Provide URL to PDF file.
Input Binary Field Name of the binary property containing the PDF file (usually "data"). Used only if Input Data Type is Binary Data.
Base64 PDF Content Base64 encoded PDF document content. Used only if Input Data Type is Base64 String.
PDF URL URL to the PDF file to delete blank pages from. Used only 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:
- No Text, No Images: Delete pages with neither text nor images.
- No Text: Delete pages with no text regardless of images.
- No Images: Delete pages with no images regardless of text.
Advanced Options Optional JSON string to set custom profiles or extra options for the API call. Useful for advanced users who want to customize the behavior beyond default settings.

Output

The node outputs a JSON object containing the processed PDF document with blank pages removed according to the selected criteria. The main output includes:

  • A binary property holding the resulting PDF file data, named according to the workflow's conventions (commonly "data").
  • The JSON part typically contains metadata about the operation or the document, depending on the underlying API response.

If the node supports binary output, it means the cleaned PDF file is available for further processing or saving.

Dependencies

  • Requires access to an external PDF processing service via API to perform the blank page deletion.
  • Needs proper API authentication configured in n8n (such as an API key credential).
  • Internet access is required if providing the PDF via URL or when calling the external API.

Troubleshooting

  • Common Issues:

    • Providing an invalid or inaccessible PDF URL will cause failures.
    • Incorrect base64 encoding of the PDF content may result in errors.
    • Selecting incompatible delete page options might lead to unexpected results (e.g., no pages deleted).
  • Error Messages:

    • Errors related to missing or invalid input data usually indicate misconfiguration of the input properties.
    • API authentication errors suggest missing or incorrect API credentials.
    • Network or timeout errors imply connectivity issues with the external PDF service.
  • Resolutions:

    • Verify the input PDF source matches the selected Input Data Type.
    • Ensure the API key or authentication token is correctly set up in n8n credentials.
    • Check network connectivity and URL accessibility.
    • Use the Advanced Options carefully and validate JSON syntax if used.

Links and References

  • PDF4me API Documentation — For details on custom profiles and advanced options.
  • General information on PDF blank page detection and removal techniques can be found in various PDF processing libraries and services documentation.

Discussion