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 Unwanted Pages From PDF," allows users to remove specific pages from a PDF document. It is useful in scenarios where you need to clean up or reduce the size of PDFs by excluding irrelevant or sensitive pages before further processing or sharing. For example, you might receive a multipage report but only want to keep certain sections, or you want to remove blank or confidential pages from a document.

The node supports multiple ways to provide the input PDF: as binary data from a previous node, as a base64-encoded string, or via a URL pointing to the PDF file. Users specify which pages to delete using page numbers or ranges.

Properties

Name Meaning
Input Data Type How the PDF file is provided. Options: Binary Data (from previous node), Base64 String, or URL.
Input Binary Field The name of the binary property containing the PDF file when using Binary Data input type (default "data").
Base64 PDF Content The base64 encoded content of the PDF document (used if Input Data Type is Base64 String).
PDF URL The URL to the PDF file (used if Input Data Type is URL).
Document Name The desired name for the output PDF document after deleting pages (default "output.pdf").
Page Numbers The pages to delete, specified as individual numbers (e.g., "2"), comma-separated list (e.g., "1,3,5"), or ranges (e.g., "2-4").
Advanced Options Optional JSON string to specify custom profiles or additional API options for advanced use cases.

Output

The node outputs the modified PDF document with the specified pages removed. The output includes:

  • A JSON object containing metadata about the processed document.
  • The PDF file itself is returned as binary data attached to the output item, typically under a binary property (commonly named "data").

If the input was binary, the output will be binary data representing the updated PDF. If the input was base64 or URL, the output similarly contains the resulting PDF in binary form.

Dependencies

  • This node relies on an external PDF processing service accessible via API calls.
  • Requires configuration of an API key credential or similar authentication token to access the PDF manipulation API.
  • Network access is needed if providing the PDF via URL or if the API is cloud-based.

Troubleshooting

  • Invalid Page Numbers: Errors may occur if the specified page numbers do not exist in the PDF. Ensure page numbers are within the document's range and correctly formatted.
  • Input Data Issues: If the binary field name is incorrect or the base64 string is malformed, the node will fail to process the PDF. Verify that the input data matches the selected input type.
  • API Authentication Errors: Missing or invalid API credentials will cause authorization failures. Confirm that the API key or token is correctly configured.
  • Network Errors: When using URLs or calling external APIs, network connectivity issues can cause failures. Check internet connection and URL accessibility.
  • Large Files: Processing very large PDFs might lead to timeouts or memory issues depending on the environment and API limits.

Links and References


This summary is based on static analysis of the node's execute method and provided properties, focusing on the "Delete Unwanted Pages From PDF" operation.

Discussion