Document Tasks
Document tasks are used to generate documents such as invoices, purchase orders, and more.
Render Document
The Render Document
task is used to render a document using a template and data.
Inputs
data
: The data to use to render the document. Required.template
: JSReport template to use to render the document. Required. https://jsreport.net/learn/dotnet-client. --engine
: The template engine to use to render the document. Required. Used javascript templating engine like "jsrender" or "handlebars" --recipe
: The recipe to use to render the document. Required. Used to define the output format of the document like "html", "pdf", "xlsx", "docx", "pptx", "csv", "json", "xml", "txt", "md", "html-to-xlsx", "html-to-xlsx-template", "html-to-xlsx-xlsx-populate", "html-to-xlsx-handlebars --content
: The content of the template to use to render the document. Required. --chrome
: The chrome to use to render the document. Optional. ---landscape
: The landscape to use to render the document. Optional. ---displayHeaderFooter
: The displayHeaderFooter to use to render the document. Optional. ---format
: The format to use to render the document. Optional. ---marginTop
: The marginTop to use to render the document. Optional. ---marginBottom
: The marginBottom to use to render the document. Optional. ---marginLeft
: The marginLeft to use to render the document. Optional. ---marginRight
: The marginRight to use to render the document. Optional. ---width
: The width to use to render the document. Optional. ---height
: The height to use to render the document. Optional. ---pageRanges
: The pageRanges to use to render the document. Optional. ---scale
: The scale to use to render the document. Optional.
Example:
tasks:
- task: "Document/Render"
name: "renderInvoice"
inputs:
template:
engine: "handlebars"
recipe: "html"
content:
$raw: |
<html>
<head>
<title>Invoice</title>
</head>
<body>
<h1>Invoice</h1>
<p>Name: {{name}}</p>
</body>
data: |
{
"name": "John Doe"
}
outputs:
- name: "document"
mapping: "document" # Binary data of the generated document
Outputs
document
: Binary data of the rendered document. Required.