pdf utils: pass value from main-template to header
I have a invoice template and I want to pass the invoice-id to the header to print it on every page. And I can pass the value with handlebars like this to pdf-utils:
But I don't understand how to access this value on the header template?
It should be accessible like $pdf.pages[x].items[y]. What stands x and y for?
I tried 0 and 0 because it is on page 1 and it is the first (and only) item I add with pdfAddPageItem. So I added this to the header template:
But I think I'm getting something wrong here...
Should be a rather simple task, I geuss.
I got it working.
The correct syntax is:
But the funny thing is, the assignment of a value does not always work. The pdfAddPageItem above does not work. But if I put it a few lines later after a $localizedResource it works: