トップページ | 過去記事(月別カテゴリー別) | 掲示板 | 野良DEB,RPM | 更新チェック | Twitter
<<  2013.1  >>
SMTWTFS
  12345
6789101112
13141516171819
20212223242526
2728293031  
 
リンク
その他
  • RSS2.0
  • Credit

  • SEO
    loading

    プライバシーポリシー
    Google

カテゴリー » Linux » ソフト紹介 January 27, 2013

wkhtmltopdf - Convert html to pdf using webkit (qtwebkit) Linux

http://code.google.com/p/wkhtmltopdf/

HTMLをPDFに変換するコマンドです。Windows、Mac OSX、Linuxに対応しています。

Ubuntu(Debian)の公式リポジトリにパッケージがありますが、機能が制限されているので、配布元の「Static Binary」を使ったほうがいいかもしれません。
$ sudo apt-get install wkhtmltopdf
$ wkhtmltopdf --help
... Reduced Functionality: This version of wkhtmltopdf has been compiled against a version of QT without the wkhtmltopdf patches. Therefore some features are missing, if you need these features please use the static version.
Currently the list of features only supported with patch QT includes:
* Printing more then one HTML document into a PDF file. * Running without an X11 server. * Adding a document outline to the PDF file. * Adding headers and footers to the PDF file. * Generating a table of contents. * Adding links in the generated PDF file. * Printing using the screen media-type. * Disabling the smart shrink feature of webkit.
それと、現在の最新版(v0.11.0 rc1)には、セグメンテーション違反で異常終了する不具合があるみたいです。
$ wkhtmltopdf http://www.yahoo.co.jp/ output.pdf
QPixmap: Cannot create a QPixmap when no GUI is being used
[1] 18202 segmentation fault ./wkhtmltopdf http://www.yahoo.co.jp/ output.pdf 

【追記】
Windows用のGUIフロントエンドを作っている人がいました。
Web2Pdf - Convert webpages to pdf ebooks

【参考】
WebKitを使ったHTML2PDF「wkhtmltopdf」- MOONGIFT
wkhtmltopdfでPDFを簡単作成 — そこはかとなく書くよん。
PHP から PDF作成 (wkhtmltopdf) - MEGMiLK の思い出
11:58 pm | コメントする |

上の記事に対するコメント

1. pollux  2013/02/12 17:17
使ってみてちょっと気に入ったので、Fedoraに追加しました(たまたまレビューする人がすぐ見つかって通りました)。F-18/17にはtesting repositoryに数日で入ると思います。
https://bugzilla.redhat.com/show_bug.cgi?id=909808
http://koji.fedoraproject.org/koji/packageinfo?packageID=15470


累計:2870257、今日:430、昨日:723
Created in 0.0072 sec.