1.安装pikepdf包: pip install pikepdf
前提:能打开pdf查看
可以解除不能复制等功能
2. 代码
# pdf解密
# 1.安装pikepdf包: pip install pikepdf
import pikepdf
# opens a PDF with restrictive editing enabled, but that still
# allows printing.
def pdf_Crack(startFile,endFile):
with pikepdf.open(startFile) as pdf:
pdf.save(endFile)
return endFile
# 2.修改自己文件的位置
start = '1.pdf'
end = 'crack1.pdf'
pdf_Crack(start, end)