jsreport recipe which is rendering pdf and images from html using headless chrome
See the docs
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: { ... } }
}
- set chrome protocolTimeout based on reportTimeout
- save generated pdf chrome as file streams to avoid keeping whole pdf in memory
- internal changes to support new
response.output
api
- update puppeteer to work with chrome 116
- minimum node.js version is now
18.15.0
- update studio build against new webpack and babel
- empty values
''
for pdf width, height and other options throw errors on recent versions of puppeteer, we now normalize options and don't pass empty values - set explicit
launchOptions.headless: old
to avoid warnings, for now we use the old headless mode until the new mode gets stable
- use
Studio.openTab
withdocProp
option to open chrome header/footer tabs
- user level logs now use
logger.debug
- threat timeout errors as weak errors
- use url.pathToFileURL to avoid problems with space in file paths for windows
- mark user logs appropriately to the logger
- changes to enable new
trustUserCode
option
- fix not applying the root chrome config
Adaptations for the v3 APIs