html转换pdf软件,html转换成高质量的PDF文件[跨平台开源软件]

Convert HTML Page To a PDF Using Open Source Tool [ Linux / OS X / Windows ]

http://www.cyberciti.biz/open-source/html-to-pdf-freeware-linux-osx-windows-software/

项目中需要用到html 转成 pdf的组件,需要支持html中css和js效果的渲染支持。

一周时间内测试了TCPDF/mpdf/html2fpdf/prince/prawn等数个组件,其中prince的转换效果稍稍出众,但是css渲染有一些问题,而且是收费软件,TCPDF功能强大,页头页尾均很好的支持,但对代码高亮等特殊的js效果处理得不到位。

直接周末找到了wkhtmltopdf。

先介绍一下大体功能

跨平台:Cross platform.

开源:Open source.

支持webkit引擎渲染页面:Convert any web pages into PDF documents using webkit.

页头页尾支持:You can add headers and footers.

创建TOC:TOC generation.

命令行执行,方便其它程序调用:Batch mode conversions.

可以运行在XServer下:Can run on Linux server with an XServer (the X11 client libs must be installed).

PHP的libwkhtmltox组件支持,嘎嘎,phper最爱:Can be directly used by PHP or Python via bindings to libwkhtmltox.

原文作者花了大面积的篇幅介绍如何安装使用,我就不多说了,安装简单,一分钟内安装完成。

[shell]

sudo apt-get install wkhtmltopdf

wkhtmltopdf http://www.baidu.com/index.php baidu.pdf

[/shell]

https://github.com/antialize/wkhtmltopdf

https://github.com/mreiferson/php-wkhtmltox

http://www.cs.au.dk/~jakobt/libwkhtmltox_0.10.0_doc/pagesettings.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值