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
總結
以上是生活随笔為你收集整理的html转换pdf软件,html转换成高质量的PDF文件[跨平台开源软件]的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 怎么样查看已安装Win10可升级的版本
- 下一篇: weex web获取html高度,wee