Skip to main content

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

Preserves font, color, and layout in place
Each Old Text occurrence is replaced in the same character position with the original font, color, and size preserved. Surrounding text, images, page numbers, and document structure remain untouched — unlike PDF-to-Word-to-PDF roundtrips which often shift layout and break formatting.
Page-range targeting — update only what needs changing
Page Sequence supports 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.
Async processing for large documents
Enable the Async option for large or high-volume scenarios — the operation runs in the background for better workflow throughput. Recommended for enterprise scenarios processing dozens or hundreds of PDFs per run.
Find and Replace Text n8n node showing PDF4me parameters: PDF Input Data Type, Input Binary Field, Old Text, New Text, Page Sequence, Output File Name configured for automated PDF text replacement

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.

ParameterRequiredWhat it doesExample
PDF Input Data TypeYesHow 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 FieldConditionalBinary field holding the PDF content from the previous node. Required when PDF Input Data Type is Binary Data.{{ $binary.data }}
Base64 PDF ContentConditionalBase64-encoded PDF content. Required when PDF Input Data Type is Base64 String.JVBERi0xLjQK...
PDF URLConditionalPublic URL to the source PDF. Required when PDF Input Data Type is URL. Must not require authentication.https://example.com/contract.pdf
Old TextYesExact text pattern to find in the PDF. Case-sensitive by default. Each occurrence within the Page Sequence will be replaced.Old Vendor Inc.
New TextYesReplacement text. Inserted in place of every Old Text occurrence with preserved font, color, and size.New Vendor LLC
Page SequenceYesPages 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 NameYesFilename for the modified PDF. Must include the .pdf extension.find_and_replace_output.pdf
Binary Data Output NameYesName of the binary field in the n8n output holding the modified PDF. Used in subsequent workflow nodes.data
AsyncNoEnable 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 Profiles
JSON-format options for advanced replacement behavior — set case sensitivity, whole-word-only matching, or other custom rules.

Page Sequence Patterns

allEntire document
Default. Replace every occurrence across all pages — for global branding updates or terminology standardization.
1,2,3Specific pages
Comma-separated. Update only specific pages — useful for the cover page, signature page, or a known location.
1-5,10-15Page ranges
Hyphenated ranges. Update specific chapters or section blocks while leaving the rest of the document untouched.
1,2,3-7,10Mixed pages + ranges
Combine individual pages and ranges. Maximum flexibility for complex documents like multi-section contracts or technical manuals.

Output Fields

FieldTypeWhat it contains
successBooleanTrue when text replacement completed successfully; false on error.
messageStringHuman-readable status message confirming success or describing the error.
fileNameStringFilename of the modified PDF (e.g. find_and_replace_output.pdf).
mimeTypeStringMIME type of the output — always application/pdf.
fileSizeNumberSize of the modified PDF in bytes.
oldTextStringEcho of the Old Text searched for, for audit and verification.
newTextStringEcho of the New Text replacement applied, for audit and verification.
pageSequenceStringEcho of the page range processed (e.g. "all pages", "1,2,3").

Quick Setup

  1. Add PDF4me to your n8n workflow and select Find and Replace Text as the action.
  2. In Credential to connect with, select your PDF4me credential or create one with your API key.
  3. 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.).
  4. Enter Old Text — the exact text pattern to find in the PDF (e.g. Old Vendor Inc.).
  5. Enter New Text — the replacement text (e.g. New Vendor LLC).
  6. Set Page Sequence — use all for global replacement, or specific pages/ranges like 1,2,3 or 1-5,10-15.
  7. Set Output File Name to your desired filename (with .pdf extension) and Binary Data Output Name to data.
  8. Optionally enable Async for large documents or high-volume processing.
  9. 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.
Bulk vendor-name change after acquisition → update all contracts
  1. After an acquisition, the legal team needs to update every active contract PDF to reflect the new entity name.
  2. A SharePoint Watch Files trigger fires for each contract in the active-contracts folder.
  3. 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.
  4. An additional Find and Replace Text node updates the registered address from the old HQ to the new HQ in the same document.
  5. 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.
