⚠️ This repository has been moved to the monorepo jsreport/jsreport
jsreport recipe which is rendering pdf and images from html using headless chrome
See the docs
npm install jsreport-chrome-pdf
To use recipe
in for template rendering set template.recipe=chrome-pdf
or template.recipe=chrome-image
according to your needs in the rendering request.
chrome-pdf
{
template: { content: '...', recipe: 'chrome-pdf', engine: '...', chrome: { ... } }
}
chrome-image
{
template: { content: '...', recipe: 'chrome-image', engine: '...', chromeImage: { ... } }
}
You can apply this extension also manually to jsreport-core
var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-chrome-pdf')())
When rendering a table with a lot of rows (>4000) chrome can hang if the html contains a 5 level of tab indentation in the source, the fix for this is to keep the tab indentation bellow 4 levels. you can take a look at the problem here and see how it is fixed by just updating the indentation here.