Guan-Lin
搜索文档…
⌃K

Python

分拆為一頁一個檔案
from PyPDF2 import PdfWriter, PdfReader
inputpdf = PdfFileReader(open(self.pdf_file_path, "rb"))
for idx, split_pdf_file_path in enumerate(self.split_pdf_file_paths):
output = PdfFileWriter()
output.addPage(inputpdf.getPage(idx))
with open(split_pdf_file_path, "wb") as outputStream:
output.write(outputStream)
最近更新 27d ago