Quote PDF personalization → replace customer placeholders
  1. A webhook from the CRM fires when sales generates a new quote PDF from a template.
  2. PDF4me Find and Replace Text runs 4 times in sequence (chained nodes), each replacing one placeholder: {{CUSTOMER_NAME}}, {{TOTAL_PRICE}}, {{VALID_UNTIL}}, {{ACCOUNT_MANAGER}}.
  3. The personalized quote is sent via Gmail to the customer with a dynamic subject line and attachment.
  4. A Salesforce Update Record step attaches the final quote PDF to the opportunity.
  5. An Airtable log records the customer, quote ID, total value, and sent timestamp for sales reporting.
Annual price refresh → update catalog cover pages only
  1. A Schedule Trigger fires on 1 January each year to refresh product catalogs with new pricing.
  2. A Google Drive list step retrieves every catalog PDF in the catalogs folder.
  3. 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).
  4. A second Find and Replace Text node updates the copyright year footer on Page Sequence all.
  5. 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.

Frequently Asked Questions

Does Find and Replace Text preserve formatting and layout in the PDF?+
Yes. The replacement preserves the original font, color, size, and surrounding layout. Each occurrence of Old Text is replaced in place — the same character position, line, and text run. Surrounding text, images, page numbering, and document structure remain untouched. This is fundamentally different from converting a PDF to Word, editing, then converting back — which often shifts layout, breaks formatting, and forces manual cleanup. PDF4me modifies the PDF text stream directly without round-tripping through another format.
Can I find and replace text on specific pages only?+
Yes. The Page Sequence parameter accepts: all (entire document — the default), comma-separated page numbers like 1,2,3, page ranges like 1-5 or 10-15, or mixed combinations like 1,2,3-7,10. This is useful when you want to update only the title page, only specific chapters of a manual, only the cover and signature page of a contract, or only the pricing summary in a quote — and leave the body of the document completely untouched.
Does the find work on scanned PDFs or only on native PDFs?+
Find and Replace Text requires a selectable text layer in the source PDF. Native digital PDFs (created from Microsoft Word, Google Docs, LibreOffice, browser print, InDesign, BI tools, accounting software, etc.) work directly. Scanned or photographed PDFs must first be passed through an OCR step — the n8n node "Convert PDF to Editable PDF Using OCR" adds a searchable text layer over the scanned image, after which this node can find and replace within the text content. Chain the two nodes in sequence: OCR first, then Find and Replace.
Can I replace multiple different text patterns in one workflow run?+
Each Find and Replace Text node handles one find-and-replace pair per execution. To apply multiple substitutions, chain the node multiple times — each instance takes the output of the previous as input. For dynamic per-row substitution lists, use a SplitInBatches or Loop Over Items pattern: feed a list of {oldText, newText} pairs, loop, and call this node once per pair. The final output after the loop is the fully updated PDF with all substitutions applied in order. This pattern is the same one used by Microsoft Word and Adobe Acrobat for multi-replacement macros.
How does this compare to manually editing PDFs in Adobe Acrobat, PDFelement, or Foxit?+
Manual desktop PDF editors (Adobe Acrobat Pro, Foxit PhantomPDF, PDFelement, Nitro PDF, PDF-XChange Editor) require a human to open each file, run Find and Replace, save, and close — typically 1–3 minutes per document plus license fees per editor seat (Acrobat Pro is around $20/month/user). The PDF4me n8n node automates the same task: webhooks, schedules, or folder watches trigger the update across hundreds or thousands of PDFs without manual intervention. Use this for bulk vendor-name changes after acquisitions, branding updates across product catalogs, pricing refreshes on quote PDFs, terminology standardization across legal documents, or any standardization task across many documents. The same automation that would require an admin to spend hours in Acrobat runs end-to-end in seconds in n8n.

Get Help