ftos.convert.docx.toPdf
IMPORTANT!
Starting with v24.3.0, this is renamed from convertDocx to ftos.convert.docx.toPdf.
Starting with v24.3.0, this is renamed from convertDocx to ftos.convert.docx.toPdf.
Converts a stored .docx file to PDF format and saves it to the file upload location.
This is a business logic method for business service components.
Syntax
function ftos.convert.docx.toPdf(sourceRealName: string, destinationName: string): string
| Parameter | Description |
|---|---|
sourceRealName
|
Unique internal ID of the .docx file (real name). |
destinationName
|
File name of the saved .pdf file. |
Return Value
Returns a string containing the saved PDF's real name.
Examples
In this example:
- We convert the Contract_e5f638f6-ae58-4336-8ae9-c8f680f7a393.docx file to a file called PDFcontract.pdf.
- We save the real name of the new PDF 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.
message = ftos.convert.docx.toPdf('Contract_e5f638f6-ae58-4336-8ae9-c8f680f7a393.docx', 'PDFcontract');
ftos.context.response.setMessage(message);