Adding fixed header / footer for every jsPDF page

I am using jsPDF to generate PDF from dynamic HTML content of my web application. Right now I'm trying to give them a PDF with a unique layout. I want to add a "header" and "footer" for each page of my PDF file. jsPDF automatically generates page breaks and there is no command on them.

Is there any known work-around to implement a fixed header / footer for each page without depending on doc.addPage ();

Looking forward to any help or ideas.


source to share

1 answer


For this purpose you can use HTML elements <header>

and <footer>

for example:

    <div style='text-align:center;'>Page <span class="pageCounter"></span>/<span class="totalPages"></span></div>




All Articles