Here are the best python PDF generator libraries. These libraries can be used for several PDF generation functions, including creating PDFs from text files and writing your data formats.
The acronym PDF stands for Portable Document Format. It is a flexible file format made by Adobe. It provides individuals with a simple, dependable way to present and interchange documents. It is accessible by anyone who examines it - irrespective of the software, hardware, or operating systems used. Python libraries can be used for a wide range of PDF-related operations. PDF pages can be divided, merged, cropped, and transformed. Customizing PDF files by adding custom data, viewing choices, and passwords are also possible. Extracting text and metadata from PDFs is also commonly done.
The following is a carefully selected list of the top python PDF generation libraries, emphasizing assisting developers with any PDF-related work.
pyfpdf -
- Document generation python library ported from PHP.
- Support for images of any format such as jpg, png, etc.
- Small, versatile, and easy to extend.
pyfpdfby reingart
Simple PDF generation for Python (FPDF PHP port)
pyfpdfby reingart
Python 745 Version:binary License: Weak Copyleft (LGPL-3.0)
borb -
- A PDF document is represented as a JSON-like data structure.
- A toolkit for accessing, editing, and modifying PDF documents.
- Extracting and changing images can also be done.
borbby jorisschellekens
borb is a library for reading, creating and manipulating PDF files in python.
borbby jorisschellekens
Python 3030 Version:v2.1.13 License: Others (Non-SPDX)
WeasyPrint -
- A brilliant approach for assisting developers in the generation of PDF documents.
- A dynamic generation engine for HTML and CSS that exports to PDF.
- It intends to adhere to online printing standards.
WeasyPrintby Kozea
The awesome document factory
WeasyPrintby Kozea
Python 5852 Version:v59.0 License: Permissive (BSD-3-Clause)
xhtml2pdf -
- Converts HTML file into a pdf file.
- Swiftly create PDF templates without having to learn new software.
- Open-source software and platform-independent.
xhtml2pdfby xhtml2pdf
A library for converting HTML into PDFs using ReportLab
xhtml2pdfby xhtml2pdf
Python 2035 Version:v0.2.11 License: Permissive (Apache-2.0)
rinohtype -
- A batch-mode document processor.
- User-friendly, customizable document styles.
- Based on a file pattern and style sheet, it converts structured documents to PDF.
pdfminer.six -
- A useful tool for mining info from PDF documents.
- Also, it can extract the text's location, font, and color.
- Built modular and can be implemented in our interpreter.
pdfminer.sixby pdfminer
Community maintained fork of pdfminer - we fathom PDF
pdfminer.sixby pdfminer
Python 4529 Version:20221105 License: Permissive (MIT)
pdfrw -
- Python utility for reading and writing pdf files.
- Used in merging, modifying, sub-setting, etc.
- Can also help in re-using existing PDFs in new ones.
pdfrwby pmaupin
pdfrw is a pure Python library that reads and writes PDFs
pdfrwby pmaupin
Python 1710 Version:v0.4 License: Others (Non-SPDX)
slate -
- Extract text from PDF using python.
- It depends on the pdfminer package.
- A specialized class called PDF presents each page as a string.
slateby timClicks
The simplest way to extract text from PDFs in Python
slateby timClicks
Python 381 Version:Current License: Strong Copyleft (GPL-3.0)
pdfquery -
- Used in extracting data from sets of PDFS.
- Depends on pdfminer, lxml, and pyquery.
- Converts PDF document into element tree for reliable access.
pypdf -
- Free and Open-source PDF handling library.
- Also, you can encrypt and decrypt PDF files using additional libraries.
- Can also transform pages into PDF files.
pypdfby py-pdf
A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
pypdfby py-pdf
Python 5780 Version:3.9.1 License: Others (Non-SPDX)
pikepdf -
- Python library powered by qpdf for reading and writing PDFs.
- A comprehensive PDF alteration and restoration library.
- Uses a bit of C++ along with python.
pikepdfby pikepdf
A Python library for reading and writing PDF, powered by qpdf
pikepdfby pikepdf
Python 1744 Version:Current License: Weak Copyleft (MPL-2.0)