软件资料库

将来,我估计要换台电脑,但是有一对使用频率很低但是容易忘记的软件,这里来记录一下

PDF叠加

将两个PDF叠加起来,效果如下图所示。用它的主要原因是Goodnote导出的PDF会让原本识别出来的中文乱码,将笔迹单独导出并与原文件叠加可以实现效果,而且不会出现乱码

这里可以使用python库PyPDF4实现,首先在命令行进行安装

pip install PyPDF4

然后新建一个py代码文件,运行即可

from PyPDF4 import PdfFileWriter, PdfFileReader
def create_watermark(input_pdf, output, watermark):
    watermark_obj = PdfFileReader(watermark)
    pdf_reader = PdfFileReader(input_pdf)
    pdf_writer = PdfFileWriter()
    for i in range(pdf_reader.getNumPages()):
        page = pdf_reader.getPage(i)
        page.mergePage(watermark_obj.getPage(i))
        pdf_writer.addPage(page)
    with open(output, 'wb') as out:
        pdf_writer.write(out)

if __name__ == '__main__':
    create_watermark(
    input_pdf = r'C:\Users\Administrator\Desktop\PDF_demp.pdf', 
    output = r'C:\Users\Administrator\Desktop\watermarked_pdf.pdf',
    watermark = r'C:\Users\Administrator\Desktop\watermark.pdf')

评论

  • john wick 回复

    Well I really enjoyed reading it. This article offered by you is very effective for proper planning. Diannne Guss Rosemarie

  • sikis izle 回复

    This is really interesting, You are a very skilled blogger. Hali Terrill Chappell

  • casino 回复

    Hiya very nice website!! Man .. Excellent .. Superb .. Nisse Falito Hennessey

  • bahis 回复

    Wow, great content write-up. Really thank you! Amazing. Becca Derry Thorner

  • sikis 回复

    PSN CODES just for YOU! Oh a there is the God of War. Bobbee Shane Tati

  • erotik 回复

    I think the admin of this web site is in fact working hard for his website, as here every information is quality based stuff. Darlene Griffy Alex

  • erotik 回复

    I need to to thank you for this very good read!! I definitely enjoyed every little bit of it. Kerry Kelsey Hitoshi

  • sikis 回复

    Hello colleagues, how is all, and what you wish for to say regarding this article, in my view its genuinely remarkable in favor of me. Rafa Kris Skell

  • erotik 回复

    Whats up very nice blog!! Guy .. Beautiful .. Wonderful .. Melonie Farly Dennett

  • bahis 回复

    Words have meaning. And the intelligent posters considers that. Karole Britt Eldwin

发表评论

本网站由又拍云提供CDN加速/云存储服务.