Actions19
- AI Invoice Parser
- URL/HTML to PDF
- Merge PDF
- Split PDF
- Convert To PDF
- Convert From PDF
- Add Text/Images to PDF
- Fill a PDF Form
- PDF Information & Form Fields
- Compress PDF
- PDF Security
- Rotate PDF Pages
- Delete PDF Pages
- Search in PDF
- Search & Replace Text or Delete
- Barcode Reader
- Barcode Generator
- Make PDF Searchable or Unsearchable
- Upload File
Overview
This node enables users to perform text manipulation operations on PDF files accessed via a URL. Specifically, it supports searching for text within the PDF and either deleting it, replacing it with other text, or replacing it with an image. This functionality is useful in scenarios such as redacting sensitive information, updating outdated text content, or customizing PDFs by inserting images in place of certain text.
Practical examples include:
- Removing confidential terms from a contract PDF before sharing.
- Updating company names or addresses in bulk across multiple PDF documents.
- Replacing placeholder text with logos or signatures represented as images.
Properties
| Name | Meaning |
|---|---|
| PDF URL | The URL of the PDF file where the search and replace or delete operation will be performed. |
| Operation Type | The type of operation to perform: - Search and Delete Text: Find and remove specific text. - Search and Replace Text: Find and replace specific text. - Search and Replace with Image: Replace found text with an image. |
| Search and Delete Text | Collection of one or more text strings to find and delete from the PDF (used when Operation Type is "delete"). |
| Search and Replace Text | Collection of one or more pairs of search and replacement text strings (used when Operation Type is "replace"). |
| Search Text | The text string to search for in the PDF (used when Operation Type is "replaceWithImage"). |
| Replacement Image URL | The URL of the image that will replace the found text (used when Operation Type is "replaceWithImage"). |
| Pages | Comma-separated list of page numbers to limit the search and replace/delete operations to specific pages. Leave empty to process all pages. |
| Advanced Options | Additional optional settings: - Replacement Limit: Maximum number of replacements per search term (0 means unlimited). - Use Regular Expressions: Enable regex-based search. - Case Sensitive: Make search case-sensitive. - File Name: Name for the output PDF file. - Webhook URL: URL to receive output data asynchronously. - Output Links Expiration: Time in minutes before output links expire. - Password: Password for encrypted PDFs. - HTTP Username/Password: Credentials if required to access the source PDF URL. - Custom Profiles: JSON string to specify extra API call options. |
Output
The node outputs JSON data representing the result of the operation. Typically, this includes metadata about the processed PDF and links to download the modified file. If a webhook URL is provided, the output may be delivered asynchronously to that endpoint.
If binary data output is supported, it would represent the modified PDF file itself, but based on the provided code and properties, the main output is expected to be JSON with URLs or base64 encoded data depending on configuration.
Dependencies
- Requires access to the PDF file via a publicly accessible URL or with provided HTTP credentials.
- Uses an external PDF processing service API (implied by references to profiles and API calls).
- May require an API key credential configured in n8n to authenticate requests to the PDF processing service.
- Optional webhook URL support for asynchronous processing callbacks.
Troubleshooting
Common Issues:
- Invalid or inaccessible PDF URL: Ensure the URL is correct and publicly reachable or credentials are correctly set.
- Incorrect password for encrypted PDFs: Provide the correct password to avoid access errors.
- Misconfigured regular expressions: When using regex search, ensure patterns are valid to prevent errors.
- Exceeding replacement limits unintentionally: Check the replacement limit setting if fewer replacements occur than expected.
Error Messages:
- "Failed to fetch PDF": Indicates network or authentication issues accessing the PDF URL.
- "Invalid password": The provided password does not unlock the PDF.
- "No matches found": The search text did not match any content in the specified pages.
- "API request failed": General failure communicating with the external PDF processing service; check API key and service status.
Resolving these typically involves verifying input parameters, credentials, and network connectivity.
Links and References
- PDF.co API Profiles Documentation — For configuring custom profiles and advanced API options.
- Regular Expressions Guide — Useful when enabling regex search.
- n8n Webhook Documentation — For understanding how to use webhook URLs for asynchronous callbacks.