I am trying to create a signature in a pdf document without the reason and location on it.
StampingProperties properties = new StampingProperties();
properties.UseAppendMode();
string fieldName = $"signature_{obj.Signer.Replace(" ", "_")}_{count}";
var IMG = "sig.jpg";
SignerProperties signerProperties = new SignerProperties();
signerProperties.SetPageRect(rectangle);
signerProperties.SetPageNumber(pageNr);
signerProperties.SetFieldName(fieldName);
signerProperties.SetSignatureCreator(signer);
signerProperties.SetSignDate(signDate);
signerProperties.SetReason("");
signerProperties.SetLocation("");
var signatureAppearance = new SignatureFieldAppearance(fieldName);
signatureAppearance.SetContent(new SignedAppearanceText().SetReasonLine("").SetLocationLine(""));
signatureAppearance.SetBackgroundImage(
new BackgroundImage.Builder()
.SetImage(new PdfImageXObject(ImageDataFactory.Create(IMG)))
.Build());
signerProperties.SetSignatureAppearance(signatureAppearance);
PdfSigner signer = new PdfSigner(pdfReader, outputStream, null, properties, signerProperties);
signer.SignDetached(eidSignature, chain, crlList, null, tsaClient, 0, PdfSigner.CryptoStandard.CADES);
I have tried to set the reason and location to an empty string in the SignatureFieldAppearance and the SignerProperties, but this does not work. What do I need to change in order for this to work?
New contributor
Tania Vanderstraeten is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1