简体   繁体   English

使用带有页眉和页脚的 Javascript(客户端)生成 PDF

[英]Generate PDF using Javascript (Client side) with header and footer

Is there any client-side Javascript framework to generate pdf with header and footer from Html content, like some fixed footer on all pages (page 1 of 10).是否有任何客户端 Javascript 框架可以从 Html 内容生成带有页眉和页脚的 pdf,例如所有页面上的固定页脚(第 1 页,共 10 页)。

we tried with html2pdf but it does not have the ability to add header and footer.我们尝试使用html2pdf,但它无法添加页眉和页脚。 is there any similar client-side javascript libraries available with header and footer option to generate pdf?.是否有任何类似的客户端 javascript 库可用于生成 pdf 的页眉和页脚选项?

I think you can use jsPDF for this job, more details about this framework is available in this link of Github: https://github.com/MrRio/jsPDF and for adding the footer and header you can use this library with a callback function to html2pdf.我认为您可以使用 jsPDF 来完成这项工作,有关此框架的更多详细信息可在 Github 的此链接中找到: https : //github.com/MrRio/jsPDF,并且要添加页脚和标题,您可以将此库与回调函数一起使用到 html2pdf。 more details and source code are available in : https://haensel.pro/allgemein/jspdf-html2pdf-loop-through-pages-and-add-content更多细节和源代码可在: https : //haensel.pro/allgemein/jspdf-html2pdf-loop-through-pages-and-add-content

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM