Can pdf-utils be used via http?
-
I'm using jsreport via HTTP requests, is there a way to specify pdf-utils settings from a http request to a jsreport server? I'm using chrome-pdf recipe and I need this because I need to center a pdf header but native headers css
text-align: center;
don't center the content of headerTemplate.
Any ideas or I'm missing something?
-
yes, it is possible.
you can specify it like this (add this to your json):
{ "template": { ... "pdfOperations": [ { "type": "merge", "templateShortid": "shortidoftemplate", "renderForEveryPage": true } ] ... } }
if you want to do other kind of operations just modify the "type", also when you have doubts about how to define something in json, you can inspect how the jsreport studio send the json request using the network panel of browser dev tools.
-
Thank you @bjrmatos, and thanks too for the advice of inspect with the browser tools.