Convert webpage from HTML to PDF?

蓝咒 提交于 2019-12-08 12:51:34

I always use wkhtmltopdf to convert a html page to pdf. (you will need server access to install it though)

It works very well, looks the same as the web site and saves text as actual text (in vectors).

I've used CutePDF's API and they seem to work pretty well.

http://www.cutepdf.com/Solutions/

You can do this in two ways, either handle it on your server or use a third party service.

If you want to convert a html page to a PDF on your server, you can use wkhtmltopdf (A simple shell utility to convert html to pdf using the webkit rendering engine, and qt.) I haven't used it with .NET however have seen many examples.

If you like to use a third-party service www.impdf.com could be used, It's a free service. You do not need to register even. I once have used it but not for a long time( I later switched to wkhtmltopdf get some performance gain).

It depends on your requirements which method you must use. In any case if using impdf is enough for you,

<a href="impdf.com?url=http://www.yourwebsite.com">Convert this page to a PDF</a>

A4 page: impdf.com?url=http://www.yourwebsite.com&--page-size=A4

Letter page: impdf.com?url=http://www.yourwebsite.com&--page-size=Letter

Adobe ColdFusion has a tag called <CFPDF> built in.

http://help.adobe.com/en_US/ColdFusion/10.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7995.html

Furthermore it has web services which which can bridge the gap to ASP.Net

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