Actions80
- Extract Text From Word
- Find And Replace Text
- Convert PDF To Editable PDF Using OCR
- Create Swiss QR Bill
- Split PDF By Barcode
- Split PDF By Swiss QR
- Split PDF By Text
- Split PDF Regular
- Create PDF/A
- Convert HTML To PDF
- Convert Markdown To PDF
- Upload File To PDF4me
- Add Attachment To PDF
- Add Barcode To PDF
- Add Form Fields To PDF
- Fill PDF Form
- Add HTML Header Footer
- Add Image Stamp To PDF
- Add Margin To PDF
- Add Page Number To PDF
- Add Text Stamp To PDF
- AI-Invoice Parser
- AI-Process HealthCard
- AI-Process Contract
- Generate Barcode
- Classify Document
- Parse Document
- Linearize PDF
- Flatten PDF
- Convert To PDF
- Json To Excel
- Convert PDF To Excel
- Convert PDF To Word
- Convert PDF To PowerPoint
- Convert VISIO
- Crop Image
- Delete Blank Pages From PDF
- Delete Unwanted Pages From PDF
- Extract Pages
- Merge Multiple PDFs
- Overlay PDFs
- Rotate Document
- Rotate Page
- Sign PDF
- URL to PDF
- Add Image Watermark To Image
- Add Text Watermark To Image
- Compress Image
- Convert Image Format
- Create Images From PDF
- Flip Image
- Get Image Metadata
- Image Extract Text
- Remove EXIF Tags From Image
- Replace Text With Image
- Replace Text With Image In Word
- Resize Image
- Rotate Image
- Rotate Image By EXIF Data
- Compress PDF
- Get PDF Metadata
- Repair PDF Document
- Get Document From Pdf4me
- Update Hyperlinks Annotation
- Protect Document
- Unlock PDF
- Disable Tracking Changes In Word
- Enable Tracking Changes In Word
- Generate Document Single
- Generate Documents Multiple
- Get Tracking Changes In Word
- Read Barcode From Image
- Read Barcode From PDF
- Read SwissQR Code
- Extract Form Data From PDF
- Extract Pages From PDF
- Extract Attachment From PDF
- Extract Text By Expression
- Extract Table From PDF
- Extract Resources
Overview
This node operation "Replace Text With Image" allows users to replace specific text occurrences within a PDF document with an image. It is useful in scenarios where you want to dynamically insert logos, signatures, stamps, or any graphical content in place of certain text placeholders inside PDFs. For example, replacing the word "SIGN_HERE" with a signature image on contract documents, or substituting a placeholder text with a company logo on invoices.
Properties
| Name | Meaning |
|---|---|
| PDF Input Data Type | How the input PDF file is provided. Options: Binary Data (from previous node), Base64 String (encoded PDF content), or URL (link to PDF file). |
| PDF Binary Field | The name of the binary property containing the PDF file when using Binary Data input type. |
| PDF Base64 Content | Base64 encoded string of the PDF content when using Base64 String input type. |
| PDF URL | URL pointing to the PDF file when using URL input type. |
| Image Input Data Type | How the replacement image is provided. Options: Binary Data (from previous node), Base64 String (encoded image content), or URL (link to image file). |
| Image Binary Field | The name of the binary property containing the image file when using Binary Data input type. |
| Image Base64 Content | Base64 encoded string of the image content when using Base64 String input type. |
| Image URL | URL pointing to the image file when using URL input type. |
| Text to Replace | The exact text string in the PDF that should be replaced by the image. |
| Page Sequence | Specifies which pages to apply the replacement on. Can be "all", a single page number (e.g., "1"), multiple pages separated by commas (e.g., "1,3,5"), or ranges (e.g., "2-5"). |
| Image Height | Height of the replacement image in the PDF (integer value). |
| Image Width | Width of the replacement image in the PDF (integer value). |
| Output File Name | Desired filename for the output PDF after replacement. Defaults to "replace_text_with_image.pdf". |
| Async | Boolean flag to enable asynchronous processing. When true, the operation may run asynchronously depending on backend support. |
Output
The node outputs a JSON object containing the modified PDF file with the specified text replaced by the image. The PDF is typically returned as binary data attached to the output item, ready for further use or saving. The output includes the updated PDF content reflecting the replacements made.
If the node supports binary output, the binary data represents the new PDF file with images replacing the specified text.
Dependencies
- Requires access to the PDF processing service or API capable of performing text-to-image replacement.
- Needs proper authentication via an API key or token configured in n8n credentials.
- Internet access if URLs are used for PDF or image inputs.
- The node depends on the bundled action module responsible for "Replace Text With Image" functionality.
Troubleshooting
Common Issues:
- Incorrect text string in "Text to Replace" property may result in no replacements.
- Invalid or inaccessible URLs for PDF or image inputs can cause failures.
- Mismatched binary property names will lead to missing input files.
- Specifying invalid page sequences might cause errors or no changes.
- Image dimensions too large or zero may produce unexpected results.
Error Messages and Resolutions:
- "Input PDF not found" — Verify the PDF input source and binary field name.
- "Image data invalid or missing" — Check the image input type and ensure correct data is provided.
- "Text to replace not found in PDF" — Confirm the exact text exists in the PDF and matches case and spacing.
- "Page sequence format invalid" — Use correct syntax like "all", "1", "1,3,5", or "2-5".
- Timeout or async processing errors — Try disabling async or check network connectivity.
Links and References
- PDF4me API Documentation (general reference for PDF operations)
- Base64 Encoding Guide
- n8n Documentation for configuring credentials and binary data handling