[Node.js] node-wkhtmltopdf を使う

Node.js で wkhtmltopdf を使う方法をメモ。
(最終更新日:2014/11/28)

node-wkhtmltopdf

A Node.js wrapper for the wkhtmltopdf command line tool.

wkhtmltopdf

ということで、npm module だけだと使えないので wkhtmltopdf はインストールする必要があります。

wkhtmltopdf のインストール

# the wkhtmltopdf formula is now inactive but still available in the boneyard repository
brew tap homebrew/boneyard
 
# Install wkhtmltopdf
brew install wkhtmltopdf

wkhtmltopdf コマンドで、PDFを生成できることを確認します。

wkhtmltopdf "http://google.com" google.pdf

以上です。