PDF.co Api icon

PDF.co Api

Generate PDF, extract data from PDF, split PDF, merge PDF, convert PDF. Fill PDF forms, add text and images to pdf and much more with pdf.co!

Overview

This node provides functionality to delete specific pages from a PDF file accessible via a URL. It is useful in scenarios where you need to remove unwanted or sensitive pages from a PDF document before further processing or sharing. For example, you might want to exclude cover pages, advertisements, or confidential sections from a report or contract PDF.

The node takes a PDF URL and a list of page numbers (including ranges) to delete, processes the PDF accordingly, and outputs the modified PDF file or a link to it.

Properties

Name Meaning
Url The URL of the PDF file from which pages will be deleted.
Pages Comma-separated list of page numbers and/or ranges to delete (e.g., "1,3,5-7").
Advanced Options A collection of optional settings:
- File Name The desired name for the output PDF file.
- Webhook URL A callback URL or webhook to receive the output data asynchronously.
- Output Links Expiration Time in minutes after which the output link expires (default 60).
- HTTP Username Username for HTTP authentication if the source PDF URL requires it.
- HTTP Password Password for HTTP authentication if the source PDF URL requires it.
- Custom Profiles JSON string to specify custom API call options or profiles, allowing advanced configuration such as output data format.

Output

The node outputs JSON data containing information about the processed PDF. This typically includes a link or reference to the modified PDF file with the specified pages removed. If a webhook URL is provided, the output may be delivered asynchronously via that callback.

If binary data output is supported, it would represent the modified PDF file content itself, but this is not explicitly detailed in the provided code snippet.

Dependencies

  • Requires access to an external PDF processing API service capable of deleting pages from PDFs.
  • Needs an API key or authentication token configured in n8n to authorize requests to the PDF processing service.
  • Optional HTTP authentication credentials if the source PDF URL is protected.
  • Network access to the source PDF URL and optionally to the webhook/callback URL.

Troubleshooting

  • Invalid URL or inaccessible PDF: Ensure the provided PDF URL is correct and publicly accessible or properly authenticated.
  • Incorrect page numbers format: The pages property must be a valid comma-separated list of page numbers and ranges (e.g., "1,3,5-7"). Invalid formats may cause errors.
  • Authentication failures: If the source PDF URL requires HTTP authentication, provide correct username and password.
  • Webhook issues: If using a webhook URL, ensure it is reachable and correctly handles incoming data.
  • API limits or errors: Check API usage limits and error messages returned by the PDF processing service; adjust request parameters or credentials accordingly.

Links and References

Discussion