We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我使用 MarginNote 来阅读本书, 但是每本书都有很多PDF, 一个一个导入比较凌乱, 不好整理, 所以写了一个简单的 Python 脚本, 将 PDF 合并成一个.
import PyPDF2 import os import glob def merge_pdfs(pdf_list, output_path): pdf_merger = PyPDF2.PdfMerger() for pdf in pdf_list: pdf_merger.append(pdf) with open(output_path, 'wb') as output_file: pdf_merger.write(output_file) def list_sorted_pdfs(directory): # 获取当前目录下的所有 PDF 文件 pdf_files = glob.glob(os.path.join(directory, "*.pdf")) # 按字母顺序排序 pdf_files.sort() return pdf_files merge_pdfs(list_sorted_pdfs("./"),"Book1.pdf")
The text was updated successfully, but these errors were encountered:
谢谢你!
Sorry, something went wrong.
合并之后显示这种,如何解决
可以看下合并脚本的输出有没有什么异常吗,合并后的文件大小是否在正常范围内
No branches or pull requests
我使用 MarginNote 来阅读本书, 但是每本书都有很多PDF, 一个一个导入比较凌乱, 不好整理, 所以写了一个简单的 Python 脚本, 将 PDF 合并成一个.
The text was updated successfully, but these errors were encountered: