Generate PDF
Allows to generate one or more PDF files. For each PDF file that must be generated an HTML input file is expected.
Json
Example
json
{
"name": "file-generation-pdf",
"taskReferenceName": "pdf_generation",
"description": "Generate a pdf from a html file",
"type": "SUB_WORKFLOW",
"optional": false,
"inputParameters": {
"mode": "FILE",
"file": "${file_transformation_html.output.file}",
"rootFolder": {
"path": "file://assets/Generate-PDF/",
"exclude": [
"input.xml",
"test.html"
]
},
"settings": {
"width": "210mm",
"height": "297mm"
}
}
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Definition
Property | Type | Required | Description |
---|---|---|---|
The name (or type) of the task | |||
The unique name of the task in your job. It is used to reference this task in the workflow. | |||
The functional description of this task in your job. | |||
The type of the task. It must be SUB_WORKFLOW . | |||
true : the job continues if there is an error on this task. false : the job fails. | |||
Input parameters of the task. See below |
Inputs
Property | Description |
---|---|
mode | Enum FILE |
file | A valid input in HTML format. It can reference the output of a previous task, example: ${previous_taskReferenceName.output.file} , or a static file, example: file://assets/file.xml , or a user input, example: ${workflow.input.input_key} . |
files | A valid input where each file is an HTML file. It can reference the output of a previous task, example: ${previous_taskReferenceName.output.files} , or a user input, example: ${workflow.input.input_key} . |
rootFolder | optional If you reference files in the asset folder in your HTML, you must indicates the folder in the folder that is containing the files referenced. |
rootFolder.path | The path of the folder. It must starts with file://assets/ |
rootFolder.exclude | optional If your folder contains files that must not be used during the PDF generation, you must reference them here, otherwise they will be downloaded each time you create a PDF. |
settings | The settings of the print document |
settings.width | The width of the document. It can be set in mm or in cm. |
settings.height | The height of the document. It can be set in mm or in cm. |
Input file
| files
Example
html
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>products.pdf</title>
<style>
body {
margin: 0;
padding: 0;
font-family: 'Lucida Sans', sans-serif;
}
</style>
</head>
<body>
Hello pdf world!
</body>
</html>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Definition
It must be a valid HTML file or an array of HTML files. Each HTML file must contain a <Title>
element, this is element is used for the output file name of the generated PDF file.
You can use assets referenced in the assets folder. You must reference them relatively to the assets folder. See tutorials for more informations.
Outputs
Property | Type | Description |
---|---|---|
files | The files generated. | |
listing | An xml file representing the list of the temporary files. | |
allFilesGenerated | YES | NO . YES : all files have been generated successfully. NO : at least one file has not been generated. |
Output listing
Example
xml
<Files>
<File>
<Url>https://app.product-live.com/files-data-factory/d05a74cf11788d8f3ae9bf0e0e028dde66g0c83005c5e0d1211b0069945c0c11</Url>
<File-Name>products-1.xlsx</File-Name>
</File>
<File>
<Url>https://app.product-live.com/files-data-factory/fb26911d77fe9a9dc45b111eef5b5db7ca2019c8038445662f29b20c54cb6f29</Url>
<File-Name>products-2.xlsx</File-Name>
</File>
</Files>
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
Definition
XPath | Description | Occurs |
---|---|---|
Files | Root of the document. | 1 |
./File | For each file. | 0..* |
./File/Url | The url of the temporary file. | 1 |
./File/File-Name | The file name. | 1 |
Limits and additional notes
- The limitation of files created is 50.