Hi there,
I am making a small proof of concept to determine if pdftron can achieve the following scenario for the application I am working on, before potentially buying a licence:
- Open a pdf document with existing unsigned signature fields,
- Calculate the required digest to send to a third-party api which itself returns the signature,
- Put the signature in the pdf and save.
So far the signing part works fine, but I can’t get it to be displayed on the pdf. I can only see the signature in the ‘Signatures’ tab in Acrobat Reader for example.
I am expecting to see the contact info, reason, location, signing time, etc. where the signing widget is, but it stays blank whatever I tried.
This is basically what I do at the moment:
// Open the pdf, retrieve the signature, create a dictionnary and add some values
using PDFDoc doc = new PDFDoc(inputFile);
var field = doc.GetField(“signature_1”);
var sig = new DigitalSignatureField(field);
sig.CreateSigDictForCustomSigning(“Adobe.PPKLite”, DigitalSignatureField.SubFilterType.e_adbe_pkcs7_detached, 31000);
sig.SetContactInfo(“contact info”);
sig.SetReason(“reason”);
sig.SetLocation(“location”);
doc.Save(outputFile, SaveOptions.e_incremental);
// Calculate the digest
byte[] pdf_digest = sig.CalculateDigest(DigestAlgorithm.Type.e_sha512);
// […] call the api which returns the signature and save
byte[] signatureBytes = // omitted
doc.SaveCustomSignature(signatureBytes, sig, outputFile);
Do I miss a step regarding the signature appearance?
Best Regards,
Xavier