
WeasyPrint
CLI用 HTML 与 CSS 排版并导出 PDF 的渲染引擎,支持分页等打印样式标准,适合批量生成统计报告、发票与票据。Python 实现,依赖系统的 Pango 库。
The Awesome Document Factory
WeasyPrint is a smart solution helping web developers to create PDF documents. It turns simple HTML pages into gorgeous statistical reports, invoices, tickets…
From a technical point of view, WeasyPrint is a visual rendering engine for HTML and CSS that can export to PDF. It aims to support web standards for printing. WeasyPrint is free software made available under a BSD license.
It is based on various libraries but not on a full rendering engine like WebKit or Gecko. The CSS layout engine is written in Python, designed for pagination, and meant to be easy to hack on.
- Free software: BSD license
- For Python 3.11+, tested on CPython and PyPy
- Documentation: https://doc.courtbouillon.org/weasyprint
- Examples: https://weasyprint.org/#samples
- Changelog: https://github.com/Kozea/WeasyPrint/releases
- Code, issues, tests: https://github.com/Kozea/WeasyPrint
- Code of conduct: https://www.courtbouillon.org/code-of-conduct
- Professional support: https://www.courtbouillon.org
- Donation: https://opencollective.com/courtbouillon
WeasyPrint has been created and developed by Kozea (https://kozea.fr/). Professional support, maintenance and community management is provided by CourtBouillon (https://www.courtbouillon.org/).
Copyrights are retained by their contributors, no copyright assignment is required to contribute to WeasyPrint. Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion is licensed under the BSD 3-clause license, without any additional terms or conditions. For full authorship information, see the version control history.
相關資源

MarkItDown
CLI把 PDF、Word、Excel、PPT、HTML、图片、音频等文件转成保留标题、列表与表格结构的 Markdown,供大模型读取与分析。微软官方维护,需要 Python 3.10 以上。
microsoft/markitdown191k
Docling
CLI解析 PDF、DOCX、PPTX、XLSX、HTML、图片与音频等格式,还原版面、阅读顺序、表格与公式,导出 Markdown、HTML 或无损 JSON。IBM Research 发起,现由 LF AI & Data 基金会托管,可完全本地运行。
docling-project/docling69k
Marker
CLI把 PDF、图片、PPTX、DOCX、XLSX、EPUB 等文档转换为 Markdown、JSON 或 HTML,能还原表格、公式与版面结构,可选接入大模型提升精度。需 Python 3.10+ 与 PyTorch;模型权重大规模商用需付费授权。
datalab-to/marker40.5k
Camelot
CLI从 PDF 中抽取表格的开源工具,自带 camelot 命令行,可把财报、银行对账单、统计报表里的表格导出为 Excel、CSV 或 Markdown,并给出识别准确度。需要 Python 3.10+;默认只处理能选中文字的 PDF,扫描件需另装 ml 与 ocr 扩展;结果建议人工核对。
camelot-dev/camelot3.8k
pdf2docx
CLI把 PDF 转成可编辑的 Word 文档,尽量还原段落、表格、图片和版面,也能单独抽取表格,适合修改只拿到 PDF 版的合同、公文和试卷。需 Python 环境;只适用于电子版 PDF,扫描件需先 OCR。Artifex 已不再主动维护,靠社区修复。
ArtifexSoftware/pdf2docx3.5k
Pix2Text
CLI把含数学公式、表格的图片或整份 PDF(含扫描件)识别成 Markdown 与 LaTeX,中英文效果好,支持 80 多种语言,适合教师把试卷、讲义数字化,学生整理笔记。开源的 Mathpix 替代品,在本机运行,需要 Python 环境。
breezedeus/Pix2Text3.3k