Template options:
template: {
content: templateString,
engine: 'handlebars',
recipe: 'chrome-pdf',
chrome: {
waitForJS: true
}
},
Template string content:
<html>
<head>
<head>
<script>
// do some calculations or something async
setTimeout(function() {
window.JSREPORT_READY_TO_START = true; //this will start the pdf printing
}, 500);
</script>
</head>
</head>
<body>
<script>
// do some calculations or something async
setTimeout(function() {
window.JSREPORT_READY_TO_START = true; //this will start the pdf printing
}, 500);
</script>
</body>
</html>
Works when waitForJS: false, but not when true. Am I missing something or do the triggers just not work? It seems like I have copied exactly how it is shown in documentation and yet no changes, just get console message 'Chrome will wait for printing trigger ' and nothing happens. Want to see if perhaps I missed something in the documentation or if I should just use the chromium print directly myself.