使用 Python 对 PDF 文档进行数字签名
Sign PDF documents digitally with Python
我正在尝试使用 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)
有没有人已经尝试过这个工具并对我有什么建议?或者,如果您知道任何其他 Python 签名 PDF 文件的库,请告诉我。
谢谢。
In Windows copy the file mypdfsigner.pyd
from "C:\Program Files\MyPDFSigner"
to C:\Python27\Lib\site-packages.
它还说你需要将安装添加到你的路径:
To run the example in Windows add "C:\Program Files\MyPDFSigner" to the environment PATH variable
此外,您必须先配置它:
Before using any of the extensions it is necessary to start with the graphical application to create a configuration file for the key store and alias one wants to use. The application creates a .mypdfsigner file in your home directory.
我正在尝试使用 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)
有没有人已经尝试过这个工具并对我有什么建议?或者,如果您知道任何其他 Python 签名 PDF 文件的库,请告诉我。
谢谢。
In Windows copy the file
mypdfsigner.pyd
from"C:\Program Files\MyPDFSigner"
toC:\Python27\Lib\site-packages.
它还说你需要将安装添加到你的路径:
To run the example in Windows add "C:\Program Files\MyPDFSigner" to the environment PATH variable
此外,您必须先配置它:
Before using any of the extensions it is necessary to start with the graphical application to create a configuration file for the key store and alias one wants to use. The application creates a .mypdfsigner file in your home directory.