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
2 answers

How do I install wkhtml2pdf?

I've been looking for a solution to this for about a year, still haven't found one. I'm trying to get a website snapshot script that I can host on my server and use freely that works well on 99% of webpages. So far I've been using html2canvas but it…
apparatix
  • 1,492
  • 7
  • 22
  • 37
1
vote
0 answers

Encoding issue with wkhtmltopdf via Python's subprocess.Popen on Ubuntu server

I'm having an encoding issue with debian / django / python / subprocess.Popen / wkhtmltopdf (not sure which part is causing the issue). The issue is related to passing in a unicode string into wkhtmltopdf via Python's subprocess.Popen on an Amazon…
davur
  • 1,420
  • 1
  • 15
  • 37
1
vote
1 answer

wkhtmltopdf failing to convert local pages to PDF

I've been trying to get wkhtmltopdf to convert pages on a website and it's failing to convert pages that are on the same. It'll convert and store external pages (tried it with google and bbc.co.uk, both worked) so the permissions are fine but if I…
user1031348
  • 47
  • 1
  • 5
1
vote
1 answer

Creating a custom HTML page header and footer

I'm in the middle of creating a html to pdf converter using the wkhtmltopdf application and having trouble trying to insert a custom header and footer to appear on the output document. For the program I am making this for I need these to be created…
Sayse
  • 42,633
  • 14
  • 77
  • 146
1
vote
2 answers

Can not run wkhtmltoimage, shared library missing libXrender.so.1

When I run the i386 version of wkhtmlimage (on Ubuntu 64 bit if that matters), I get the following error, ./wkhtmltoimage-i386 http://www.google.com google.jpg ./wkhtmltoimage-i386: error while loading shared libraries: libXrender.so.1: cannot…
Andreas Selenwall
  • 5,705
  • 11
  • 45
  • 58
0
votes
1 answer

Fail to create a PDF once deployed on heroku

I am trying to generate PDF reports with wicked_pdf gem. THe PDF generation works fine on my development environment, but it fails once it's deployed on Heroku This is the error I am getting: Failed to execute: …
zabumba
  • 12,172
  • 16
  • 72
  • 129
0
votes
3 answers

how do I pass variables from a php page to command line

I'm currently using the following two command to generate client statements populated from mysql tables. There are three variables, client_id, date_start. date_end wget -O mypage.html…
Sam Corbet
  • 49
  • 1
  • 9
0
votes
1 answer

Getting PDF page count in C# using static wkHTMLtoPDF

I'm using the following wrapper WkHtmlToXSharp to convert HTML reports into PDF. I would like to also record the page count after the conversion is complete. Is there a way to extract the page count from the binary PDF in memory? Or do I need…
rghazarian
  • 260
  • 2
  • 9
0
votes
1 answer

wkhtmltopdf.exe get executed in a loop abou 100 or more times in ASP.Net web form

I am trying to print an HTML page as PDF, I use wkhtmltopdf.exe for conversion similar code works on test page on button click even but when i use the following code on a Print.aspx page it gets in to loop and starts 100 or more wkhtmltopdf.exe…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
1 answer

I made wkhtmltopdf to work on my local machine using ASP.NET, Is my code safe to run on server

Code convert the current HTML page into PDF and show it to the user. I have never worked with wkhtmltopdf before and I am more concerned about security. Is it safe to run it on the server? What should I do to make it more secure? string args =…
Learning
  • 19,469
  • 39
  • 180
  • 373
0
votes
2 answers

check for process stop under shell

This is part of a python program under windows environment. I am trying to do the following: from an html, I want to create a pdf and then open it: #create the pdf os.system("start wkhtmltopdf.exe result.html %s%s" %(output_directory,…
dola
  • 201
  • 4
  • 9
0
votes
1 answer

wkhtmltopdf image doesn't display

I am using wkhtmltopdf for make pdf but anything work except image that doesn't display.How fix? IN localhost:3000 it work but when deploy on server it does't work.
0
votes
1 answer

How to make pdf file size with respect to div height and width using wkhtmltopdf.exe

I tried to make pdf with wkhtmltopdf.exe by supplying html string and is working properly.But i want to provide pdf custom size to exe. eg:- Suppose i have a div of height 30 and width 50. then the generated pdf should be of same size. Below is…
Manoj G
  • 87
  • 14
0
votes
1 answer

wkhtmktopdf on shared hosting does not return any data...?

Hi friends currently i m working on a small business project. for this project i need to convert my dynamic html page into a PDF file.. I googled for html to pdf and found wkhtml... in my local-host system its works like charm.. But in my shared…
Baskar.M
  • 561
  • 1
  • 6
  • 25
0
votes
1 answer

wkhtmltopdf - Strange Behavior in multiple page because of Bing Maps

I have a little problem in pdf generation... When in wkhtmltopdf i execute with an Html page that have Bing Maps, and that PDF occupies more than 1 page, the second and third page came an strange image... Let me show the examples: With the Bing…
expertCode
  • 533
  • 4
  • 14