使用JavaScript从HTML创建PDF文档 [英] Create PDF document from HTML using JavaScript
问题描述
我想用JavaScript用HTML创建PDF文档.我尝试使用库jsPDF
,但其中不支持所有HTML格式.还有其他可以用来创建PDF的库吗?
I want to create a PDF document from HTML in JavaScript. I tried using the library jsPDF
but all the HTML formatting are not supported in it. Is there any other library that I can use to create the PDF?
推荐答案
我刚刚编写了一个名为jsPDF的库(请给您下面的链接),该库仅使用Javascript即可生成PDF.它仍然很年轻,我将很快添加功能和错误修复.对于不支持数据URI的浏览器中的解决方法,也有一些想法.它是根据MIT的宽松许可证获得许可的.
I've just written a library called jsPDF (Give you the link below) which generates PDFs using Javascript alone. It's still very young, and I'll be adding features and bug fixes soon. Also got a few ideas for workarounds in browsers that do not support Data URIs. It's licensed under a liberal MIT license.
在我开始写这个问题之前,我曾遇到过这个问题,并以为我会回来告诉你:)
I came across this question before I started writing it and thought I'd come back and let you know :)
http://code.google.com/p/jspdf/
http://hayageek.com/generate-pdf-with-javascript///尝试逐步执行此链接
http://hayageek.com/generate-pdf-with-javascript/ //Try this link with step by step process
这篇关于使用JavaScript从HTML创建PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!