first commit
0 parents
Showing
4 changed files
with
25 additions
and
0 deletions
.gitignore
0 → 100644
| 1 | .idea/ | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
README.md
0 → 100644
| 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 |
pdf_to_img.py
0 → 100644
This diff is collapsed.
Click to expand it.
requirements.txt
0 → 100644
-
Please register or sign in to post a comment