D
D
Dmitry2020-06-08 21:25:42
Python
Dmitry, 2020-06-08 21:25:42

How to generate pdf (or image) from html?

The task is this, there is an identity frame, you need to insert text into it from an html file that is static and also add a full name and identity number from the list, I tried pdfkit but it inserts fields additionally, tell me how to get rid of them or can you tell me another way to generate certificates in pdf or into a picture?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Karbivnichy, 2020-06-08
@ipatov_dn

You can simplify the task. Take a screenshot of the frame, and use the pillow library to write text at the given coordinates. Text can be taken from a file. I made a similar bot, you write your full name to it, and it returns a document with text. Everything is very simple there, and the code, in my opinion, is about 30 lines. If the option is suitable, I can help with this library.
5ede87fba5745700775873.png

R
Roman Mirilaczvili, 2020-06-08
@2ord

From an HTML page with CSS:
wkhtmltopdf/wkhtmltoimage

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question