Questions tagged [python-pdfkit]

84 questions
1
vote
2 answers

camelot python;OSError: exception: access violation writing 0x00000080

I was trying to extract tables from a PDF file with Camelot. Here is my code: import camelot tables = camelot.read_pdf('foo.pdf') print(tables) and I am getting the error while running this script as follows: File…
m.gibin
  • 117
  • 1
  • 8
1
vote
1 answer

Flask: how to get rid of pdfkit causing 500 Error

I'm getting errors while trying to create a .pdf file with my Flask application's pdfkit. The application does work on a local machine. The problems start to appear when I try to run the code on Digitalocean's Ubuntu 18.04 droplet (Nginx is used as…
1
vote
1 answer

Ad on page causes problem "Bad Gateway" for scraping

I am trying to save some webpages as PDF with Python using pdfkit. It worked pretty well last week (so, I guess it's not a coding error by me). Now, the site changed some ads which causes a "Bad Gateway" problem. I think it might be because of some…
rapha
  • 35
  • 1
  • 1
  • 6
1
vote
0 answers

Python-PDFkit error - QFontEngine: Glyph neither outline nor bitmap format

tl;dr: Python-PDFkit generates an error when a CSS file is provided during HTML to PDF conversion. I'm using Python-PDFkit (that uses WkHTMLtoPDF based on Qt) to turn an HTML file into a PDF file. The HTML is generated by Jinja2 and contain base64…
Teazane
  • 134
  • 2
  • 11
1
vote
0 answers

wkhtmltopdf from list of files generates wrong TOC based on H tags

I am using python-pdfkit as follows to generate a PDF: pdfkit.from_file(list_of_files, toc=toc, cover=cover, cover_first=True, options=default_options) My problem is regarding the table of contents that is generated: The table of contents is…
1
vote
0 answers

wkhtmltopdf: Custom order TOC

I am using wkhtmktopdf to transform my sphinx documentation into PDF. My problem comes with the TOC that is generated, which due to the different HTML pages, is not in order. My current situation is as…
1
vote
2 answers

PDFKit FileNotFoundError Python

I'm trying to convert a html file to PDF using pdfkit in Python3. I'm using PyCharm with macOS Mojave and this is the error I get when trying to run the code: Traceback (most recent call last): File…
César Vargas
  • 41
  • 1
  • 7
1
vote
1 answer

wkhtmltopdf doesn't work when deployed in heroku python app using(Flask) pdfkit and wkhtmltopdf

I am in a process of converting HTML files to pdf in python and attach these pdf files to mail and process it I've installed pdfkit(0.6.1), wkhtmltopdf(0.2) and also wkhtmltopdf for windows. And added wkhtmltopdf bin path. It is working in my…
Meghana Goud
  • 111
  • 1
  • 9
1
vote
2 answers

For loop goes through the first 2 items on the list then has a Tracback error on the Third

I'm using a for loop to go down a list and create variables for the pdfkit module and it works just fine for the first two items on the list then has an error on the Third. This is my code: import pdfkit import time link1 = "https://www." link2 =…
1
vote
1 answer

Error when trying to display the number of pages in PdfKit

A few days ago, I started working with PDFKIT, to generate reports in Python. My problem appears when I want to show the number of pages that the document has. I do not know what I am missing, or where I am failing. Below is the error that is…
1
vote
2 answers

Boarder added when using pdfkit A4 output

Is there a way to remove this white boarder that's added on the output when using pdfkit? This isn't something I've added in the .html file. However it may be worth noting that i've forced the body size of the html file to be that of an A4…
Hazzamataza
  • 983
  • 2
  • 12
  • 25
1
vote
1 answer

Bokeh autoload_static still interactive

I'm assuming I'm doing something wrong as when I attempt to use Bokeh's 'autoload_static' function and place the script tag in my html file the graph is still interactive? In addition to this, the output of my script tag (by autoload static) doesn't…
Hazzamataza
  • 983
  • 2
  • 12
  • 25
1
vote
1 answer

Cannot write full HTML into the PDF

This has been pissing me off from yesterday, and I'm just out of ideas. I'm trying to write a PDF with a subclassed pdfkit.PDFKit (let's call it MyPDFKit): it works well (I just subclassed it to add the possibility of using xvfb-run in the args). I…
RompePC
  • 815
  • 1
  • 8
  • 17
1
vote
2 answers

Python configure pdfkit on windows

I started to learn python recently and I want to convert existing html file to pdf file. It is very strange, but pdfkit seems to be the only lib for pdf docs for python. import pdfkit pdfkit.from_file("C:\\Users\\user\Desktop\\table.html",…
mr.boris
  • 3,667
  • 8
  • 37
  • 70
1
vote
2 answers

unable to dowload pdf using python

I am trying to download a pdf using python script. I had tried using urlib, pdfkit and also curl. While I am trying to download the pdf, I am getting html/js content of the page instead of the pdf file. Kindly help me to solve this issue. using…
Vamshi Kolanu
  • 409
  • 2
  • 5
  • 16