ftos.files.pdf.replaceTokens

IMPORTANT!  
Starting with v24.3.0, this is renamed from replaceTokens to ftos.files.pdf.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.

This is a business logic method for business service components.

Syntax

function ftos.files.pdf.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