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
1
vote
0 answers

wkhtmltopdf giving Seg Fault errors on Ubuntu 12.04 64bit

I'm looking for some help on figuring out why I cannot get the wkhtmltopdf to work as expected. I have it running on my Dev machine which is the same build of ubuntu with the same packages installed. I cannot see any other difference apart from…
1
vote
2 answers

Error "not precompiled" js file on production trying to render PDF via wicked_pdf in Rails

I have troubles with wicked_pdf on production server. I have such code here in _results.pdf.haml: #container = wicked_pdf_javascript_include_tag "pdf_application" :javascript …
sandric
  • 2,310
  • 3
  • 21
  • 26
1
vote
2 answers

wkhtmltopdf does not create pdf for Debian

This is my PHP code which I am using to convert HTML file to pdf and then download pdf file from server. wkhtmltopdf $url = base_url().'invoices/'.$file_name.'.html'; exec("wkhtmltopdf-amd64 $url…
PHP Ferrari
  • 15,754
  • 27
  • 83
  • 149
1
vote
1 answer

wkhtmltopdf, images loaded from db not showing

I am using wkhtmltopdf to convert html to pdf. All images are displayed properly, but the one returned by controller (stored in db, as mediumblob type) is not showing. First I thought this can be a timing issue, so I increased the…
El Kopyto
  • 1,157
  • 3
  • 18
  • 33
1
vote
1 answer

wkhtmltopdf - vary footer content based on page content?

With wkhtmltopdf, is there any way to vary the content of the footer based on the content present on the page? Each page's footer needs to have the title of the section it's in rather than a universal footer. Any pointers?
exupero
  • 9,136
  • 8
  • 47
  • 63
1
vote
1 answer

Is calling a Process.Start on a Web App thread-safe?

Today I've been working with wkhtmltopdf.exe in a web app and I was wondering whether I should use a lock (or the singleton pattern) in order to call Process.Start in a thread-safe manner. My concern is that multiple users will do GETs…
Ulises
  • 13,229
  • 5
  • 34
  • 50
1
vote
1 answer

wicked_pdf too much images = broken PDF

wicked_pdf (or wkhtmltopdf) behaves strange in production mode. It took a bit time to track down the problem, but seemingly the reason that my PDF is broken are too much images or too large file sizes. When i try to use a 300dpi pic (4 MB), it´s…
Arne Cordes
  • 581
  • 1
  • 6
  • 22
1
vote
0 answers

How to modify PDF values inside the Properties box under File menu when generating PDF with wkhtmltopdf?

After creating a pdf file with wkhtmltopdf lib, if you go under File->Propertes tab, you notice that there are some values that are generated by wkhtmltopdf. However, I would like to modify or remove some of these. Does anyone have any experience…
ericg
  • 63
  • 7
1
vote
2 answers

Unable to print Check Boxes in pdf

We are using WkHtmlToPdf to convert from html to pdf. Now I have make all the form fields editable on request as well. Since there is a bug in WkHtmlToPdf while converting Html to Pdf it makes all the form field's property as Visible Not Printable.…
Jayee
  • 542
  • 5
  • 15
1
vote
5 answers

Error! Symfony2 with KNP Snappy Bundle & WKHTML2PDF

When I go to /fileDownload I receive a 500 Internal Server Error - RuntimeException: The process stopped because of a "0" signal. Controller Action: public function fileAction() { $html = $this->render('MyBundle:Downloads:file.html.twig',…
Xavier
  • 107
  • 2
  • 9
1
vote
1 answer

HTML to PDF - Find out which element is on which page

I convert HTML to PDF with wkhtmltopdf by starting a subprocess from .Net. After the processing I need to know the page numbers of some HTML elements. Any idea how to achieve this? Any alternative (with example code) working on .Net would be fine,…
schlamar
  • 9,238
  • 3
  • 38
  • 76
1
vote
1 answer

How to run wkhtmltoxsharp?

I have added the wkhtmltoxsharp.dll and Common.Logging.dll to the lust of references. I am using the following code to convert a html file to a pdf file. WkHtmlToPdfConverter converter = new WkHtmlToPdfConverter(); byte[] strHTML =…
user1512781
  • 73
  • 3
  • 8
1
vote
2 answers

Using ckeditor to edit many divs on a page, then save the HTML to file

Hey guys I'm implementing a page that has about 9 separate divs on it that I want each to be separately editable using ckeditor. The page is being dynamically generated through php with codeigniter but I want a user to be able to make changes to…
Will Sampson
  • 504
  • 6
  • 22
1
vote
3 answers

wkhtmltopdf error in apache log

exec("wkhtmltopdf test.html output.pdf"); In the php command line it works but if I try to call it from apache it doesn't create the pdf file and the log show this: $ tail -f /var/log/apache2/error.log wkhtmltopdf: cannot connect to X server
Sadiel
  • 1,344
  • 3
  • 18
  • 33
1
vote
3 answers

PHP and Apache : shell_exec(wkhtmltopdf with xvfb) command doesn't work

I try to run the wkhtmltopdf (0.11.0 rc1) with php (5.4.2) on apache (2.4.2). When I try to launch wkhtmltopdf-i386 --use-xserver http://www.google.com google.pdf 2>&1, I can find my pdf. Here my php code
alexgindre
  • 243
  • 1
  • 4
  • 11