I have for some time looking for something to be able to create PDFs and integrate with my current project in Python 3. The usual references are Reportlab or pyPDF. But these two are not yet compatible with Python 3. I do see that since 2010 there has been some discussion about the port in Reportlab, but as of today I can't find any reference to the port.
Another alternative is to use an intermediate format from Python 3 to be consumed in another program, wrapped with a subprocess call. Relatorio does this. I might consider doing something similar or even generate XHTML/CSS and use xhtml2pdf.
Python File close() Method Python file method close() closes the opened file. A closed file cannot be read or written any more.
FPDF is a Python class that allows generating PDF files with Python code. It is free to use and it does not require any API keys. FPDF stands for Free PDF.
The PDFQuery library is considered among the fastest Python scraping library. It acts as a light wrapper around pdfminer, pyquery, and lxml. It is designed in order to extract data reliably from sets of PDFs with as little code as possible.
Popen() — Without CMD. If you want to open a PDF file in the standard PDF viewer such as Adobe Acrobat Reader, you can use the subprocess. Popen([path], shell=True) command. This doesn't open an intermediary command line prompt but opens the PDF directly in the viewer.
There is a new kid on the block which look promising. It supports print css features like page break.
Try weasyprint
The cairo library with the pycairo (not py2cairo, that's for python 2) binding works with python 3.x and can produce PDF output (among others).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With