I use the following code and when we set UseLtv = true, we got an Obj ref not set error on the save method.
Here is the code:
using (Document document = new Document(“c:\temp\a.pdf”))
{
using (PdfFileSignature signature = new PdfFileSignature(document))
{
X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);
store.Open(OpenFlags.ReadOnly);
X509Certificate2Collection certificates = store.Certificates.Find(X509FindType.FindByThumbprint, “58944ba2c6fdb351fcf2d293edf1e3f7a4def250”, false);
System.Drawing.Rectangle rect = new System.Drawing.Rectangle(100, 100, 200, 100);
ExternalSignature extSig = new ExternalSignature(certificates[0]);
extSig.UseLtv = true;
signature.Sign(1, "Signature Reason", "Contact", "Location", true, rect, extSig);
signature.Save("c:\\temp\\NonWorking.pdf");
}
}