Multiple pages with header and footer different for each page : issue

2,712 views
Skip to first unread message

jdias

unread,
Jul 8, 2020, 11:42:03 AM7/8/20
to wkhtmltopdf General
I have a multipage document in html. The document is formatted as below: 

    div.page {
        page-break-after: always;
        height: 100%;
        min-height: 100%;
    }
    footer {
        clear: both;
        position: absolute;
        bottom: 0;
        margin-top: auto;
        width: 100%;
    }


<div class="page">
   <header>My header....</header>
   <div>My Content</div>
   <footer>Page 1 of 2</footer>
</div>
<div class="page">
   <header>My header....</header>
   <div>My Content</div>
   <footer>Page 2 of 2</footer>
</div>

This should print 2 pages with header and footer (footer different for each page).
But the footers appear only one, overlapped in the last page.

What is the best way to have multiple pages with headers and footers different for each page?


Linas T.

unread,
Jul 8, 2020, 3:04:42 PM7/8/20
to wkhtmltop...@googlegroups.com
Hi, 

Always mention environment, versions, etc. 

Pagarbiai,
Linas T.

--
===================================================
You received this message because you are subscribed to the "wkhtmltopdf General" group.
To post to this group, send email to wkhtmltop...@googlegroups.com
To unsubscribe from this group, send email to wkhtmltopdf-gen...@googlegroups.com
 
For more options, visit this group at
http://groups.google.com/group/wkhtmltopdf-general?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups "wkhtmltopdf General" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wkhtmltopdf-gen...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wkhtmltopdf-general/3c566849-637e-45ed-84ab-9c7e3ee53b2co%40googlegroups.com.

jdias

unread,
Jul 9, 2020, 4:09:47 AM7/9/20
to wkhtmltopdf General
Versions and etc:

Version: wkhtmltopdf 0.12.6 (with patched qt)
OS: Windows 10 Pro
in command-line prompt.

jdias

unread,
Jul 9, 2020, 8:55:26 AM7/9/20
to wkhtmltopdf General
I resolved this changing the css and html... I inserted the footer after the div.page (for each page) and set footer css accordingly...
After that I run wkhtmltopdf and the result was the expected.

Thank you.
Reply all
Reply to author
Forward
0 new messages