Skip to content

Replace Text Pdf Action: replaceTextPdf

The replaceTextPdf action is used to locate and replace specific text within a PDF file. It enables automated text updates in PDF documents by replacing the old value with a new value based on a given search term.

Example: You have a contract template stored as a PDF with placeholders for client information, such as “Client Name:” and “Date:”. You want to replace these placeholders with actual client details.

Steps to Configure:

  1. Add a new step.
  2. Select Set a Variable Value from the Action dropdown.
  3. Enter a variable name in Element Key (e.g., UpdatedPDFPath). This variable will store the path to the updated PDF file.
  4. Click on Form, select Functions, and choose PDF File Handler Functions.
  5. In the Cmd field, select replaceTextPdf and provide the following parameters:
    • FPath: Specify the path to the PDF file where the text replacement will be performed (e.g., C:\Contracts\Template.pdf).
    • searchTerm: Define the term that serves as the basis for locating the text to be replaced (e.g., Client Name:).
    • oldValue: Specify the original text to be replaced (e.g., Client Name: [Placeholder]).
    • newValue: Enter the new text that will replace the old value (e.g., Client Name: John Doe).
  6. Click Save.
scrn-replace-text-pdf-command-tabular-view
Tabular View
scrn-replace-text-pdf-command-card-view
Card View

Outcome on execution:

  • All occurrences of “Client Name: [Placeholder]” in the PDF file will be replaced with “Client Name: John Doe”.
  • The updated PDF file’s path will be stored in the variable defined in the Element Key field for further use in automation workflows.

    Match the text exactly.
    The searchTerm and oldValue are case-sensitive. Make sure they match the text in the PDF, including capitalization and spacings.

  • This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${UpdatedPDFPath}).

Back To Top