Skip to content

Instantly share code, notes, and snippets.

@iktakahiro
Created January 21, 2014 12:42
Show Gist options
  • Save iktakahiro/8539297 to your computer and use it in GitHub Desktop.
Save iktakahiro/8539297 to your computer and use it in GitHub Desktop.
wkhtmltopdf でHTMLをPDF化する際の良い感じのオプション ref: http://qiita.com/iktakahiro/items/a9d993ddfdbc3404deba
# ヘッダ右側に日付、フッタ中央にページ番号、マージンを調整
/usr/local/bin/wkhtmltopdf \
--print-media-type \
--header-right [date] \
--header-spacing 2 \
--footer-center [page]/[topage] \
--footer-spacing 2 \
--margin-top 12 \
--margin-right 5 \
--margin-left 5 \
--margin-bottom 12 \
sample.html sample.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment