PDF - Replace Text

** AVAILABLE OCTOBER / NOVEMBER 2024 **

Overview

The 'PDF - Replace Text' flow action provides the capability to search for text fragments within PDF documents and replace with alternative text.

Credit Count

This action consumes 1 credit per operation.

Note, different Encodian actions can consume different number credits. Please always check the action specific documentation and read What is an Encodian Action for a full description of how credits are consumed.

Parameters

The default 'PDF - Replace Text' flow action parameters are detailed below:

  • File Content: A Base64 encoded representation of the PDF file to be processed.
  • Phrases: An array of phrases (See below for further details)

Phrases

For each phrase; the 'Search Text' value will be replaced with the 'Replacement Text' value. By default; Text fragments are located by finding matching instances of the 'Search Text' parameter, to use a regular expression search simply set the 'Is Expression' value to true so that the 'Search Text' parameter will be treated as a regular expression and not a free text search.

Multiple phrases can be included within a single operation. To add more than one phrase click the 'Add new item' button:

  • Phrase
    • Search Text: The text to locate and replace with the 'Replacement Text' value
    • Is Expression:Set whether the 'Search Text' value should be evaluated as a regular expression, the default value is 'false'
    • Replacement Text: The value to replace the 'Search Text' value with
    • Hide Text: Hide the 'Replacement Text' value, it will still be present within the PDF text layer but not visible
    • Font: Specify the name of the font, if the font cannot be found the default 'Arial' font will be used
    • Font - Size: Set the size of the font, the default size is '16'
    • Font - Colour: Set the HTML colour of the font, the default colour is set to '#000000'
    • Font - Background Colour: Set a HTML colour to override the background colour of the font, the default colour is inherited from the document
    • Font - Style: Set the font style for the 'Replacement Text', the default value is 'Regular'
    • Style - Character Spacing: Set the spacing between characters within the 'Replacement Text'
    • Style - Strike Out: Apply a strikeout to the 'Replacement Text'
    • Style - Underline: Apply an underline to the 'Replacement Text'

Font Support

Currently, only standard Windows fonts are supported, please refer to the following article to explore standard Windows fonts: Windows 10 Font List

Expression Creation

We recommend using the https://regexr.com/ site for regular expression creation and testing. 

File Contents

Please refer to the Obtaining the 'File Contents' Parameter article for guidance on how to obtain the 'File Content' parameter ready to provide to an Encodian flow action. 

Return Parameters

The 'PDF - Replace Text' flow action returns the following data. 

Standard Return Values

  • FileContent - The processed PDF document content.
  • OperationId - The unique ID assigned to this operation.
  • HttpStatusCode - The HTTP Status code for the response.
  • HttpStatusMessage - The HTTP Status message for the response.
  • Errors - An array of error messages should an error occur.
  • Operation Status - Indicates whether the operation has been completed, has been queued or has failed.
Have more questions? Submit a request

0 Comments

Article is closed for comments.
Powered by Zendesk