.TH WKHTMLTOPDF 1 "2009 February 23" .SH Name wkhtmltopdf \- html to pdf converter .SH Synopsis wkhtmltopdf [GLOBAL OPTION]... [OBJECT]... .SH Document objects wkhtmltopdf is able to put several objects into the output file, an object is either 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. Options from the Global Options section can only be placed in the global options area. A page objects puts the content of a single webpage into the output document. (page)? [PAGE OPTION]... 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. A cover objects puts the content of a single webpage into the output document, the page does not appear in the table of contents, and does not have headers and footers. cover [PAGE OPTION]... All options that can be specified for a page object can also be specified for a cover. A table of contents object inserts a table of contents into the output document. toc [TOC OPTION]... 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 contents is generated via XSLT which means that it can be styled to look however you want it to look. To get an idea 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. .SH Description Converts one or more HTML pages into a PDF document, \fBnot\fP using wkhtmltopdf patched qt. .SH Global Options .PD 0 .TP \fB \-\-collate\fR Collate when printing multiple copies .TP \fB \-\-no-collate\fR Do not collate when printing multiple copies .TP \fB \-\-cookie-jar\fR \fI\fR Read and write cookies from and to the supplied cookie jar file .TP \fB \-\-copies\fR \fI\fR Number of copies to print into the pdf file .TP \fB\-d, \-\-dpi\fR \fI\fR Change the dpi explicitly (this has no effect on X11 based systems) .TP \fB\-H, \-\-extended-help\fR Display more extensive help, detailing less common command switches .TP \fB\-g, \-\-grayscale\fR PDF will be generated in grayscale .TP \fB\-h, \-\-help\fR Display help .TP \fB \-\-htmldoc\fR Output program html help .TP \fB \-\-license\fR Output license information and exit .TP \fB \-\-log-level\fR \fI\fR Set log level to: none, error, warn or info .TP \fB\-l, \-\-lowquality\fR Generates lower quality pdf/ps. Useful to shrink the result document space .TP \fB \-\-manpage\fR Output program man page .TP \fB\-B, \-\-margin-bottom\fR \fI\fR Set the page bottom margin .TP \fB\-L, \-\-margin-left\fR \fI\fR Set the page left margin .TP \fB\-R, \-\-margin-right\fR \fI\fR Set the page right margin .TP \fB\-T, \-\-margin-top\fR \fI\fR Set the page top margin .TP \fB\-O, \-\-orientation\fR \fI\fR Set orientation to Landscape or Portrait .TP \fB \-\-page-height\fR \fI\fR Page height .TP \fB\-s, \-\-page-size\fR \fI\fR Set paper size to: A4, Letter, etc. .TP \fB \-\-page-width\fR \fI\fR Page width .TP \fB\-q, \-\-quiet\fR Be less verbose, maintained for backwards compatibility; Same as using \-\-log\-level none .TP \fB \-\-read-args-from-stdin\fR Read command line arguments from stdin .TP \fB \-\-readme\fR Output program readme .TP \fB \-\-title\fR \fI\fR The title of the generated pdf file (The title of the first document is used if not specified) .TP \fB\-V, \-\-version\fR Output version information and exit .PD .SH Page Options .PD 0 .TP \fB \-\-allow\fR \fI\fR Allow the file or files from the specified folder to be loaded (repeatable) .TP \fB \-\-background\fR Do print background .TP \fB \-\-no-background\fR Do not print background .TP \fB \-\-bypass-proxy-for\fR \fI\fR Bypass proxy for host (repeatable) .TP \fB \-\-cache-dir\fR \fI\fR Web cache directory .TP \fB \-\-checkbox-checked-svg\fR \fI\fR Use this SVG file when rendering checked checkboxes .TP \fB \-\-checkbox-svg\fR \fI\fR Use this SVG file when rendering unchecked checkboxes .TP \fB \-\-cookie\fR \fI\fR \fI\fR Set an additional cookie (repeatable), value should be url encoded. .TP \fB \-\-custom-header\fR \fI\fR \fI\fR Set an additional HTTP header (repeatable) .TP \fB \-\-custom-header-propagation\fR Add HTTP headers specified by \-\-custom\-header for each resource request. .TP \fB \-\-no-custom-header-propagation\fR Do not add HTTP headers specified by \-\-custom\-header for each resource request. .TP \fB \-\-debug-javascript\fR Show javascript debugging output .TP \fB \-\-no-debug-javascript\fR Do not show javascript debugging output .TP \fB \-\-encoding\fR \fI\fR Set the default text encoding, for input .TP \fB \-\-images\fR Do load or print images .TP \fB \-\-no-images\fR Do not load or print images .TP \fB\-n, \-\-disable-javascript\fR Do not allow web pages to run javascript .TP \fB \-\-enable-javascript\fR Do allow web pages to run javascript .TP \fB \-\-javascript-delay\fR \fI\fR Wait some milliseconds for javascript finish .TP \fB \-\-load-error-handling\fR \fI\fR Specify how to handle pages that fail to load: abort, ignore or skip .TP \fB \-\-load-media-error-handling\fR \fI\fR Specify how to handle media files that fail to load: abort, ignore or skip .TP \fB \-\-disable-local-file-access\fR Do not allowed conversion of a local file to read in other local files, unless explicitly allowed with \-\-allow .TP \fB \-\-enable-local-file-access\fR Allowed conversion of a local file to read in other local files. .TP \fB \-\-minimum-font-size\fR \fI\fR Minimum font size .TP \fB \-\-page-offset\fR \fI\fR Set the starting page number .TP \fB \-\-password\fR \fI\fR HTTP Authentication password .TP \fB \-\-disable-plugins\fR Disable installed plugins .TP \fB \-\-enable-plugins\fR Enable installed plugins (plugins will likely not work) .TP \fB \-\-post\fR \fI\fR \fI\fR Add an additional post field (repeatable) .TP \fB \-\-post-file\fR \fI\fR \fI\fR Post an additional file (repeatable) .TP \fB\-p, \-\-proxy\fR \fI\fR Use a proxy .TP \fB \-\-proxy-hostname-lookup\fR Use the proxy for resolving hostnames .TP \fB \-\-radiobutton-checked-svg\fR \fI\fR Use this SVG file when rendering checked radiobuttons .TP \fB \-\-radiobutton-svg\fR \fI\fR Use this SVG file when rendering unchecked radiobuttons .TP \fB \-\-run-script\fR \fI\fR Run this additional javascript after the page is done loading (repeatable) .TP \fB \-\-ssl-crt-path\fR \fI\fR Path to the ssl client cert public key in OpenSSL PEM format, optionally followed by intermediate ca and trusted certs .TP \fB \-\-ssl-key-password\fR \fI\fR Password to ssl client cert private key .TP \fB \-\-ssl-key-path\fR \fI\fR Path to ssl client cert private key in OpenSSL PEM format .TP \fB \-\-stop-slow-scripts\fR Stop slow running javascripts .TP \fB \-\-no-stop-slow-scripts\fR Do not Stop slow running javascripts .TP \fB \-\-user-style-sheet\fR \fI\fR Specify a user style sheet, to load with every page .TP \fB \-\-username\fR \fI\fR HTTP Authentication username .TP \fB \-\-window-status\fR \fI\fR Wait until window.status is equal to this string before rendering page .TP \fB \-\-zoom\fR \fI\fR Use this zoom factor .PD .SH Specifying A Proxy By default proxy information will be read from the environment variables: proxy, all_proxy and http_proxy, proxy options can also by specified with the \-p switch := "http://" | "socks5://" := (":" )? "@" := "None" | ? ? (":" )? Here are some examples (In case you are unfamiliar with the BNF): http://user:password@myproxyserver:8080 socks5://myproxyserver None .SH 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 than 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. .SH Page sizes The default page size of the rendered document is A4, but by using the \-\-page\-size option this can be changed to almost anything else, such as: A3, Letter and Legal. For a full list of supported pages sizes please see . For a more fine grained control over the page size the \-\-page\-height and \-\-page\-width options may be used .SH Reading arguments from stdin If you need to convert a lot of pages in a batch, and you feel that wkhtmltopdf is a bit too slow to start up, then you should try \-\-read\-args\-from\-stdin, When \-\-read\-args\-from\-stdin each line of input sent to wkhtmltopdf on stdin will act as a separate invocation of wkhtmltopdf, with the arguments specified on the given line combined with the arguments given to wkhtmltopdf For example one could do the following: echo "https://qt\-project.org/doc/qt\-4.8/qapplication.html qapplication.pdf" >> cmds echo "cover google.com https://en.wikipedia.org/wiki/Qt_(software) qt.pdf" >> cmds wkhtmltopdf \-\-read\-args\-from\-stdin \-\-book < cmds .SH Page Breaking The current page breaking algorithm of WebKit leaves much to be desired. Basically WebKit will render everything into one long page, and then cut it up into pages. This means that if you have two columns of text where one is vertically shifted by half a line. Then WebKit will cut a line into to pieces display the top half on one page. And the bottom half on another page. It will also break image in two and so on. If you are using the patched version of QT you can use the CSS page\-break\-inside property to remedy this somewhat. There is no easy solution to this problem, until this is solved try organizing your HTML documents such that it contains many lines on which pages can be cut cleanly. .SH Contact If you experience bugs or want to request new features please visit .SH Authors Jakob Truelsen Ashish Kulkarni Jan Habermann Pablo Ruiz García Trevor North Nate Pinchot pussbb Aaron Stone Patrick Widauer @a\-ctor Peter van der Tak Benjamin Sinkula Kasper F. Brandt Michael Nitze Rok Dvojmoc theirix Tomsgu Artem Butusov Christian Sciberras Daniel M. Lambea Douglas Bagnall peterrehm Renan Gonçalves Ruslan Grabovoy Sander Kleykens Adam Thorsen Albin Kerouanton Alejandro Dubrovsky Arthur Cinader @acinader Benoit Garret Bill Kuker cptjazz daigot Destan Sarpkaya @destan Duncan Smart Emil Lerch Erik Hyrkas Erling Linde Fábio C. Barrionuevo da Luz Fr33m1nd Frank Groeneveld Immanuel Häussermann Jake Petroules James Macdonald Jason Smith John Muccigrosso @Jmuccigr Julien Le Goff Kay Lukas Kurt Revis laura @holamon Marc Laporte Matthew M. Boedicker Matthieu Bontemps Max Sikstrom Nolan Neustaeter Oleg Kostyuk Pankaj Jangid robinbetts Sem Stefan Weil Stephen Kennedy Steve Shreeve Sven Nierlein Tobin Juday Todd Fisher Костадин Дамянов Emmanuel Bouthenot Rami @icnocop Khodeir\-hubdoc @Khodeir\-hubdoc Jonathan Jefferies @jjok Joe Ayers Jeffrey Cafferata rainabba Mehdi Abbad Lyes Amazouz Pascal Bach Mário Silva