Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7419199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T08:01:13+00:00 2026-05-29T08:01:13+00:00

I am using wkhtmltopdf to create PDF reports from HTML, I need to create

  • 0

I am using wkhtmltopdf to create PDF reports from HTML, I need to create a custom report that follows this pattern:

  1. Some information at the top of the first page.
  2. A table that can have 1 to n rows (it should use any amount of pages it needs)
  3. Some information at the end of the last page.

Putting all this together does the trick; however because step 3 info appears immediately after the table, is there a way to put the content at the end of the page?

I am not even sure if this solution is CSS based or wkhtmltopdf based.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T08:01:15+00:00Added an answer on May 29, 2026 at 8:01 am

    http://madalgo.au.dk/~jakobt/wkhtmltoxdoc/wkhtmltopdf-0.9.9-doc.html

    Take a look at “Footers And Headers” section.

    You can use --footer-html combined with some JavaScript to do this.

    wkhtmltopdf --footer-html footer.html http://www.stackoverflow.com/ so.pdf
    

    I based the contents of my footer.html on the example provided in the link above:

    <!DOCTYPE html>
    
    <script>
    window.onload = function() {
        var vars = {};
        var x = document.location.search.substring(1).split('&');
        for (var i in x) {
            var z = x[i].split('=', 2);
            vars[z[0]] = unescape(z[1]);
        }
    
        //if current page number == last page number
        if (vars['page'] == vars['topage']) {
            document.querySelectorAll('.extra')[0].textContent = 'extra text here';
        }
    };
    </script>
    
    <style>
    .extra {
        color: red;
    }
    </style>
    
    <div class="extra"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am converting some docs to pdf using wkhtmltopdf (currently using perl and the
I'm currently building a class in PHP that generates PDF documents using the WKHTMLTOPDF
I am using wkhtmltopdf(html to pdf converter) and am running it through a php
I'm using wkhtmltopdf on my server to transfer HTML document to PDF. It works
A have created a pdf file from an .aspx page using the wkhtmltopdf converter.
Using C#, I need a class called User that has a username, password, active
I installed wkhtmltopdf using sudo apt-get install wkhtmltopdf I have a php script that
Having a problem with wkhtmltopdf. I'm using it to take pdf snapshots of pages
I want to generate PDF from a html doc in a rails app. So
Using report builder 3.0, I have a report that queries a cube. How do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.