Answer the question
In order to leave comments, you need to log in
How to insert image into pdf WeasyPrint?
Good afternoon.
Maybe someone has already encountered a problem, not how it is impossible to insert an image into a pdf.
my generate function
def get_pdf(self, request):
rendered_html = html_pdf('test.html')
pdf = HTML(string=rendered_html, base_url=request.build_absolute_uri()).write_pdf()
return pdf
{% load static %}
<img src="{% static '1.png' %}"
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question