tool.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:watson-ta 作者: signofthehorns 项目源码 文件源码
def split_pdf(fp, pagenos=[]):
    # Remove any possible duplicate pages
    pagenos = list(set(pagenos))
    # Create the pdf reader
    inputpdf = PdfFileReader(fp)
    # Create the pdf writer
    output = PdfFileWriter()
    # Loop through all the page numbers we want to split
    for i in pagenos:
        # Add each page to the writer
        output.addPage(inputpdf.getPage(i))
    return output

# Gets all top level sections from the PDF
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号