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 operation allows users to add text annotations and images to an existing PDF file by specifying exact coordinates, styling, and page numbers. It is useful for dynamically customizing PDFs such as invoices, reports, or contracts by overlaying additional information like stamps, signatures, comments, or branding images.

Common scenarios include:

  • Adding watermarks or approval stamps to PDF documents.
  • Inserting dynamic text such as page numbers, dates, or user-specific data.
  • Embedding logos or other images at precise locations on specific pages.
  • Creating annotated PDFs for review or presentation purposes.

For example, a user can input a URL of an invoice PDF and add the company logo image at the top right corner on all pages, while also adding a "Paid" text stamp in red bold font on the first page.

Properties

Name Meaning
Url URL to the source PDF file to be edited. Users should use the PDF Inspector tool to preview and measure coordinates for placing text or images accurately.
Text (annotations) Collection of text annotations to add. Each annotation includes: text content (supports macros like [[page]]), X/Y coordinates, font size, color, style options (bold, italic, strikeout, underline), font name, target pages, clickable link, box width/height, alignment, and transparency.
Images Collection of images to add. Each image includes: image URL or base64 data, X/Y coordinates, width/height (auto-detect if empty), target pages, clickable link, and option to keep aspect ratio.
Advanced Options Additional settings including custom output file name, callback webhook URL to receive output data, expiration time for output links in minutes, and custom profiles for advanced API call configurations.

Output

The node outputs JSON data containing information about the processed PDF file. This typically includes URLs or base64 encoded data of the modified PDF document ready for download or further processing.

If configured, the node can send the output asynchronously via a webhook callback URL.

Binary data output is not explicitly detailed but may be supported depending on the API profile used.

Dependencies

  • Requires access to the source PDF file via a publicly accessible URL.
  • Uses an external PDF editing API service to perform the addition of text and images.
  • May require an API key credential configured in n8n for authentication with the PDF service.
  • The PDF Inspector tool (https://app.pdf.co/pdf-edit-add-helper) is recommended for measuring coordinates and previewing edits before running the node.

Troubleshooting

  • Invalid URL or inaccessible PDF: Ensure the provided PDF URL is correct and publicly accessible without authentication.
  • Incorrect coordinates or page numbers: Use the PDF Inspector tool to verify coordinates and page ranges; invalid values may cause no changes or errors.
  • Unsupported font or image format: Choose fonts from the provided list or specify valid font IDs; ensure images are accessible and in supported formats (e.g., PNG, JPEG).
  • API errors or authentication failures: Verify that the API key or credentials are correctly set up in n8n and have sufficient permissions.
  • Output link expiration too short: If output links expire before download, increase the expiration time in advanced options.

Links and References

Discussion