Search code examples
htmlcsswkhtmltopdf

wkhtmltopdf - Aligning logo to bottom without using a footer


I want to add a logo at the bottom of the very first page. Ideally I'd position:absolute it bottom:0 - but anything positioned to the bottom in wkhtmltopdf doesn't seem to work.

This is a problem because the logo is dynamic and could have different heights depending on the aspect-ratio of the uploaded image.

I see that I can add a footer, but this adds it to all pages, and I only want this on one page.

What are my options? Do I have to position-absolute it from the top? If so, what if the page size changes? This needs to work in A4 and US Letter.


Solution

  • I was having the same issue and solved by actually adding a width to the element. So, for the element I want to stick to the bottom I have this css:

    .footer {
      position: absolute;
      bottom: 0;
      width: 100%;
    }