HTML2PDF转换 [英] HTML2PDF Conversion

查看:116
本文介绍了HTML2PDF转换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在为Linux和Windows开发软件,要求将CVS文件生成为PDF报告。我用C编写了一个程序,将CVS文件转换为HTML文件(td,tr等),然后使用html2ps将HTML转换为PS,然后在Linux下将ps2pdf转换为PS。然而,正如上面提到的,我们也在为Windows开发,虽然我知道html2ps和ps2pdf在Windows下是可用的,但它们有一些依赖关系会导致我们的客户头疼(即Perl和Ghostscript)。是否有任何原生的Windows控制台应用程序将HTML转换为PDF格式,这些应用程序可以作为单个可执行文件进行分发,而没有主要的依赖关系?

我想添加一个我最近使用的新条目 - wkhtmltopdf - 它是一个开源项目,使用webkit进行渲染,这意味着它具有所有最新和最大的可用功能,包括CSS3,SVG,甚至可以让JavaScript在创建PDF之前运行。它与princeXML没有相同的波兰水平,但它是我找到的最好的FOSS解决方案。



我没有将它用于多页文档但是,我相信它支持css分页符。


We're developing software for both Linux and Windows that requires CVS files to be generated into PDF reports. I've written a program in C to turn the CVS files into HTML files (td, tr etc.) and am then converting the HTML into PS using html2ps and then ps2pdf under Linux.

However as mentioned above we're also developing for Windows and while I'm aware that html2ps and ps2pdf are available under Windows they have a few dependencies which are going to cause headaches for our clients (namely Perl and Ghostscript). Are there any native Windows console applications that will convert HTML into PDF that can be distributed as single executable files with no major dependencies?

解决方案

I would like to add a new entry that I've used recently - wkhtmltopdf - it is an open source project that uses webkit to render, which means that it has all the latest and greatest available including CSS3, SVG, and can even let javascript run before creating the pdf. It doesn't have the same level of polish as princeXML, but its the best FOSS solution I've found.

I haven't used it for multi-page documents yet, but I believe it does have support for css page-breaks.

这篇关于HTML2PDF转换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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