convertToPdfType
Converts a PDF file to the PDF/A-1a or PDF/A-1b standard and saves it in the file upload location.
Syntax
Copy
function convertToPdfType(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 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 setProperty.
Copy
var fileRealName = context.Data.FileRealName;
var pdfType = context.Data.PdfType;
var newFileName = context.Data.NewFileName;
var outputFileName = convertToPdfType(fileRealName, pdfType, newFileName);
setProperty('outputFileName', outputFileName);