Do you own a Debenu Quick PDF Library 12/11/10/9/8/7? Upgrade to Debenu Quick PDF Library 13!

Foxit Quick PDF Library

Frequently Asked Question:

Return to FAQ Index

Verify a added Signature in PDF

Question

I want to use QuickPDF for archiving the following tasks, from a source i am getting pdf files now what i required is:

  1. Update file properties
  2. Sign the document (Certificate Signature)
  3. And make it secure (Password security)

In this everything is working fine except in the signature it shows on the pdf is not verified, then after these pdf are required to be email to customers, so for this reason we are required to get the signature verified following is code:

Dim sfile = "C:\QuickPDF\Input.pdf"
Dim dfile = "C:\QuickPDF\Output.pdf"
Dim efile = "C:\QuickPDF\Output1.pdf"
Dim cert = "C:\QuickPDF\cert.pfx"

If QPDF.UnlockKey(LicenseKey) = 1 Then
With QPDF
If .LoadFromFile(sfile) = 1 Then
.SetInformation(1, "Author")
.SetInformation(2, "Title")
.SetInformation(3, "Subject")
.SetInformation(4, "Keyword")
.SetInformation(5, "Creator")
.SetInformation(6, "Producer")
.SaveToFile(dfile)
End If

If QPDF.LoadFromFile(dfile) = 1 Then
Dim Per As Integer = .EncodePermissions(1, 0, 0, 0, 0, 0, 0, 0)
QPDF.Encrypt("test", "", 2, Per)
QPDF.SaveToFile(dfile)
End If

QPDF.SignFile(dfile, "", "Signature", efile, cert, "123456", "Test Reason", 
"Test Location", "Test Contact Info")
End With
End If
Answer

The verification process only happens on the Reader side of things. You need to install the other half of your certificate into Adobe Reader or Nitro reader and a trusted source. When the reader program opens you PDF you can click on the signature and verify it which will match the signature in the document with your list of trusted sources and then it will say Validated.

The process is slightly different for each PDF Reader verision. The file that needs to be installed is a *.cer or *.p7b file.

You code above works well. You just need to do some playing around in your PDF reader software.


© 2015 Debenu & Foxit. All rights reserved. AboutBuyContactBlogNewsletterSupportFAQProduct UpdatesForum