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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -