Comments (4)
多谢指出问题和提供案例。测试了一下,很遗憾,pdf2docx
无法较好地转换你的文档。
程序报 ValueError: no valid image found错误
已经发布的0.4.6
版本确实对图片的支持存在不足,例如仅支持常规的RGB颜色空间,而你第二页的图片是ICCBased。所以在dev
分支做了一些改进尝试,目前还在进行中。
from pdf2docx.
最主要的还是部分中文乱码问题:
pdf2docx
本身是支持中文的,但是你提供的PDF文件不知是文件损坏还是版权保护有意为之,一些中文字符读出之后显示乱码。查找资料的解释是PDF文件缺少cmaps
表——将CJK
(中日韩)字符映射到unicode
字符的规则,结果导致无法正确获取文本。
例如手动复制第7页前言第一句话“欢迎阅读本书的第2版”,粘贴后就成了:
ᤀឳ本书ᄉኃ2版
如果尝试在线的PDF转word网站,例如smallpdf,结果也是一样的。
你的测试文件让我理解了 @shumintao 提的一个问题 #62
from pdf2docx.
确实对图片的支持存在不足,例如仅支持常规的RGB颜色空间,而你第二页的图片是ICCBased。所以在
dev
分支做了一些改进尝试,目前还在进行中。
了解了,加油!
from pdf2docx.
最主要的还是部分中文乱码问题:
pdf2docx
本身是支持中文的,但是你提供的PDF文件不知是文件损坏还是版权保护有意为之,一些中文字符读出之后显示乱码。查找资料的解释是PDF文件缺少cmaps
表——将CJK
(中日韩)字符映射到unicode
字符的规则,结果导致无法正确获取文本。例如手动复制第7页前言第一句话“欢迎阅读本书的第2版”,粘贴后就成了:
ᤀឳ本书ᄉኃ2版
如果尝试在线的PDF转word网站,例如smallpdf,结果也是一样的。
你的测试文件让我理解了 @shumintao 提的一个问题 #62
确实,也尝试用了其他的工具和pymupdf的作者也进行了交流,目前确实还无法解析示例中复制乱码的pdf文档
from pdf2docx.
Related Issues (20)
- [WARNING] Ignore Line "<image>" due to overlap
- 无法复原pdf文件中表格的框线 HOT 1
- How to save highlight in table after convert pdf to docx HOT 4
- Negative ref_dif in Blocks.py causing paragraph splitting
- 转化后存在页面超出的问题
- ValueError: unsupported colorspace for 'png' HOT 2
- Any support for ANDROID? HOT 1
- 转换时遇到字体名为中文(比如“宋体”)时,发生错误 HOT 1
- language support
- pdf2docx.Converter将某些特殊pdf转word时,某个子进程会卡住 HOT 3
- Table is broken when the table is displayed on 2 pages HOT 1
- 关于行高分配的逻辑疑问
- 转换docx表格中文本不全,请问这个可以解决吗
- Resource Han Rounded CN Light rendered as "Resource"
- 转word后图片被旋转180° HOT 11
- 表格生成的时候没有处理好浮动形图片 HOT 1
- 含XFA表单域的PDF无法转换为word
- 占用内存没有gc
- pdf转word后,表格会溢出边界
- Hyperlinks are not transferred
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf2docx.