0
我正在使用jsreport(通過npm)使用phantom-pdf配方從HTML呈現PDF。jsreport with phantom-pdf recipe:如何設置格式,邊距,方向等基本設置?
渲染是通過HTTPS調用開始:
...和POST數據是這樣的一個字符串:
{
"template": {
"content": /*...my HTML content template to render...*/,
"recipe": "phantom-pdf",
"engine": "handlebars"
},
"data": /*json string with data to pass to the template*/
}
我知道有基本的設置爲幻影pdf(邊距,格式,寬度,高度,方向,printDelay,waitForJS),但我不明白在哪裏把他們: - 在HTML模板? - 在jsreport的dev.conig.json文件中? - 在一個單獨的文件?
...以及如何?
預先感謝您!
謝謝。如果我想用模板存儲這些設置,我該怎麼辦? –
我不明白這個問題。您只需在jsreport studio中按下保存按鈕,並保存這些設置。 –
那是因爲我不能使用jsreport studio。我必須手動編輯模板文件。謝謝 –