borb is a library for reading, creating and manipulating PDF files in python.
borb
is a powerful and flexible Python library for creating and manipulating PDF files.
borb
provides a pure Python solution for PDF document management, allowing users to read, write, and manipulate PDFs. It models PDF files in a JSON-like structure, using nested lists, dictionaries, and primitives (numbers, strings, booleans, etc.). Created and maintained as a solo project, borb
prioritizes common PDF use cases for practical and straightforward usage.
Explore borb
โs capabilities in the examples repository for practical, real-world applications, including:
PageLayout
โฆand much more!
Install borb
directly via pip
:
pip install borb
To ensure you have the latest version, consider the following commands:
pip uninstall borb
pip install --no-cache borb
Create your first PDF in just a few lines of code with borb
:
from pathlib import Path
from borb.pdf import Document, Page, PageLayout, SingleColumnLayout, Paragraph, PDF
# Create an empty Document
d: Document = Document()
# Create an empty Page
p: Page = Page()
d.append_page(p)
# Create a PageLayout
l: PageLayout = SingleColumnLayout(p)
# Add a Paragraph
l.append_layout_element(Paragraph('Hello World!'))
# Write the PDF
PDF.write(what=d, where_to="assets/output.pdf")
borb
is dual-licensed under AGPL and a commercial license.
The AGPL (Affero General Public License) is an open-source license, but commercial use cases require a paid license, especially if you intend to:
borb
in closed-source projectsborb
in any closed-source productFor more information, contact our sales team.
Special thanks to:
Your contributions and guidance have been invaluable to borb
โs development.