jsreport recipe converting html into images
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
studio
test
.eslintrc
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
index.js
jsreport.config.js
package-lock.json
package.json

README.md

jsreport-phantom-image

NPM Version Build Status

jsreport recipe which is rendering images from html using phantomjs

Installation

npm install jsreport-phantom-image

Usage

To use recipe in for template rendering set template.recipe=phantom-image in the rendering request.

{
  template: { content: '...', recipe: 'phantom-image', engine: '...', phantomImage: { ... } }
}

jsreport-core

You can apply this extension also manually to jsreport-core

var jsreport = require('jsreport-core')()
jsreport.use(require('jsreport-phantom-image')({ strategy: 'phantom-server' }))

Configurations

  • imageType - png, gif or jpeg, default png
  • quality - quality (1-100) of output image, default 100
  • printDelay - number of ms to wait before printing starts
  • blockJavaScript - block running js on the page
  • waitForJS - see phantom-html-to-pdf - the window variable to set in this case is JSREPORT_READY_TO_START