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

The wkhtmltopdf process on Apache never ends

I have a PHP script to generate a PDF with wkhtmltopdf and xvfb (to simulate X server). Using command line, there is no problem. When this script is incorporated into my website, wkhtmltopdf never stops. I am using Apache 2.4 PHP 5.4 wkhtmltopdf…
Damax
  • 1,497
  • 19
  • 28
1
vote
1 answer

Create proper pdf file for printing with wkhtmltopdf

In docs of wkhtmltopdf I cannot find any hint about how to change the print border. I've marked it with a green line in the image below. I have body { margin:0px; padding:0px; } and all tables are 100% in width. The wrapper around the…
DarkLeafyGreen
  • 69,338
  • 131
  • 383
  • 601
1
vote
1 answer

Error in pdfkit in rails

I have done gem install pdfkit gem install wkhtmltopdf in application.rb added config.middleware.use "PDFKit::Middleware", :print_media_type => true when i go to the link to pdf with .pdf extension it shows Error as follows No wkhtmltopdf…
Mohammad Sadiq Shaikh
  • 3,160
  • 9
  • 35
  • 54
1
vote
1 answer

using wkhtmltopdf convert a file to pdf is smaller in size than the real file

When I convert a file with 158 pixel to pdf file, I just got a pdf file with 121 pixel in 100% zoom. wkhtmltopdf --dpi 100 c:\1.svg c:\2.pdf when I change the DPI, I find't it doesn't work. --dpi 100 is the same as --dpi 1000. wkhtmltopdf version is…
lpc2138
  • 15
  • 5
1
vote
0 answers

Using wkhtmltopdf in combination with travis-ci

I'm trying to get my test-suite to run on Travis-ci but I've run into a problem related to wkhtmltopdf. We use PDFKit to generate PDF-files in our Rails app, which in turn uses the wkhtmltopdf tool, and all the tests that invoke the PDF generation…
1
vote
3 answers

How to execute WKHTMLTOPDF from PHP?

I know this topis is there already, but none of the answers helped me... I copied wkhtml folder from my HDD onto the server. When I run exec('"../wkhtmltopdf/wkhtmltopdf.exe" "www.estiroad.com/export.php" "C:/EXTREM.pdf"'); nothing…
Michal S
  • 1,103
  • 6
  • 19
  • 31
1
vote
2 answers

wkhtmltopdf - non-English fonts not displayed in exported PDF

I am using the wkhtmltopdf.exe to convert HTML to PDF, using the below source code. The problem is - the PDF shows "?" in place of all non-English characters like Chinese, Japanese, Russian, Arabic. When output as HTML, the characters are shown…
itsbalur
  • 992
  • 3
  • 17
  • 39
1
vote
2 answers

wkhtmltopdf pauses and requires manual intervention

UPDATE: Seems like an issue of wkhtmltopdf not exiting properly I'm doing the following in node: console.log("before"); fs.writeFile(html_filename, html, function (err) { if (err) {res.writeHead(400); res.end("" + err); return;} …
Max
  • 1,399
  • 13
  • 28
1
vote
1 answer

wkhtmltopdf Issue

1) I renamed "wkhtmltopdf-i386" to "wkhtmltopdf" and uploaded "wkhtmltopdf" to my server in a folder named "/usr/local/bin" 2) I uploaded the php integration script, in the same folder, and named it "pdf_class.php"…
BerkErarslan
  • 69
  • 1
  • 1
  • 9
1
vote
1 answer

How to right align a page with wkhtmltopdf?

I have a page that is written in RTL in html it is ok but after the conversion with wkhtmltopdf it is centered. How can I tell wkhtmltopdf to align that page to the right? For headers and footers there is an option for that, but how to do it for the…
user776253
  • 11
  • 2
1
vote
0 answers

Using wkhtmltopdf with JBoss form based authentication

I am trying to use wkhtml2pdf in JBoss with Java to create PDF files. I was successful, but it only creates a PDF file from my login-page, rather than from the jsp file. I read that it is possible to add parameters like username or password, and…
nimrod
  • 5,595
  • 29
  • 85
  • 149
1
vote
2 answers

Getting contents of referring page with php

I'm trying to enable screenshots of the page a logged in user is currently on. I've placed a button that needs to: read in the content of the referring page save it to a file render that file as a PDF redirect back to the referring page The…
Chords
  • 6,720
  • 2
  • 39
  • 61
1
vote
1 answer

pdf generator from html in php using Wkhtmltopdf

On my windows with xamp local server I follow pdf generator from html step 1 & 2 (wkhtmltopdf http://www.test.com test.pdf) goes fine but step 3 3. In php you should execute the tool using shell_exec: shell_exec("/usr/local/bin/wkhtmltopdf-i386…
PHP Ferrari
  • 15,754
  • 27
  • 83
  • 149
1
vote
1 answer

WKHTMLTOPDF installation on web-server (hostgator)

I am interestingly stuck to install wkhtmltopdf on CentOS server (hostgator is the provider). I am relentlessly google-ing for details information on installation but haven't found any thing which can help some naive like me. So, anyone out there…
Potheek
  • 991
  • 1
  • 8
  • 17
1
vote
1 answer

How to open pdf file in wicked_pdf?

Right now im using rail 3.0.0 version.now im generate the pdf file and save that file in public folder using wicked_pdf.now i want open that pdf file using controller action.Im using this code in controller.but it is not working.please help me how…