如何使用jquery从html5 div生成pdf文件 [英] how to generate pdf file from html5 div using jquery

查看:107
本文介绍了如何使用jquery从html5 div生成pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个包含背景图片,徽标,桌子的div。



我的要求是我必须使用这个div生成pdf文件并作为邮件发送。

我必须发送pdf文件和div背景。



使用jquery。



任何人都可以建议我...



谢谢你

Hi,

I have a div wich contains background image,logo,table.

My requirement is I have to generate pdf file using this div and send as mail.
I have to send the pdf file along with div background.

using jquery.

Any one can suggest me...

Thank u

推荐答案

jsPDF [ ^ ]似乎是使用 pdfs 的插件> jQuery 。



你可以尝试一下。
jsPDF[^] seems to be the plug-in to download pdfs using jQuery.

You can have a try.


我想说,这不是最好的主意。为什么不发送HTML呢?更少的麻烦,更灵活和更充分的格式,特别是如果你已经有HTML,此外,HTML是由所有非废话邮件程序直接呈现,PDF不是,并且甚至可能没有安装PDF查看器。



但是,如果您仍然需要它,您可以使用iText或其.NET端口,iTextSharp:

http://en.wikipedia.org/wiki/IText [ ^ ],

http://itextpdf.com/ [ ^ ],

http://sourceforge.net/projects/itextsharp/ [ ^ ]。



我也提供了iText的链接,因为大多数文档都是针对Java的,但你可以很容易理解。



-SA
I would say, this is not the best idea. Why not sending HTML instead? Less trouble, more flexible and adequate format, especially if you already have HTML, besides, HTML is directly rendered by all non-nonsense mail programs, PDF is not, and a PDF viewer may not be even installed.

However, if you still need it, you can use iText, or its .NET port, iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

I provided the link to iText as well, as most documentation is for Java, but you can easily understand it.

—SA


这篇关于如何使用jquery从html5 div生成pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