因為業(yè)務(wù)需求印蔬,做了一個按頁數(shù)拆分pdf的小工具谷徙,本質(zhì)還是服務(wù)于數(shù)據(jù)分析的模塊
0. 思路
- 按指定頁數(shù)進(jìn)行拆分
- 處理的包:
PyPDF2
,click
- 環(huán)境:python >= 3.9
1. 用法
- 使用:-p 是指多少頁拆分一次
python PDFSpliter.py -f input.pdf -p page_num <-o output>
- 詳細(xì)參數(shù)
Usage: PDFSpliter.py [OPTIONS]
:param file: 文件地址 :param page: 要拆分的頁面間隔頁 :param output: 定義的輸出路徑
Options:
-f, --file PATH PDF file abs [required]
-p, --page TEXT Split pdf into pages that you want. If page is set as 10,
then 100 pages pdf will be split every 10 pages.
[required]
-o, --output TEXT Output file name
-h, --help Show this message and exit.
2. 總結(jié)
- 目前很簡陋吉嚣,看后面需求進(jìn)行完善
- 也是為了建設(shè)一下小倉庫