Questions tagged [python-pdfkit]

84 questions
0
votes
1 answer

Generate pdf using pdfkit in flask - reload page error

I'm trying to convert HTML to pdf using flask. I can use the following packages. pdfkit wkhtmltopdf When I run the server it cant load into the browser even the homepage cant load into the browser. I do not understand what's wrong with it. HTML…
0
votes
1 answer

How to specify PDF page size using pdfkit in python

I know in node we can do something set size: [width,height] like this. But while I replace this in python options = {'page-size':'A4'} with options = {'page-size':[width,height]} I get an error. I want to set a width of 60mm for POS
0
votes
1 answer

wkhtmltopdf : Exit with code 1 due to network error: RemoteHostClosedError

I am trying to generate pdf of the order summary in my ecommerce website but receiving the following error. OSError: wkhtmltopdf reported an error: Loading pages (1/6) [> ] 0% [======> …
Aditya Naitan
  • 162
  • 3
  • 11
0
votes
1 answer

Problem using Python's wrapper for wkhtmltopdf (pdfkit). object has no attribute 'configuration and others

I'm having an issue very similar to this post: pdfkit - python : 'str' object has no attribute decode I'm running a python script via a web app. import pdfkit after installing it with pip3, python version 3.6. import pdfkit def pdfkit(source,…
SScotti
  • 2,158
  • 4
  • 23
  • 41
0
votes
1 answer

Convert a csv file to PDF using Python

I have a dictionary which I converted to a csv file using pandas dataframe. Below is my csv file: date,time,type,text,start,end,Year,Movies.type 20/10/15,10:00:00,Horror,"adadadasdsfs sdsdfsdfasdfsfdf …
keerthi007
  • 223
  • 1
  • 13
0
votes
1 answer

How to convert content created for email to a PDF file in Python?

The code below sends an email with both text and image. I am trying to convert this email (text and images)to a pdf file and download the file to a specific path. Is there a way to convert this to pdf? from email.mime.multipart import…
Ana
  • 325
  • 2
  • 11
0
votes
1 answer

How can I install wkhtmltopdf (unpatched qt) in docker file?

I have installed wkhtmltopdf(patched qt)0.12.4 which gives error using with pdfkit. I want to install unpatched qt version as does't give me error in my localsetup my dockerfile : FROM python:3 RUN apt-get update RUN apt-get install -y openssl…
Bhaumik
  • 11
  • 1
  • 5
0
votes
1 answer

Package pdfkit opening windows cmd window during execution

I have a "strange" question. This is my working python code, it creates a PDF and writes a string on it. import pdfkit pdf_name = "abc.pdf" path_wkhtmltopdf = r'C:\Program Files\wkhtmltopdf\bin\wkhtmltopdf.exe' config =…
l000000l
  • 330
  • 1
  • 3
  • 14
0
votes
0 answers

How to force a page to a A4 using pdfkit (python)

I have a html page that i would to convert to pdf. My problem is that it don't fit on a A4, and I obtain 2 pages instead of 1. When I use 'page-size': 'a3' it fit perfectly, but I want a A4 pdf. Changing DPI or disabling smart shrinking does not…
Nolent
  • 1
  • 1
0
votes
2 answers

PDF images blurry when download as PDF in production with pdfkit python

I'm using pdfkit library to convert Html to pdf and after convert pdf then converted it in base64(String) and send it to as API response. In front-end (React) received base64(String) and create an element with base64(String) for download as pdf. But…
Masud Morshed
  • 87
  • 1
  • 10
0
votes
4 answers

How to apply some style to p tag come after specific h tag except other h tags in PDF kit

I would like to set margin-left:1em to p tag shown after h1 and also after h2: 2em, after h3: 3em, after h4: 4em. How can I do? Here is my code. h1~p {margin-left: 1em} h2~p {margin-left: 2em} h3~p {margin-left:…
user4565857
  • 155
  • 1
  • 2
  • 9
0
votes
1 answer

Can I add line numbers to the left margin using pyfpdf

How do I add continuous line numbers to the left margin using pyfpdf or any other pdf creation library? What I want is something similar to a MS Word document with line numbers in the left margin, where every line is numbered.
max_max_mir
  • 1,494
  • 3
  • 20
  • 36
0
votes
0 answers

wkhtmltopdf is unable to save Google line charts as PDF

I have developed a web application which generates reports using google charts. By using wkhtmltopdf I tried to save the HTML page as pdf but the google charts were not getting saved in the pdf. Can anyone help me with this This is the pdf…
0
votes
1 answer

python pdfpage.extract_words throws error

I have this code in my project to get all the words from pdf. words = pdfPage.extract_words(0.5,0.5) which throws the below error: Cannot convert to Decimal. Thanks in advance.
0
votes
1 answer

Converting HTML to PDF in Python

What is a good method for converting an HTML string file to PDF? I am trying to create a simple tool that creates a PDF report using some user inputs and an HTML template. I want to distribute this tool so that other coworkers can use it. Right now…