我正在尝试用Python签署PDF文档,发现了一个叫做MyPDFSigner的东西。
它有很好的文档记录,但是我发现文档有点混乱。我遇到的唯一问题是如何安装mypdfsigner模块来运行签署文档的代码。
文档本身提供了一个代码示例,但是当模块没有安装时,我将无法运行它:
inputPath = "/tmp/input.pdf"
outputPath = "/tmp/output.pdf"
location = "Chicago, Illinois"
reason = "Demo"
contactInfo = "+1 555-555-5555"
certify = True
visible = True
title = "Signing with MyPDFSigner"
author = "KryptoKoder"
subject = "Python Extension"
keywords = "PKCS#12, PDF, MyPDFSigner"
confFile = "" # defaults to /usr/local/mypdfsigner/mypdfsigner.conf if empty
timestamp = True
print mypdfsigner.sign(inputPath, outputPath, location, reason, contactInfo, certify, visible, title, author, subject, keywords, confFile, timestamp)有没有人已经尝试过这个工具,对我有什么建议?或者,如果你知道任何其他签署PDF文件的Python库,请告诉我。
谢谢。
发布于 2015-04-14 22:11:28
documentation说:
Windows中的
将文件
mypdfsigner.pyd从"C:\Program Files\MyPDFSigner"复制到C:\Python27\Lib\site-packages.
它还说您需要将安装添加到您的路径中:
要在Windows中运行示例,请将"C:\Program Files\MyPDFSigner“添加到环境PATH变量中
此外,您必须先配置它:
在使用任何扩展之前,有必要从图形应用程序开始,为要使用的密钥库和别名创建一个配置文件。应用程序将在您的主目录中创建一个.mypdfsigner文件。
https://stackoverflow.com/questions/29629410
复制相似问题