2011-10-27 55 views

回答

6

here似乎提供了使用Ruby签署PDF的扩展。它不是免费的,但它看起来像提供了一个本地ruby界面。

下面是如何在Ruby中使用(一直在安装之后):

require 'mypdfsigner' 
include MyPDFSigner 

inputPath = "/tmp/input.pdf" 
outputPath = "/tmp/output.pdf" 
location = "Chicago" 
reason = "Demo" 
contactInfo = "+1 555-555-5555" 
certify = false # not supported yet 
visible = true 
title = "Signing with MyPDFSigner" 
author = "KryptoKoder" 
subject = "Ruby Extension" 
keywords = "PKCS#12, MyPDFSigner, PDF" 
confFile = "" # defaults to /usr/local/mypdfsigner/mypdfsigner.conf if empty 
timestamp = true 

puts mypdfsigner_sign(inputPath, outputPath, location, reason, contactInfo, certify, visible, title, author, subject, keywords, confFile, timestamp) 

还有一个命令行界面,这样你就可以编写脚本,如果需要,以及一个桌面应用程序。

+0

谢谢@cdeszaq。我可以看到它不是像“gem instal mypdfsigner”这样的常见安装吗?你知道这是为什么吗? –

+0

@RicardoAcras - 我不知道为什么,但我猜想它与它不是免费的,以及具有桌面应用程序和命令行脚本功能。你必须要求公司确定。 – cdeszaq

1

我会给我们一个iText,因为它可以构建PDF并且也可以对它们进行签名...

相关问题