No Description

Ashish Kulkarni 03c001de25 improvements in the linux build script 11 years ago
examples 015c6facf4 Fixed spelling mistake in comment 12 years ago
include 62c8b795f3 regenerate the public headers 11 years ago
qt @ 0ec3313ddf ba338c4866 update to rebased wk_4.8.5 branch for fixing 64-bit windows build 11 years ago
scripts 420403d241 remove script as "Google Code" has stopped supporting downloads 11 years ago
src 36fc05a5a2 Don't force a platform for OS X 11 years ago
.gitignore 9514374df0 ignore untracked files generated during the build 11 years ago
.gitmodules 83ef8a5fed add submodule for patched QT 11 years ago
AUTHORS ccb82b1881 update the AUTHORS file 11 years ago
CHANGELOG bbca41590a add changelog for all versions upto 0.12.0 11 years ago
COPYING d30cd0f7cc Update the COPYING file to say lgpl 14 years ago
Doxyfile edac9b5a82 Updated doxygen generation 15 years ago
Doxyfile.lib 2b1fe11ae2 Update documentation and static build scripts 15 years ago
INSTALL.md 85732323db rename README to README.md and INSTALL to INSTALL.md 11 years ago
README.md f76e7c4274 README typo fixes 11 years ago
VERSION feae35883f get the version from separate file 11 years ago
build_linux.sh 03c001de25 improvements in the linux build script 11 years ago
build_msvc.cmd 867637f9c5 fix building of installer for 64-bit Windows 11 years ago
build_osx.sh 9c0546961d add revamped OS X build script 11 years ago
common.pri ea5c74284f set BUILD to "final" in case the commit has a tag 11 years ago
wkhtmltopdf.pro b3ed026819 Relicense under LGLP 14 years ago
wkhtmltox.nsi 867637f9c5 fix building of installer for 64-bit Windows 11 years ago

README.md

wkhtmltopdf and wkthmltoimage

wkhtmltopdf and wkhtmltoimage are command line tools to render HTML into PDF and various image formats using the QT Webkit rendering engine. These run entirely "headless" and do not require a display or display service.

Usage

wkhtmltopdf [options...] [objects...] <output file>

wkhtmltoimage [options...] <input url/file name> <output file>

wkhtmltopdf is able to put several objects into the output file. An object is a single webpage, a cover webpage, or a table of contents. The objects are put into the output document in the order they are specified on the command line. Options can be specified on a per object basis or in the global options area.

['page'] <input url/file name> [page options...]

A page objects puts the content of a singe webpage into the output document.

options for the page object can be placed in the global options and the page options areas. The applicable options can be found in the Page Options and Headers And Footer Options sections.

cover <input url/file name> [page option...]

A cover objects puts the content of a singe webpage into the output document, the page does not appear in the table of content, and does not have headers and footers.

All options that can be specified for a page object can also be specified for a cover.

toc [toc option...]

A table of content object inserts a table of content into the output document.

All options that can be specified for a page object can also be specified for a toc, further more the options from the TOC Options section can also be applied. The table of content is generated via XSLT which means that it can be styled to look however you want it to look. To get an aide of how to do this you can dump the default xslt document by supplying the --dump-default-toc-xsl, and the outline it works on by supplying --dump-outline, see the Outline Options section.

Examples

To convert a remote webpage to PDF:

wkhtmltopdf http://example.com example.pdf

To convert a local HTML file to PDF:

wkhtmltopdf my.html my.pdf

You can also convert to PS files if you like:

wkhtmltopdf my.html my.ps

Printing a book with a table of content:

wkhtmltopdf -H cover cover.html toc chapter1.html chapter2.html chapter3.html book.pdf

To convert a remote webpage to PNG:

wkhtmltoimage http://example.com example.png

To convert a local HTML file to JPEG:

wkhtmltoimage my.html my.jpg