Quantcast
Channel: User Mohamed Mufeed - Stack Overflow
Viewing all articles
Browse latest Browse all 36

How can I push the footer to the next page if the content overlaps it in mpdf?

$
0
0

Technicaly, I know how to set the html footer in mpdf, but I have an issue that I can't get around with.

I am generating an invoice. The invoice have an items table which can vary in the number of items. In the last page(ie. after the items table) of the invoice I am setting a page-footer whith the company consent and a signature field. So that the block containing these two goes at the end of the current page(about 70mm in height). It does'nt nesessarily need to be a footer; a fixed block also works(but the same issue applies).

The Issue

When the list items is relatievly small it works perfectly well as expected; Also, when the list items is more. But, when the list item is in a range the content overlaps.

Currently I have tried:

Option 1Set the block using a fixed position at the bottom.
Issue: The same.

Option 2Increase the margin-bottom to 70mm.
Issue: The overlapping is fixed, however when the content is more and needs to have two or more pages worth of items - it leaves so much(70mm) of blank spaces in the previous pages.

Option 3Set the setAutoBottomMargin to stretch
Issue: The same. (Can't feel any difference)

Option 4Set a named page reserved for the last page.
Issue: The named page is not working on the first page. ie. It always have a second page. So even when the content is small it takes atleast two pages.

What I expect it to behave like

  • when the content is small. Push this block to the end of the current page.
  • when the content is in the range fill up the available spaces. and push this block to the next page.

Note: I am using <sethtmlpagefooter> as the last tag to set the footer for the page at runtime.

Can anybody help me?

If you require any image samples of the current outputs I can provide them. But I think this is a pretty common requirement and somebody would already have figured this out.

If my explaination is off. Please let me know, I can provide more info if needed.

Thank you


Viewing all articles
Browse latest Browse all 36

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>