Actions80
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Image Watermark To Image
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- Add Text Watermark To Image
- AI-Invoice Parser
- AI-Process Contract
- AI-Process HealthCard
- Classify Document
- Compress Image
- Compress PDF
- Convert HTML To PDF
- Convert Image Format
- Convert JSON To Excel
- Convert Markdown To PDF
- Convert PDF To Editable PDF Using OCR
- Convert PDF To Excel
- Convert PDF To PowerPoint
- Convert PDF To Word
- Convert To PDF
- Convert URL to PDF
- Convert VISIO
- Convert Word to PDF Form
- Create Images From PDF
- Create PDF/A
- Create Swiss QR Bill
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Split PDF By Barcode
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Extract Attachment From PDF
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Resources
- Extract Table From PDF
- Extract Text By Expression
- Extract Text From Word
- Fill PDF Form
- Find And Replace Text
- Flip Image
- Flatten PDF
- Generate Barcode
- Generate Document Single
- Generate Documents Multiple
- Get Document From Pdf4me
- Get Image Metadata
- Get PDF Metadata
- Split PDF By Swiss QR
- Get Tracking Changes In Word
- Image Extract Text
- Linearize PDF
- Merge Multiple PDFs
- Overlay PDFs
- Parse Document
- Protect PDF
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Remove EXIF Tags From Image
- Repair PDF Document
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Document
- Rotate Image
- Rotate Image By EXIF Data
- Rotate PDF Page
- Sign PDF
- Split PDF By Text
- Split PDF Regular
- Unlock PDF
- Update Hyperlinks Annotation
- Upload File To PDF4me
Overview
The node performs a "Find And Replace Text" operation on PDF files. It allows users to search for specific text within a PDF document and replace it with new text. This is useful in scenarios where you need to update or correct text content in PDFs without manually editing the file, such as updating contract terms, correcting typos, or customizing documents dynamically.
Practical examples include:
- Automatically replacing placeholders in PDF templates with actual data.
- Correcting repeated errors in scanned or generated PDFs.
- Updating product names or prices in PDF catalogs.
Properties
| Name | Meaning |
|---|---|
| PDF Input Data Type | Choose how to provide the PDF file: Binary Data (from previous node), Base64 String (encoded PDF content), or URL (link to PDF file). |
| PDF Binary Field | Name of the binary property containing the PDF file (used if input type is Binary Data). |
| PDF Base64 Content | Base64 encoded string representing the PDF content (used if input type is Base64 String). |
| PDF URL | URL pointing to the PDF file to process (used if input type is URL). |
| Old Text | The text string to find within the PDF that should be replaced. |
| New Text | The text string to replace the old text with. |
| Page Sequence | Specifies which pages to process by indices or ranges (e.g., "1, 2, 3-7"). Leave empty to process all pages. |
| Output File Name | Desired filename for the output PDF after text replacement. |
| Async | Enable asynchronous processing (true/false). |
| Binary Data Output Name | Custom name for the binary data field in the node's output (default is "data"). |
Output
The node outputs the modified PDF file as binary data under a customizable binary property name (default "data"). The JSON output contains metadata about the processed item, while the binary data holds the updated PDF content with the specified text replaced.
Dependencies
- Requires access to the PDF processing service or library integrated into the node (likely an external API or SDK).
- If using URL input, requires network access to fetch the PDF file.
- For authentication, an API key or token credential is needed but is abstracted from this code.
Troubleshooting
Common issues:
- Incorrect page sequence format may cause no changes or errors; ensure proper comma-separated values or ranges.
- Providing an invalid PDF (corrupted or unsupported format) will result in processing failure.
- If the old text does not exist in the PDF, the output PDF will remain unchanged.
- Network issues when using URL input can prevent fetching the PDF.
Error messages:
- Errors related to missing or invalid input properties (e.g., missing PDF content or old/new text) require checking node configuration.
- API or service errors might indicate authentication problems or service unavailability; verify credentials and network connectivity.
- Parsing errors suggest the PDF might be corrupted or incompatible.
Links and References
- PDF Text Replacement Concepts (Adobe PDF specification)
- Base64 Encoding
- n8n Documentation for general node usage and binary data handling