Adding a fixed header/footer for each page jsPDF

删除回忆录丶 提交于 2019-12-23 12:08:33

问题


I am using jsPDF to generate PDF's out of dynamic HTML content of my web-application. Right now I am trying to give those PDF's a unique layout. I want to add a "header" & "footer" for each page of my PDF. jsPDF generates page breaks automaticly and there is no command to act on those.

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

Looking forward for any help or ideas.


回答1:


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

You can use HTML's elements <header> and <footer> for that purpose, for example:

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


来源:https://stackoverflow.com/questions/25989285/adding-a-fixed-header-footer-for-each-page-jspdf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!