랭킹으로 돌아가기

jorisschellekens/borb

Pythonborbpdf.com

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

pdfpdf-generationpdf-converterpdf-conversionpdf-librarypythonpython3typesettinglibrarysdk
스타 성장
스타
3.5k
포크
148
주간 성장
이슈
8
1k2k3k
2023년 1월2023년 6월2023년 12월2024년 6월
아티팩트PyPIpip install borb
README

borb logo borb

Code style: black Corpus Coverage : 100.0% Text Extraction : 93.1% Public Method Documentation : 100% Number of Tests : 760 Python : 3.8 | 3.9 | 3.10 Type Checking : 98%

Downloads Downloads

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

0. About borb

borb is a pure python library to read, write and manipulate PDF documents. It represents a PDF document as a JSON-like datastructure of nested lists, dictionaries and primitives (numbers, string, booleans, etc)

This is currently a one-man project, so the focus will always be to support those use-cases that are more common in favor of those that are rare.

📣 Next (major) release: You can track the status of the next release on a dedicated GitHub Pages.

1. About the Examples

The examples can be found in a separate repository. This ensures the borb repository stays relatively small, whilst still providing a thorough knowledgebase of code-samples, screenshots and explanatory text.

Check out the examples repository here!

They include;

  • Reading a PDF and extracting meta-information
  • Changing meta-information
  • Extracting text from a PDF
  • Extracting images from a PDF
  • Changing images in a PDF
  • Adding annotations (notes, links, etc) to a PDF
  • Adding text to a PDF
  • Adding tables to a PDF
  • Adding lists to a PDF
  • Using a PageLayout manager

and much more

1.0 Installing borb

borb can be installed using pip

pip install borb

If you have installed borb before, and you want to ensure pip downloads the latest version (rather than using its internal cache) you can use the following commands:

pip uninstall borb
pip install --no-cache borb

1.1 Hello World

To give you an immediate idea of the way borb works, this is the classic Hello World example, in borb:

from pathlib import Path

from borb.pdf import Document
from borb.pdf import Page
from borb.pdf import SingleColumnLayout
from borb.pdf import Paragraph
from borb.pdf import PDF

# create an empty Document
pdf = Document()

# add an empty Page
page = Page()
pdf.add_page(page)

# use a PageLayout (SingleColumnLayout in this case)
layout = SingleColumnLayout(page)

# add a Paragraph object
layout.add(Paragraph("Hello World!"))
    
# store the PDF
with open(Path("output.pdf"), "wb") as pdf_file_handle:
    PDF.dumps(pdf_file_handle, pdf)

2. License

borb is dual licensed as AGPL/Commercial software.

AGPL is a free / open source software license. This doesn't mean the software is gratis!

Buying a license is mandatory as soon as you develop commercial activities distributing the borb software inside your product or deploying it on a network without disclosing the source code of your own applications under the AGPL license. These activities include:

  • Offering paid services to customers as an ASP
  • Serving PDFs on the fly in the cloud or in a web application
  • Shipping borb with a closed source product

Contact sales for more information.

3. Acknowledgements

I would like to thank the following people, for their contributions / advice with regards to developing borb:

  • Aleksander Banasik
  • Benoît Lagae
  • Michael Klink
관련 저장소
microsoft/markitdown

Python tool for converting files and office documents to Markdown.

PythonPyPIMIT Licenselangchainopenai
168k12.1k
justjavac/free-programming-books-zh_CN

:books: 免费的计算机编程类中文书籍,欢迎投稿

GNU General Public License v3.0pythonjavascript
weibo.com/justjavac
117.7k28.2k
Stirling-Tools/Stirling-PDF

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

JavaMavenOtherdockerjava
stirling.com
87.7k7.8k
opendatalab/MinerU

Transforms complex documents like PDFs and Office docs into LLM-ready markdown/JSON for your Agentic workflows.

PythonPyPIOtherextract-datalayout-analysis
opendatalab.github.io/MinerU/
75.4k6.3k
docling-project/docling

Get your documents ready for gen AI

PythonPyPIMIT Licenseaiconvert
docling-project.github.io/docling
63.6k4.5k
siyuan-note/siyuan

A privacy-first, self-hosted, fully open source personal knowledge management software, written in typescript and golang.

TypeScriptnpmGNU Affero General Public License v3.0note-takinglocal-first
b3log.org/siyuan
45.3k2.9k
paperless-ngx/paperless-ngx

A community-supported supercharged document management system: scan, index and archive all your documents

PythonPyPIGNU General Public License v3.0angulararchiving
docs.paperless-ngx.com
43.3k2.9k
PDFMathTranslate/PDFMathTranslate

[EMNLP 2025 Demo] PDF scientific paper translation with preserved formats - 基于 AI 完整保留排版的 PDF 文档全文双语翻译,支持 Google/DeepL/Ollama/OpenAI 等服务,提供 CLI/GUI/MCP/Docker/Zotero

PythonPyPIGNU Affero General Public License v3.0chineselatex
pdf2zh.com
35.7k3.2k
ocrmypdf/OCRmyPDF

OCRmyPDF adds an OCR text layer to scanned PDF files, allowing them to be searched

PythonPyPIMozilla Public License 2.0pythonocr
ocrmypdf.readthedocs.io
34.2k2.4k
hehonghui/awesome-english-ebooks

经济学人(含音频)、纽约客、卫报、连线、大西洋月刊等英语杂志免费下载,支持epub、mobi、pdf格式, 每周更新

CSSnpmdownloadebooks
33.9k2.8k
posquit0/Awesome-CV

:page_facing_up: Awesome CV is LaTeX template for your outstanding job application

TeXLaTeX Project Public License v1.3ctexoverleaf
28.1k5.3k
koreader/koreader

An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices

LuaGNU Affero General Public License v3.0luajitkobo
koreader.rocks
27.9k1.8k