Technical Documentation#

PDF文件遵循一定的格式规范,PyMuPDF 提供了便利的解析函数, 用于获取页面元素例如文本和形状及其位置。然后,基于元素间的相对位置关系解析内容,例如将“横纵线条 围绕着文本”解析为“表格”,将“文本下方的一条横线”解析为“文本下划线”。最后,借助 python-docx 将解析结果重建为docx格式的Word文档。

以下分篇介绍提取PDF页面数据、解析和重建docx过程中的具体细节:


This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at artifex.com or contact Artifex Software Inc., 39 Mesa Street, Suite 108A, San Francisco CA 94129, United States for further information.

Discord logo