Advertisement
Guest User

Untitled

a guest
Dec 9th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. var jsreport = require('jsreport-core')()
  2.  
  3. jsreport.init().then(function () {
  4. return jsreport.render({
  5. template: {
  6. content: '<h1>Hello {{:foo}}</h1>',
  7. engine: 'jsrender',
  8. recipe: 'phantom-pdf'
  9. },
  10. data: {
  11. foo: "world"
  12. }
  13. }).then(function(resp) {
  14. //prints pdf with headline Hello world
  15. console.log(resp.content.toString())
  16. });
  17. }).catch(function(e) {
  18. console.log(e)
  19. })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement