Questions tagged [python-pdfkit]
84 questions
26
votes
1 answer
python-pdfkit (wkhtmltopdf) TOC overflow
I currently am creating a perfectly good PDF. there is nothing technically wrong with it. However, the TOC is ugly.
The TOC is generated via xsl which is passed through jinja2 for simple details to the top section of the page. I have modified the…

Radio
- 2,810
- 1
- 21
- 43
17
votes
2 answers
How get all computed css properties of element and its children in Javascript
I'm trying to set up a service in python using pdfKit to create a pdf file from html files.
So basically I will send my element as string and expect the server to return a pdf version of it, but to be an accurate representation I also need to send a…

Mojimi
- 2,561
- 9
- 52
- 116
16
votes
5 answers
How we can resolve "Solving environment: failed with initial frozen solve. Retrying with flexible solve." issue while installing the new conda package
I have tried to install new package in conda for windows using the following command:
conda install -c conda-forge python-pdfkit
but got the following error:
Collecting package metadata (current_repodata.json): done
Solving environment: failed with…

Rajesh Potnuru
- 161
- 1
- 1
- 5
9
votes
2 answers
pdfkit create pages using from_string
I am using pdfkit to generate pdf files from strings.
ASK: Each string i pass to pdfkit i want it as a new page in the output pdf.
i know this is possible using from_file like below. But, i do not want to write it to a file and use…

Headrun
- 129
- 1
- 11
6
votes
1 answer
FileNotFoundError: [Errno 2] No such file or directory: 'which' when using python pdfkit
I have a strange error. I try to use pdfkit to convert an HTML string to PDF, but i get a "No such file or directory: 'which'". I know that pdfkit uses wkhtmltopdf, and it tries to find this utility by using which. I have no idea what's happening.…

Ruben
- 1,065
- 5
- 18
- 44
6
votes
2 answers
pdfkit - An A4 html page does not print into an A4 pdf
I have reproduced my problem below :
I draw a 210x297 rectangle on a web page
…

Laurent
- 61
- 1
- 3
5
votes
1 answer
No wkhtmltopdf executable found: "b''" If this file exists please check that this process can read it
After hosting my Django application on Heroku while I try to download dynamic pdf my Django app's wkhtmltopdf causes this error.
In local machine(Ubuntu) I've applied
sudo apt-get install wkhtmltopdf
I've also added Aptfile with my project…

Fahad Md Kamal
- 243
- 6
- 20
5
votes
0 answers
pdfkit new line from_string or html does not work
I would like to find a way to line-break in pdfkit.
I tried both with strings and html files but it does not work as expected.
The following two minimal examples instead of providing me with 'a' (newline) 'b' generate 'a b'. I would appreciate your…

user11384282
- 51
- 1
5
votes
3 answers
How to generate a PDF with non-ascii characters using from_string from python-pdfkit
I'm struggling to generate just a simple PDF with non-ascii characters using Python 3.5.2, python-pdfkit and wkhtmltox-0.12.2.
This is the easiest example I could write:
import pdfkit
html_content = u'
ö
' pdfkit.from_string(html_content,…
jllopezpino
- 868
- 2
- 9
- 17
5
votes
1 answer
Is there a div to table converter?
I have a huge amount of structured HTML that I need to convert to to be able to render it inside of pdfkit.
I'm using pdfkit and it seems it dosn't play well with layouts but does play well with grids.
Any help would be greatly…

cph
- 458
- 2
- 6
- 24
4
votes
4 answers
Generate PDF from html template and send via Email in Django
I'm trying to generate a pdf file from an HTML template using Weasyprint python package and I need to send it via email using.
Here's what i have tried:
def send_pdf(request):
minutes = int(request.user.tagging.count()) * 5
testhours = minutes /…

Abdul Rehman
- 5,326
- 9
- 77
- 150
4
votes
2 answers
Boxes are displayed instead of text in pdfkit - Python3
I am trying to convert an HTML file to pdf using pdfkit python library.
I followed the documentation from here.
Currently, I am trying to convert plain texts to PDF instead of whole html document. Everything is working fine but instead of text, I am…

Nandan Bhat
- 1,573
- 2
- 9
- 21
3
votes
1 answer
How to include wkhtmltopdf with pyinstaller
I have written a python application which makes use of pdfkit package to print PDFs. I am using pyinstaller to build an executable of this application on Ubuntu. pdfkit depends on wkhtmltopdf installed with sudo apt install under /usr/bin/.
As per…

redwine
- 47
- 8
3
votes
2 answers
specify font in Python pdfkit
I'm using python 3.6 with pdfkit 0.6.1 (and it seems wkhtmltopdf 0.12.3.2) on a Debian Docker image. I tried looking at the docs & wkhtmltopdf options but there's no way to specify the font for the whole document. There are only font options for…

Foo L
- 10,977
- 8
- 40
- 52
3
votes
1 answer
pdfkit uses different fonts when renders PDF document on OS X and Ubuntu
I use pdfkit to generate PDF document from the HTML page. The problem is that it uses different fonts on my development machine (OS X) and production server (Ubuntu), so I can't get consistent rendering on development and production environment.…

Vladimir Prudnikov
- 6,974
- 4
- 48
- 57