replaceTokens

Replaces all occurrences of a specified text string from a stored PDF file and saves the resulting PDF file in the file upload location.

Syntax

function replaceTokens(sourceRealName: string, destinationName: string, searchText: string, replacementText: string, textOptions: any): string
 
Parameter Description
sourceRealName Unique internal ID of the source PDF file (real name).
destinationName File name assigned to the resulting PDF.
searchText Text string to be replaced.
replacementText Text string to replace with.
textOptions Optional JSON object for text formatting:
{'fontColor' : string, 'fontName' : string, 'fontSize': number}
IMPORTANT!  
Use the backslash (\) escape character before any special characters you wish to include in your text strings (\\, \', \" etc).

Return Value

Returns a string containing the resulting PDF's real name.

Examples