Sync orientation of header with document using pdfUtils
-
Dear jsReport Team,
- There is one Header i use for all documents. The documents are
landscaped
dynamically by the api call. - I need the header to change orientation if the document does
What i did so far is hand over a variable from the document to the header:
Header: <script> window.JSREPORT_CHROME_PDF_OPTIONS = { landscape: {{getOrientation this}} } </script> function getOrientation(page){ return page.items[0] } Document: {{{pdfAddPageItem true }}}
Of course this way the header is always landscaped. So I was searching for a document parameter to change true dynamically. I investigated
@root
but there is only my data and
$resources,$resource,$localizedResources,$localizedResource,__appDirectory,__rootDirectory,__parentModuleDirectory
Thank you for any kind of workaround.
Cheers,
Clausfyi:
- There is one Header i use for all documents. The documents are
-
How about passing the landscape information through the main data using custom script.
See demo here
https://playground.jsreport.net/w/anon/tApz4jtt
-
Thank you jan.
It's working great. :)