Questions tagged [wkhtmltopdf]

A shell utility to convert HTML to PDF using the Webkit rendering engine and Qt.

Tool for converting web pages to PDF documents using the WebKit engine. These run entirely "headless" and do not require a display or display service.

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 content. 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 singe webpage into the output document.

(page)? <input url/file name> [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 singe webpage into the output document, the page does not appear in the table of content, and does not have headers and footers.

cover <input url/file name> [PAGE OPTION]...

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

Resources:

2447 questions
13
votes
1 answer

How to reset wkhtmltopdf page numbers on special tag

I'm trying to reset page numbers when I get a special tag in the body of the document (for example when I get a
, I'd like the next page footer to say "page 1 of x" where x is the number of pages before the…
user1788235
  • 131
  • 3
13
votes
4 answers

Generate PDF Behind Authentication Wall

I'm trying to generate a PDF using WKHTMLTOPDF that requires me to first log in. There's some on this on the internet already but I can't seem to get mine working. I'm in Terminal - nothing fancy. I've tried (among a whole lot of other…
Chords
  • 6,720
  • 2
  • 39
  • 61
12
votes
2 answers

How do I get wkhtmltopdf to produce PDFs with selectable and searchable text?

I've installed wkhtmltopdf on Mac OS X via homebrew and I've also tried compiling it (along with the patched version of Qt) by hand. In both cases, the PDFs it generates do not contain any selectable, copyable, or searchable text. Instead each page…
John
  • 29,546
  • 11
  • 78
  • 79
12
votes
3 answers

wkhtmltopdf: What paper sizes are valid?

I am using wkhtmltopdf(html to pdf converter) and am running it through a php shell_exec. When running wkhtmltopdf --help one option is size, with the help text being Set paper size to: A4, Letter, etc. I am wondering if someone has a list of…
Hailwood
  • 89,623
  • 107
  • 270
  • 423
12
votes
3 answers

How to use wkhtmltopdf in Java web application?

I am newbie in wkhtmltopdf. I am wondering how to use wkhtmltopdf with my Dynamic Web Project in Eclipse? How to integrate wkhtmltopdf with my Java dynamic web application? Is there any tutorials available for beginners of wkhtmltopdf …
Mellon
  • 37,586
  • 78
  • 186
  • 264
12
votes
1 answer

wicked_pdf shows unknown character on unicode pdf conversion (ruby)

I'm trying to create a pdf from a html page using wicked_pdf (version 1.1) and wkhtmltopdf-binary gems. My html page contains a calendar emoji that displays well in the browser whatever font I use
rico1892
  • 123
  • 1
  • 6
12
votes
4 answers

Help installing static binary for wkhtmltopdf

I am trying to use the static binary of wkhtmltopdf on Ubuntu server 10.0.4. The reason for is that it apparently has a built in modified QT that will allow me to run wkhtmltopdf without an X Server. Result: Once installed (see steps below), when I…
David Kahn
  • 121
  • 1
  • 1
  • 4
12
votes
4 answers

How to deal with ContentNotFoundError when using wkhtmltopdf?

Can someone tell me how to resolve following issues? wkhtmltopdf don't have option to pass proxy info (-p or --proxy) unlike in previous versions and its not using system $http_proxy and $https_proxy env variable too. wkhtmltopdf not working with…
Murali Mopuru
  • 6,086
  • 5
  • 33
  • 51
12
votes
6 answers

wkhtmltopdf div background color

I am using the wkhtmltopdf on my amazon ubuntu instance to generate an invoice's PDF. The page is PHP. Everything is working fine except the background color of the html div tags. The border color is working fine. Is there any setting in wkhtmltopdf…
Gaurav
  • 1,214
  • 2
  • 17
  • 32
12
votes
4 answers

wkhtmltopdf javascript delay for output of google maps

I am working with WKTHMTOPDF and really enjoying it. However, the page that is being converted has google maps and the resulting PDF comes out with the map half loaded. I know there was an option to add --javascript--delay in previous versions, but…
Afroman Makgalemela
  • 690
  • 2
  • 8
  • 21
12
votes
2 answers

wkhtmltopdf: Is it possible to merge PDF files?

Using this library wkhtmltopdf, is it possible to merge 2 pdf files. I need to generate a report and merge the report with some attached documents. Generation of report is done, converting from HTML to PDF. But I need to merge the resulting PDF…
user1236048
  • 5,542
  • 7
  • 50
  • 87
12
votes
2 answers

Creating PDFs with django (wkhtmltopdf)

Could someone please provide me with a comprehensive example of how to get a view in django to return a PDF using wkhtmltopdf. There are limited number of examples that come with django-wkhtmltopdf and they presume a level of knowledge I just don't…
Robert Johnstone
  • 5,431
  • 12
  • 58
  • 88
12
votes
2 answers

Using wkhtmltopdf on Windows

I am trying to set up the nifty HTML to image plugin called wkhtmltopdf and I am having a really difficult time. What I did so far: Downloaded wkhtmltopdf zip package and upacked the file in my websites root folder As a test I included the…
AnchovyLegend
  • 12,139
  • 38
  • 147
  • 231
11
votes
6 answers

Rails: wkhtmltopdf RuntimeError (Location of wkhtmltopdf unknown)

I am using Ubuntu 11.04 to develop an app in Ruby on Rails. In the app I need to generate pdf documents. So I am using the wicked_pdf and wkhtmltopdf-binary gems. In the development environment in my system everything is working fine. But once I…
dbaruah
  • 113
  • 1
  • 1
  • 4
11
votes
6 answers

Execute wkhtmltopdf from PHP

I have this working fine from Linux command line: wkhtmltopdf entry.html output.pdf But the following doesn't work from PHP code: exec ('wkhtmltopdf entry.html output.pdf'); Interesting, I've googled and a lot of non-checked solutions and with no…
Ginger Opariti
  • 1,282
  • 5
  • 23
  • 41