/jsreport-chrome-pdf

jsreport recipe using headless chrome for the pdf rendering

Primary LanguageJavaScriptGNU Lesser General Public License v3.0LGPL-3.0

jsreport-chrome-pdf

NPM Version Build Status

jsreport recipe which is rendering pdf from html using headless chrome

See the docs https://jsreport.net/learn/chrome-pdf

Installation

npm install jsreport-chrome-pdf

Usage

To use recipe in for template rendering set template.recipe=chrome-pdf in the rendering request.

{
  template: { content: '...', recipe: 'chrome-pdf', engine: '...', chrome: { ... } }
}

jsreport-core

You can apply this extension also manually to jsreport-core

var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-chrome-pdf')())

Troubleshooting

Table with a lot of rows never finish rendering

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.