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
11
votes
3 answers

wkhtmltopdf - cannot convert local file

I just downloaded version 10.0 for opensuse v. 11.3. I can convert a webpage (ie www.google.com) using it but cannot convert a local file. I grant all permissions on the file (& i've even tried running under sudo to no avail). This is the…
user_78361084
  • 3,538
  • 22
  • 85
  • 147
11
votes
4 answers

Bash: No such file or directory?

I try to use an executable script (wkhtmltopdf) on a Linux shared webserver (Debian, 64bit). I am pretty sure that I compiled everything correct, but whenever I want to execute the file I get as an response : > ./wkhtmltopdf -H -bash: ./wkhtmltopdf:…
DrDirk
  • 1,937
  • 3
  • 25
  • 36
11
votes
2 answers

plotly js: how to run my javascript ONLY after plot image is loaded

When using a plotly graph of any sort with the Javascript API (plotly.js, not plotly-nodejs), how can I run some javascript ONLY after the graph has loaded? I'm looking for the mechanism in the plotly javascript API that, for example, does the same…
mwag
  • 3,557
  • 31
  • 38
11
votes
2 answers

knp_snappy page break in generated PDF

I'm working on Symfony2 project to generate PDF from HTML view. Following is from config.yml knp_snappy: pdf: enabled: true binary: /path/to/my/wkhtmltopdf options: no-stop-slow-scripts: ~ enable-javascript: ~ …
Alok Patel
  • 7,842
  • 5
  • 31
  • 47
11
votes
1 answer

How can i add footer at the bottom of the page wkhtmltopdf

I am using wkhtmltopdf to genereate reports now i have encounterd with a situation where i have to show footer at the bottom of the page i have tried to solve this with css it works on simple page but not on my wkhtmltopdf generated page here is my…
user2166164
11
votes
2 answers

Python HTML to PDF with full support for CSS3 and HTML5

I am working on a Python/Django project, where I have to convert some of my highly styled html content to PDF. Currently I am using the wkhtmltopdf library. While the conversion works almost perfectly there are some issues regarding CSS3 and HTML5…
Ales Maticic
  • 1,895
  • 3
  • 13
  • 27
11
votes
3 answers

wkhtmltopdf internal links

I am using wkhtmltopdf to generate reports from my html templates, i am trying to generate an index for the output PDF. The thing is that I want to achieve similar functionality to the indexes of microsoft word. For this purpose I need to use…
11
votes
2 answers

Test download of pdf with rspec and pdfkit

I am developing a rails 3.2 application with which users can download pdfs. I enjoy test driven development a lot using rspec and shoulda matchers, but I'm at a loss with this one. I have the following code inside my controller: def show_as_pdf …
Dennis Hackethal
  • 13,662
  • 12
  • 66
  • 115
11
votes
5 answers

wkhtmltopdf segfaults

I am trying to put wkhtmltopdf onto a virtualbox'ed ubuntu 12.04 64bit server. So far no luck. The package from the repositories wants to have xserver running and the static version: wkhtmltopdf google.com tesss.pdf Loading pages (1/6) QSslSocket:…
HouseMD
  • 243
  • 2
  • 11
11
votes
0 answers

Wkhtmltopdf margin (top and bottom)

I am using wkhtmltopdf 0.10.0 rc2 on a: Linux 3.2.0-24-generic #38-Ubuntu x86_64 GNU/Linux I can't create PDFs with margin-top or margin-bottom (no errors) I'm using the command below: wkhtmotopdf -T 50 -B 50 http://google.com ./test.pdf wkhtmotopdf…
kwarkjes
  • 341
  • 1
  • 3
  • 9
10
votes
2 answers

Emulate ASP.NET authentication cookie

I maintain an ASP.NET MVC website that uses FormsAuthentication.SetAuthCookie(userName, createPersistentCookie); to sign users in (they end up with a cookie named .ASPXAUTH). The client wants me to add an HTML to PDF feature, so I'm wrapping the…
cdmckay
  • 31,832
  • 25
  • 83
  • 114
10
votes
2 answers

Google charts are not showing in Snappy PDF

I am trying to load a chart then convert it to PDF using Laravel-snappy Here is the code I am using to generate the pdf: $pdf = SnappyPDF::loadView('report', []); $pdf->setOption('enable-javascript', true); $pdf->setOption('no-stop-slow-scripts',…
moh96
  • 113
  • 1
  • 6
10
votes
1 answer

How to bulk generate PDF from HTML templates ready for double-sided printing in PHP?

I've been struggling with this for a while and feel helpless. Prestashop uses tcpdf to generate invoices and delivery slips from HTML templates filled using Smarty. We are working on updating the invoice design and found tcpdf to be lacking in CSS…
PeterTheLobster
  • 1,386
  • 16
  • 33
10
votes
1 answer

wkhtmltopdf thead overlapps content on second page

Here is how my PDF result looks like (see the overlapping header on the second page): The code is a simple HTML table with lots of content inside one TD element. …
JochenJung
  • 7,183
  • 12
  • 64
  • 113
10
votes
4 answers

Rails PDFKit command failed

I'm trying to use PDFKit as middleware in a rails 3 app. I can use wkhtmltopdf from the command line just fine, but my app keeps throwing me this error command failed: "/Users/bobby/.rvm/gems/ruby-1.9.2-p0/bin/wkhtmltopdf" "--page-size" "Letter"…
Pierre
  • 8,368
  • 4
  • 34
  • 50
BESCHREIBUNG PREIS