使用pikepdf包进行PDF解密
解密前提:是要先能打开查看PDF文档内容。
通过识别重新保存一个没有密码的文档
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