ftos.files.pdf.setPdfType
IMPORTANT!
Starting with v24.3.0, this is renamed from convertToPdfType to ftos.files.pdf.setPdfType.
Starting with v24.3.0, this is renamed from convertToPdfType to ftos.files.pdf.setPdfType.
Converts a PDF file to the PDF/A-1a or PDF/A-1b standard and saves it in the file upload location.
This is a business logic method for business service components.
Syntax
Copy
function ftos.files.pdf.setPdfType(fileRealName: string, pdfType: enum, newFileName: string): string;
| Parameter | Type | Description |
|---|---|---|
fileRealName
|
string | Unique internal ID of the PDF file (real name). |
pdfType
|
enum |
|
newFileName
|
string | File name assigned to the converted PDF. |
Return Value
Returns a string that contains the converted PDF's real name.
Examples
In this example, a server-side script:
- Stores the unique ID of the PDF file passed by the client process in the fileRealName variable. For more information about the workflow context of the client-side process that calls a script, see ftos.context.
- Stores the PDF conformance standard passed by the client process in the pdfType variable.
- Stores the file name that will be assigned to the converted PDF passed by the client process in the newFileName variable.
- Converts the PDF and assigns its real file name to the outputFileName property to be used for subsequent processing. For more information, see ftos.context.propertyBag.set.
Copy
var fileRealName = ftos.context.Data.FileRealName;
var pdfType = ftos.context.Data.PdfType;
var newFileName = ftos.context.Data.NewFileName;
var outputFileName = ftos.files.pdf.setPdfType(fileRealName, pdfType, newFileName);
ftos.context.propertyBag.set('outputFileName', outputFileName);