jsreport with phantom-pdf recipe: how / where to set basic settings like format, margin, orientation...? -


i'm using jsreport (through npm) render pdf html using phantom-pdf recipe.

rendering started via https call:

https://127.0.0.1/api/report

...and post data string one:

{  "template": {     "content": /*...my html content template render...*/,     "recipe": "phantom-pdf",     "engine": "handlebars"      }, "data": /*json string data pass template*/ } 

i know there basic settings phantom-pdf (margin, format, width, height, orientation, printdelay, waitforjs), didn't understand put them: - in html template? - in dev.conig.json file of jsreport? - in separate file?

...and how?

thank in advance!

you can send these settings part of api request body, inside template.phantom property.

{    "template": {     "content": /*...my html content template render...*/,     "recipe": "phantom-pdf",     "engine": "handlebars",     "phantom": { "margin": "5cm" }   },   "data": { "foo": "hello" } } 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -