Forum How do I...?

Rich header and footer

Morten
I am trying to create a rich header that consists of a logo, an address line and a right-aligned "Page x of y".

I get the html to display as expected when I view the page in a browser, but when I generate the pdf, I only get the logo. Can you please help me back on the right track?

I have attached a screenshot of the header in a browser, the same header in pdf and the source html doc.
  1. HtmlHeaderSnip.PNG12.2 kB
    Header screenshot from browser (html)
  2. PdfHeaderSnip.PNG16.6 kB
    Header screenshot from pdf
  3. test.html155.1 kB
    Source html
dauwhe
Changing the divs inside the header div to spans helps.
  1. test.pdf131.9 kB
Morten
Indeed it did :)

Why?
dauwhe
My guess is that the margin content was all there, iin the line after the image, but there wasn't room to display it.
Morten
Thanks, dauwhe

I tested now by giving more room for the @top area, but if I have the header content as divs it doesn't show, while if I have it as spans it shows, just as you showed previously.

So lack of space doesn't seem to be the reason.

Anywho, I will continue to try to get a rich header.

Thanks.
  1. PdfHeaderSnip-moreheaderspace.PNG13.6 kB
    Header screenshot from pdf - more space
  2. test.html155.1 kB
    Source html

Edited by Morten

mikeday
Is it necessary to have the margin-top and margin-bottom inside @top? That takes up 2.5cm of the margin box, leaving only 1.5cm remaining for the actual content.
Morten
Yes, at least the 1.5 cm top margin is necessary, because the header needs to fit in an envelope window, so if it is squished together right at the top, it will miss the window.

I increased the page top margin to 10cm, and low and behold, the content was there even with divs. It just had more spacing than I thought. But now I have something to work with.

Thanks.