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.

+3


source to share


1 answer


See https://github.com/MrRio/jsPDF/pull/260

For this purpose you can use HTML elements <header>

and <footer>

for example:



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

      

+4


source







All Articles