ArtifexSoftware / pdf2docx

Open source Python library for converting PDF to DOCX.
https://pdf2docx.readthedocs.io
GNU Affero General Public License v3.0
2.55k stars 373 forks source link

修复pix.tobytes失败的问题跟修复jpeg附带旋转信息时插入docx中角度错误的bug #292

Closed heweisheng closed 4 months ago

heweisheng commented 5 months ago

第一个问题在https://github.com/ArtifexSoftware/pdf2docx/issues/198 实践了,目前tobytes基本能处理,带来的问题需要依赖PIL的图片库 第二个问题发现一些jpeg图片样本插入到pdf后fitz没法获取exif,只能用get_image_rects返回的矩阵推测旋转,目前测试了jpg的7中exif情况,若有遗漏,可以补充,具体的样本: 7931 7937胶TBT3139-2021 1.pdf image

修复后 image

heweisheng commented 4 months ago

有些问题解决不了,矩阵变换搞不定,只处理exif完全不够用