首页 > 解决方案 > 使用 Python 编辑 pdf 中的信息

问题描述

我需要使用 Python 编辑 pdf 文件中的一些信息。有图书馆可以做吗?我试过'PyPDF2'和'Reportlab'但没有运气。

标签: pythonpython-3.x

解决方案


尝试类似:

from PyPDF2 import PdfFileReader, PdfFileWriter

fin = open('source.pdf', 'rb')
reader = PdfFileReader(fin)
writer = PdfFileWriter()

或咨询以下网站: https ://www.binpress.com/manipulate-pdf-python/

https://www.blog.pythonlibrary.org/2018/06/06/creating-and-manipulating-pdfs-with-pdfrw/

让我知道这是否有帮助,因为您的问题更像是一个开放式问题。


推荐阅读