Can we convert pdf to image by using jinja?

Hi Team,
I have upload a pdf file and i want to convert that pdf to images and that images i want to show in print format .it is possible using jinja code?
Please suggest solutions

Thanks & regards


Yes, it’s fully possible, but using Python Code, and not only Jinja Code.

Just for context, on the past I had to create various ESC/POS print formats, for ERPNext, and instead of create all those print formats in pure ESC/POS commands, we created a routine, based on the standard Jinja print format of ERPNext to generate images and then we embed the image into an standard ESC/POS body, to send to the printer.

There’s a lib in Python called Imgkit, that uses a secondary utility of wkhtmltopdf called wkhtmltoimg imgkit · PyPI

The API is almost the same of pdfkit so, you dont will have troubles to adapt the code that render PDF in frappe

Basedly on that code, you will be able to generate Images, basedly on the standard Jinja templates of ERPNext.

Good look on your journey, and learning path!
All the best!