Find and Replace Text in PDF with n8n
What this node does
PDF4me Find and Replace Text searches a PDF for a text pattern and replaces every occurrence with new content — inside your n8n workflow, without manual Adobe Acrobat editing. Target the entire document or specific page ranges, preserve font, color, size, and surrounding layout, and chain multiple replacements for compound substitutions. Ideal for bulk vendor-name changes after acquisitions, branding refreshes across product catalogs, typo correction, pricing updates on quotes, terminology standardization, and template-driven document personalization.
Authenticating Your API Request
Every PDF4me node in n8n requires a valid Credential to connect with. Create or select one that holds your PDF4me API key so the workflow can authenticate text-replacement requests securely.
Important Facts You Should Not Miss
all, single pages (1,2,3), ranges (1-5,10-15), and mixed (1,2,3-7,10). Update only the cover page, the signature page, or specific chapters without touching the rest of the document.
Map the PDF binary, enter Old Text and New Text, set Page Sequence, and execute — the modified PDF is returned in one node.
Parameters
Required: Credential to connect with, PDF Input Data Type, Old Text, New Text, Page Sequence, Output File Name, and Binary Data Output Name must all be provided. The matching input field (Input Binary Field, Base64 PDF Content, or PDF URL) is required based on the chosen PDF Input Data Type.
| Parameter | Required | What it does | Example |
|---|---|---|---|
| PDF Input Data Type | Yes | How the source PDF is supplied. Binary Data reads from a previous n8n node (most common). Base64 String accepts encoded payload. URL downloads from a public link. | Binary Data |
| Input Binary Field | Conditional | Binary field holding the PDF content from the previous node. Required when PDF Input Data Type is Binary Data. | {{ $binary.data }} |
| Base64 PDF Content | Conditional | Base64-encoded PDF content. Required when PDF Input Data Type is Base64 String. | JVBERi0xLjQK... |
| PDF URL | Conditional | Public URL to the source PDF. Required when PDF Input Data Type is URL. Must not require authentication. | https://example.com/contract.pdf |
| Old Text | Yes | Exact text pattern to find in the PDF. Case-sensitive by default. Each occurrence within the Page Sequence will be replaced. | Old Vendor Inc. |
| New Text | Yes | Replacement text. Inserted in place of every Old Text occurrence with preserved font, color, and size. | New Vendor LLC |
| Page Sequence | Yes | Pages to process. Use "all" for entire document, comma-separated pages "1,2,3", ranges "1-5,10-15", or mixed "1,2,3-7,10". Default "all". | 1,2,3 |
| Output File Name | Yes | Filename for the modified PDF. Must include the .pdf extension. | find_and_replace_output.pdf |
| Binary Data Output Name | Yes | Name of the binary field in the n8n output holding the modified PDF. Used in subsequent workflow nodes. | data |
| Async | No | Enable asynchronous processing. true runs the operation in background for higher throughput; recommended for large PDFs and high-volume scenarios. Default behavior varies by deployment. | true |
Advanced Options
Custom ProfilesPage Sequence Patterns
allEntire document1,2,3Specific pages1-5,10-15Page ranges1,2,3-7,10Mixed pages + rangesOutput Fields
| Field | Type | What it contains |
|---|---|---|
success | Boolean | True when text replacement completed successfully; false on error. |
message | String | Human-readable status message confirming success or describing the error. |
fileName | String | Filename of the modified PDF (e.g. find_and_replace_output.pdf). |
mimeType | String | MIME type of the output — always application/pdf. |
fileSize | Number | Size of the modified PDF in bytes. |
oldText | String | Echo of the Old Text searched for, for audit and verification. |
newText | String | Echo of the New Text replacement applied, for audit and verification. |
pageSequence | String | Echo of the page range processed (e.g. "all pages", "1,2,3"). |
Quick Setup
- Add PDF4me to your n8n workflow and select Find and Replace Text as the action.
- In Credential to connect with, select your PDF4me credential or create one with your API key.
- Set PDF Input Data Type to Binary Data and map Input Binary Field to the binary output of a previous node (Dropbox, Google Drive, HTTP Request, etc.).
- Enter Old Text — the exact text pattern to find in the PDF (e.g.
Old Vendor Inc.). - Enter New Text — the replacement text (e.g.
New Vendor LLC). - Set Page Sequence — use
allfor global replacement, or specific pages/ranges like1,2,3or1-5,10-15. - Set Output File Name to your desired filename (with
.pdfextension) and Binary Data Output Name todata. - Optionally enable Async for large documents or high-volume processing.
- Execute. The output bundle contains the modified PDF with all replacements applied, ready for upload, email, or further processing.
Workflow Examples
Workflow ExamplesCommon n8n workflow patterns using Find and Replace Text.
- After an acquisition, the legal team needs to update every active contract PDF to reflect the new entity name.
- A SharePoint Watch Files trigger fires for each contract in the active-contracts folder.
- PDF4me Find and Replace Text replaces the old company name with the new entity name across all pages (Page Sequence = all). Font and layout are preserved.
- An additional Find and Replace Text node updates the registered address from the old HQ to the new HQ in the same document.
- The updated contract is saved back to SharePoint with version-controlled filename. A Slack notification confirms the update to legal-ops. Hundreds of contracts updated in minutes vs. weeks of manual Acrobat editing.
- A webhook from the CRM fires when sales generates a new quote PDF from a template.
- PDF4me Find and Replace Text runs 4 times in sequence (chained nodes), each replacing one placeholder:
{{CUSTOMER_NAME}},{{TOTAL_PRICE}},{{VALID_UNTIL}},{{ACCOUNT_MANAGER}}. - The personalized quote is sent via Gmail to the customer with a dynamic subject line and attachment.
- A Salesforce Update Record step attaches the final quote PDF to the opportunity.
- An Airtable log records the customer, quote ID, total value, and sent timestamp for sales reporting.
- A Schedule Trigger fires on 1 January each year to refresh product catalogs with new pricing.
- A Google Drive list step retrieves every catalog PDF in the catalogs folder.
- A Loop Over Items processes each PDF. PDF4me Find and Replace Text updates "Pricing valid through 2024" to "Pricing valid through 2025" with Page Sequence set to
1,2(cover and summary pages only — leaves the body untouched). - A second Find and Replace Text node updates the copyright year footer on Page Sequence
all. - The refreshed catalog uploads back to the same Google Drive location, overwriting the old version. Marketing receives a Slack summary listing every catalog that was refreshed.