PrinceXML full page background with page numbering

605 Views Asked by At

PrinceXML is really great and powerful but I’m offended by the way it manages header/footer.

I am trying to have 3 columns with different background colours to run on the full page height. Not a problem until you add a footer to include the page’s number.

In order to show the footer you need to add a bottom margin to the @page, but doing so cut the columns. I tried to use an absolute position without any luck.

Is there anyone who has some experience with complex layouts and page numbering with PrinceXML ?

1

There are 1 best solutions below

2
On BEST ANSWER

As a DocRaptor developer, we run into these kinds of problems all the time. Prince headers and footers live INSIDE the page margins. This provides a lot of useful power, but sometimes complicates things, as you've noted.

Without seeing your exact HTML, I'd suggest the following:

  1. Continue experimenting with a zero page margin and absolute positioning and a negative position/margin on the element inside the footer. I think this would work. It might work better if you used a header element. Prince gets weird and buggy on the edges when you do this kind of tricky stuff.
  2. Alternatively, if your column widths are the same for every page/document, try faking the column background colors by using a background-image on @page.