https://github.com/borb-pdf/borb
borb is a library for reading, creating and manipulating PDF files in python.
https://github.com/borb-pdf/borb
library pdf pdf-conversion pdf-converter pdf-generation pdf-library python python3 sdk typesetting
Last synced: 16 days ago
JSON representation
borb is a library for reading, creating and manipulating PDF files in python.
- Host: GitHub
- URL: https://github.com/borb-pdf/borb
- Owner: borb-pdf
- License: other
- Created: 2020-11-07T14:04:37.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2026-02-23T19:05:28.000Z (about 1 month ago)
- Last Synced: 2026-03-05T04:16:12.505Z (21 days ago)
- Topics: library, pdf, pdf-conversion, pdf-converter, pdf-generation, pdf-library, python, python3, sdk, typesetting
- Language: Python
- Homepage: https://borbpdf.com/
- Size: 733 MB
- Stars: 3,565
- Watchers: 34
- Forks: 158
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Cla: CONTRIBUTOR_LICENSE_AGREEMENT.md
Awesome Lists containing this project
README
#  borb
[](https://github.com/psf/black)
[]()
[]()
[]()
[]()
[](https://pepy.tech/project/borb)
[](https://pepy.tech/project/borb)
`borb` is a powerful and flexible Python library for creating and manipulating PDF files.
## ๐ Overview
`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.
## โจ Features
Explore `borb`โs capabilities in the [examples repository](https://github.com/jorisschellekens/borb-examples) for practical, real-world applications, including:
- PDF Metadata Management (reading, editing)
- Text and Image Extraction
- Adding Annotations (notes, links)
- Content Manipulation (adding text, images, tables, lists)
- Page Layout Management with `PageLayout`
โฆand much more!
## ๐ Installation
Install `borb` directly via `pip`:
```bash
pip install borb
```
To ensure you have the latest version, consider the following commands:
```bash
pip uninstall borb
pip install --no-cache borb
```
## ๐ Getting Started: Hello World
Create your first PDF in just a few lines of code with `borb`:
```python
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")
```
## ๐ License
`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:
- Offer paid PDF services (e.g., PDF generation in cloud applications)
- Use `borb` in closed-source projects
- Distribute `borb` in any closed-source product
For more information, [contact our sales team](https://borbpdf.com/).
## ๐ Acknowledgements
Special thanks to:
- Aleksander Banasik
- Benoรฎt Lagae
- Michael Klink
Your contributions and guidance have been invaluable to `borb`'s development.