scottvonduhn
11/06/2020, 5:25 PMeminero
11/06/2020, 5:35 PMvar renderer = render.create();
renderer.templateContent = file.load({ id: ScriptVariables.TemplateID }).getContents();
renderer.addCustomDataSource({
alias: 'some_name_variable',
format: render.DataSource.OBJECT,
data: object_with_values_expected_on_template
});
I created my own HTML file using the Advanced PDF syntax, uploaded to the file cabinet, then I passed the data expected using the .addCustomDataSource
It will work similar to handlebar or other template libraries
You can then do:
renderer.renderAsPdf()
and create a file or whatever you need with the content.scottvonduhn
11/06/2020, 6:08 PMscottvonduhn
11/06/2020, 6:09 PM