ftos.convert.image.toPdf
IMPORTANT!
Starting with v24.3.0, this is renamed from convertImage to ftos.convert.image.toPdf.
Starting with v24.3.0, this is renamed from convertImage to ftos.convert.image.toPdf.
Converts a stored image file to PDF format and saves it to the file upload location.
This is a business logic method for business service components.
Syntax
Copy
function ftos.convert.image.toPdf(sourceRealName: string): string
| Parameter | Description |
|---|---|
sourceRealName
|
Unique internal ID of the image file (real name). |
Return Value
Returns a string containing the saved PDF's real name.
Examples
In this example:
- Convert the
ID_d9bf2c95-ab7d-4acc-befb-4b5d448f09f6.pngfile to PDF format. - Display a notification or alert message at the bottom of the screen after the transaction completes using ftos.context.response.setMessage.
message = ftos.convert.image.toPdf('ID_d9bf2c95-ab7d-4acc-befb-4b5d448f09f6.png');
ftos.context.response.setMessage(message);
The name of the generated pdf file is in the following form: ID_d9bf2c95-ab7d-4acc-befb-4b5d448f09f6_ce7a2b4a-9988-4794-a6eb-9c07c9b5c836.pdf