ftos.convert.base64.toPdf
IMPORTANT!
Starting with v24.3.0, this is renamed from getPDFDocumentFromBase64 to ftos.convert.base64.toPdf.
Starting with v24.3.0, this is renamed from getPDFDocumentFromBase64 to ftos.convert.base64.toPdf.
Uploads the contents of a file encoded using the Base64 scheme to the file upload location using a specified file name.
This is a business logic method for business service components.
Syntax
function ftos.convert.base64.toPdf(fileName: string, base64Contents: string): string
| Parameter | Description |
|---|---|
fileName
|
Name of the saved file, including the file extension. NOTE Supported file extensions are defined in the FileUploadWhiteList key in the Configuration Manager. |
base64Contents
|
File contents encoded using the Base64 scheme. |
Return Value
Returns a string containing the saved file's real name.
Examples
In this example:
- We extract the Base64 encoded contents of the the Contract_60c49fa3-e1f2-4ff8-bdfb-56c433e33ebf.docx file. For details, see ftos.files.download.
- We save the contents under a new file called Contract_copy.docx.
- We save the real name of the copy file in a variable called message.
- We display the message variable on screen. For details on how to display messages, see ftos.context.response.setMessage.
var message = ftos.convert.base64.toPdf('Contract_copy.docx', ftos.files.download('Contract_60c49fa3-e1f2-4ff8-bdfb-56c433e33ebf.docx'));
ftos.context.response.setMessage(message);