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
10
votes
4 answers

CSS vertical centering containers on printed pages on page break

Is there a way to vertically center a container if it's bumped to a new page when printed out? As the diagram shows, container A may grow too big that A and B will occupy their own pages. When that happens I want B or both to be centered.…
Dan7
  • 1,657
  • 1
  • 19
  • 31
10
votes
1 answer

wkhtmltopdf : How do I increase the PDF quality of a document generated?

I am generating pdf using wkhtmltopdf. The text/image quality rendered in the document is not to the expected quality. Images look blurred and text does look sharp. Is there any way I can do to increase the quality?
John
  • 541
  • 3
  • 6
  • 19
9
votes
0 answers

wkhtmltopdf: QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to /tmp/runtime-root

I am using Docker image php:8.0-fpm-alpine3.14 which I have a Sylius project and I would like use wkhtmltopdf, so I added these lines in Dockerfile: RUN apk --update --no-cache add \ wkhtmltopdf \ libgcc \ libstdc++ \ musl \ …
Valentin Harrang
  • 1,081
  • 2
  • 17
  • 34
9
votes
3 answers

Create pdf with wkhtmltopdf and rendering javascript

I'm attempting to create a PDF of a javascript chart that I have in a model window (my chart is a combination of javascript and css in an .aspx view). The only thing in the rendered PDF file is the static content from the window, the actual…
Zero Cool
  • 1,866
  • 4
  • 19
  • 28
9
votes
1 answer

How to install wkhtmltopdf on Docker php-fpm Alpine Linux?

I installed Wkhtmltopdf on Alpine Docker with the following command: apk add --no-cache wkhtmltopdf However when I try to run wkhtmltopdf I get: /usr/bin/wkhtmltopdf "test.html" "test.pdf" Cannot mix incompatible Qt library (version 0x50c03) with…
Lau
  • 3,260
  • 5
  • 16
  • 25
9
votes
1 answer

wkhtmltopdf unnecessary white space in header

I have created pdf with header and footer. I want to hide header and footer from 1st and 2nd page in pdf. So I have written below javascript code: