简体   繁体   中英

PrinceXML full page background with page numbering

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 ?

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM