f4fffb77 by Gruel

first commit

0 parents
1 .idea/
...\ No newline at end of file ...\ No newline at end of file
1 # PDF转图片脚本
2
3 ## 主要处理逻辑
4 - 提取PDF页面中的图片对象
5 - 图片对象数目为0(如电子账单),保存整个页面为png图片
6 - 图片对象数目为1
7 - 大图,保存图片对象
8 - 小图(如电子账单盖章),保存整个页面为png图片
9 - 图片对象数目大于1
10 - 多大图,保存图片对象
11 - 多碎图,根据宽高突变位置分组,拼接合并后保存
12 - 其他特殊情况:保存整个页面为png图片
13
14 ## 用法
15 - python3.6+
16 - `pip install -r requirements`
17 - `python pdf_to_img.py pdf_path [img_path]`
18
19 | 参数 | 是否必须 | 说明 | 缺省值 |
20 | ---- | ---- | ---- | ---- |
21 | pdf_path | 是 | PDF文件或目录路径 | - |
22 | img_path | 否 | 图片保存路径 | PDF文件路径 |
...\ No newline at end of file ...\ No newline at end of file
1 Pillow==7.2.0
2 PyMuPDF==1.17.0
...\ No newline at end of file ...\ No newline at end of file
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!