11 BEST PYTHON PDF GENERATOR LIBRARIES

share link

by Dejaswarooba dot icon Updated: Feb 13, 2023

technology logo
technology logo

Guide Kit Guide Kit  

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

Python doticonstar image 745 doticonVersion:binarydoticon
License: Weak Copyleft (LGPL-3.0)

Simple PDF generation for Python (FPDF PHP port)

Support
    Quality
      Security
        License
          Reuse

            pyfpdfby reingart

            Python doticon star image 745 doticonVersion:binarydoticon License: Weak Copyleft (LGPL-3.0)

            Simple PDF generation for Python (FPDF PHP port)
            Support
              Quality
                Security
                  License
                    Reuse

                      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

                      Python doticonstar image 3030 doticonVersion:v2.1.13doticon
                      License: Others (Non-SPDX)

                      borb is a library for reading, creating and manipulating PDF files in python.

                      Support
                        Quality
                          Security
                            License
                              Reuse

                                borbby jorisschellekens

                                Python doticon star image 3030 doticonVersion:v2.1.13doticon License: Others (Non-SPDX)

                                borb is a library for reading, creating and manipulating PDF files in python.
                                Support
                                  Quality
                                    Security
                                      License
                                        Reuse

                                          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

                                          Python doticonstar image 5852 doticonVersion:v59.0doticon
                                          License: Permissive (BSD-3-Clause)

                                          The awesome document factory

                                          Support
                                            Quality
                                              Security
                                                License
                                                  Reuse

                                                    WeasyPrintby Kozea

                                                    Python doticon star image 5852 doticonVersion:v59.0doticon License: Permissive (BSD-3-Clause)

                                                    The awesome document factory
                                                    Support
                                                      Quality
                                                        Security
                                                          License
                                                            Reuse

                                                              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

                                                              Python doticonstar image 2035 doticonVersion:v0.2.11doticon
                                                              License: Permissive (Apache-2.0)

                                                              A library for converting HTML into PDFs using ReportLab

                                                              Support
                                                                Quality
                                                                  Security
                                                                    License
                                                                      Reuse

                                                                        xhtml2pdfby xhtml2pdf

                                                                        Python doticon star image 2035 doticonVersion:v0.2.11doticon License: Permissive (Apache-2.0)

                                                                        A library for converting HTML into PDFs using ReportLab
                                                                        Support
                                                                          Quality
                                                                            Security
                                                                              License
                                                                                Reuse

                                                                                  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.

                                                                                  rinohtypeby brechtm

                                                                                  Python doticonstar image 460 doticonVersion:v0.5.4doticon
                                                                                  License: Strong Copyleft (AGPL-3.0)

                                                                                  The Python document processor

                                                                                  Support
                                                                                    Quality
                                                                                      Security
                                                                                        License
                                                                                          Reuse

                                                                                            rinohtypeby brechtm

                                                                                            Python doticon star image 460 doticonVersion:v0.5.4doticon License: Strong Copyleft (AGPL-3.0)

                                                                                            The Python document processor
                                                                                            Support
                                                                                              Quality
                                                                                                Security
                                                                                                  License
                                                                                                    Reuse

                                                                                                      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

                                                                                                      Python doticonstar image 4529 doticonVersion:20221105doticon
                                                                                                      License: Permissive (MIT)

                                                                                                      Community maintained fork of pdfminer - we fathom PDF

                                                                                                      Support
                                                                                                        Quality
                                                                                                          Security
                                                                                                            License
                                                                                                              Reuse

                                                                                                                pdfminer.sixby pdfminer

                                                                                                                Python doticon star image 4529 doticonVersion:20221105doticon License: Permissive (MIT)

                                                                                                                Community maintained fork of pdfminer - we fathom PDF
                                                                                                                Support
                                                                                                                  Quality
                                                                                                                    Security
                                                                                                                      License
                                                                                                                        Reuse

                                                                                                                          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

                                                                                                                          Python doticonstar image 1710 doticonVersion:v0.4doticon
                                                                                                                          License: Others (Non-SPDX)

                                                                                                                          pdfrw is a pure Python library that reads and writes PDFs

                                                                                                                          Support
                                                                                                                            Quality
                                                                                                                              Security
                                                                                                                                License
                                                                                                                                  Reuse

                                                                                                                                    pdfrwby pmaupin

                                                                                                                                    Python doticon star image 1710 doticonVersion:v0.4doticon License: Others (Non-SPDX)

                                                                                                                                    pdfrw is a pure Python library that reads and writes PDFs
                                                                                                                                    Support
                                                                                                                                      Quality
                                                                                                                                        Security
                                                                                                                                          License
                                                                                                                                            Reuse

                                                                                                                                              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

                                                                                                                                              Python doticonstar image 381 doticonVersion:Currentdoticon
                                                                                                                                              License: Strong Copyleft (GPL-3.0)

                                                                                                                                              The simplest way to extract text from PDFs in Python

                                                                                                                                              Support
                                                                                                                                                Quality
                                                                                                                                                  Security
                                                                                                                                                    License
                                                                                                                                                      Reuse

                                                                                                                                                        slateby timClicks

                                                                                                                                                        Python doticon star image 381 doticonVersion:Currentdoticon License: Strong Copyleft (GPL-3.0)

                                                                                                                                                        The simplest way to extract text from PDFs in Python
                                                                                                                                                        Support
                                                                                                                                                          Quality
                                                                                                                                                            Security
                                                                                                                                                              License
                                                                                                                                                                Reuse

                                                                                                                                                                  pdfquery - 

                                                                                                                                                                  • Used in extracting data from sets of PDFS. 
                                                                                                                                                                  • Depends on pdfminer, lxml, and pyquery. 
                                                                                                                                                                  • Converts PDF document into element tree for reliable access. 

                                                                                                                                                                  pdfqueryby jcushman

                                                                                                                                                                  Python doticonstar image 697 doticonVersion:Currentdoticon
                                                                                                                                                                  License: Permissive (MIT)

                                                                                                                                                                  A fast and friendly PDF scraping library.

                                                                                                                                                                  Support
                                                                                                                                                                    Quality
                                                                                                                                                                      Security
                                                                                                                                                                        License
                                                                                                                                                                          Reuse

                                                                                                                                                                            pdfqueryby jcushman

                                                                                                                                                                            Python doticon star image 697 doticonVersion:Currentdoticon License: Permissive (MIT)

                                                                                                                                                                            A fast and friendly PDF scraping library.
                                                                                                                                                                            Support
                                                                                                                                                                              Quality
                                                                                                                                                                                Security
                                                                                                                                                                                  License
                                                                                                                                                                                    Reuse

                                                                                                                                                                                      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

                                                                                                                                                                                      Python doticonstar image 5780 doticonVersion:3.9.1doticon
                                                                                                                                                                                      License: Others (Non-SPDX)

                                                                                                                                                                                      A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files

                                                                                                                                                                                      Support
                                                                                                                                                                                        Quality
                                                                                                                                                                                          Security
                                                                                                                                                                                            License
                                                                                                                                                                                              Reuse

                                                                                                                                                                                                pypdfby py-pdf

                                                                                                                                                                                                Python doticon star image 5780 doticonVersion:3.9.1doticon License: Others (Non-SPDX)

                                                                                                                                                                                                A pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files
                                                                                                                                                                                                Support
                                                                                                                                                                                                  Quality
                                                                                                                                                                                                    Security
                                                                                                                                                                                                      License
                                                                                                                                                                                                        Reuse

                                                                                                                                                                                                          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

                                                                                                                                                                                                          Python doticonstar image 1744 doticonVersion:Currentdoticon
                                                                                                                                                                                                          License: Weak Copyleft (MPL-2.0)

                                                                                                                                                                                                          A Python library for reading and writing PDF, powered by qpdf

                                                                                                                                                                                                          Support
                                                                                                                                                                                                            Quality
                                                                                                                                                                                                              Security
                                                                                                                                                                                                                License
                                                                                                                                                                                                                  Reuse

                                                                                                                                                                                                                    pikepdfby pikepdf

                                                                                                                                                                                                                    Python doticon star image 1744 doticonVersion:Currentdoticon License: Weak Copyleft (MPL-2.0)

                                                                                                                                                                                                                    A Python library for reading and writing PDF, powered by qpdf
                                                                                                                                                                                                                    Support
                                                                                                                                                                                                                      Quality
                                                                                                                                                                                                                        Security
                                                                                                                                                                                                                          License
                                                                                                                                                                                                                            Reuse

                                                                                                                                                                                                                              See similar Kits and Libraries