Generating Dynamic PDFs With CSS In Flask – Bootstrap Example


https://i.ytimg.com/vi/Jg20ZFqF7BE/hqdefault.jpg



In the first video, I just showed you how to generate plain PDF files with no styling. In this video, I’ll continue by showing you how to include CSS within your PDF file to make it look much better.

You’ll be using the Python library called PDFKit to do this. Also, I’ll take a Bootstrap example and convert it to a PDF.

Join my free course on the basics of Flask-SQLAlchemy: https://prettyprinted.com/flasksql

Watch the first video here: https://youtu.be/C8jxInLM9nM

To download a Flask cheat sheet, go here: http://prettyprinted.com/flaskcheatsheet/

Documentation for PDFKit and wkhtmltopdf:

https://pypi.python.org/pypi/pdfkit

https://github.com/JazzCore/python-pdfkit/wiki/Using-wkhtmltopdf-without-X-server

Original source

10 thoughts on “Generating Dynamic PDFs With CSS In Flask – Bootstrap Example

Leave a Reply