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/
項(xiàng)目中需要用到html 轉(zhuǎn)成 pdf的組件,需要支持html中css和js效果的渲染支持。
一周時(shí)間內(nèi)測(cè)試了TCPDF/mpdf/html2fpdf/prince/prawn等數(shù)個(gè)組件,其中prince的轉(zhuǎn)換效果稍稍出眾,但是css渲染有一些問(wèn)題,而且是收費(fèi)軟件,TCPDF功能強(qiáng)大,頁(yè)頭頁(yè)尾均很好的支持,但對(duì)代碼高亮等特殊的js效果處理得不到位。
直接周末找到了wkhtmltopdf。
先介紹一下大體功能
跨平臺(tái):Cross platform.
開(kāi)源:Open source.
支持webkit引擎渲染頁(yè)面:Convert any web pages into PDF documents using webkit.
頁(yè)頭頁(yè)尾支持:You can add headers and footers.
創(chuàng)建TOC:TOC generation.
命令行執(zhí)行,方便其它程序調(diào)用:Batch mode conversions.
可以運(yùn)行在XServer下:Can run on Linux server with an XServer (the X11 client libs must be installed).
PHP的libwkhtmltox組件支持,嘎嘎,phper最?lèi)?ài):Can be directly used by PHP or Python via bindings to libwkhtmltox.
原文作者花了大面積的篇幅介紹如何安裝使用,我就不多說(shuō)了,安裝簡(jiǎn)單,一分鐘內(nèi)安裝完成。
[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
總結(jié)
以上是生活随笔為你收集整理的html转换pdf软件,html转换成高质量的PDF文件[跨平台开源软件]的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 怎么样查看已安装Win10可升级的版本
- 下一篇: weex web获取html高度,wee