Document Layout Widget - Header height & Content issue

0
I am using Document Layout Widget module to add Header and Footer onto my PDF page (I am using PDF Document Generation moduleto generate the PDF). I have set the height of the Header but it doesn't seem to push any element inside it. The problem appears when the content has more than one page. In the second page, the content would be on top of each other with the Header element. I see no problem like this in the Document Layout Widget module documentation or reviews. Can you please give me a hand on tackling this issue because this is important. Thankyou
asked
2 answers
1

Did you place header and body content inside the widget?

The header and footer must fit inside the height specified on the widget.

answered
0

The only working solution for me was to determine how many items can one page fits (header included, in my case its 25 items for each page including the header). Then, create multiple temporary entities to split every 25 items of the item list (the first 25 would be populated to entity1, 2nd 25 would be populated to entity2 and so on). Next, you would want to create multiple data grids with the temporary entities as their data source and make sure to put page breaks between the data grids (it makes sure every data grid will always be in the same page). Lastly, configure the visibility of the data grids by total item in that particular document (you might want to have one attribute to maintain how many items are there in one document (in my case its a purchase order document) by initiating it after commits). For example: datagrid1 would only be visible if the TotalItem attribute is <= 25, datagrid2 would only be visible if the TotalItem attribute is > 25 and <= 50, and so on. With this last step done, the PDF would not render unnecessary pages containing empty datagrids.

 

*In my case, i can use this method because the maximum items that a document can has is only around 100 items. So only needed to create 4 temporary entities (which was not that too much of a work). Also don't forget to clear the objects inside the temporary entities after the PDF download function, making sure the data is always re-updated every time you intend to download the PDF and not taking unnecessary space.

Hope this helps.

answered