Page 1 of 1

Digital Signature not being displayed in PDF

Posted: Sat Jan 07, 2023 9:51 am
by dewangb
Using .NET Stimulsoft.Reports 2017.1.1.0

I have placed a textbox on the report.
On interaction the Tag field was set to PdfDigitalSignature

Report is rendered with c#:

StiReport report = new StiReport();
string reportPath = Server.MapPath("/DigitalSignatureTest.mrt");
report.Load(reportPath);
report.Dictionary.Databases.Clear();
report.Dictionary.Synchronize();
report.Compile();
report.Render(true);

FileStream fs = new FileStream(@"C:\Users\dewan\Desktop\DigiSignature-New.pfx", FileMode.Open);
byte[] buf = new byte[fs.Length];
fs.Read(buf, 0, buf.Length);
StiPdfExportSettings settings = new StiPdfExportSettings();
settings.UseDigitalSignature = true;
settings.GetCertificateFromCryptoUI = false;
settings.SubjectNameString = "Dewang Bhansali <dewangb@gmail.com>";
settings.UseLocalMachineCertificates = false;
settings.CertificateData = buf;
settings.CertificatePassword = "********";

report.ExportDocument(StiExportFormat.Pdf,@"C:\Users\dewan\Desktop\DigitalSignatureTestFromApp.pdf", settings);

Digital signature is embeded in PDF but we cannot see it in the textbox.
What am I doing wrong?

Re: Digital Signature not being displayed in PDF

Posted: Mon Jan 09, 2023 8:29 am
by Lech Kulikowski
Hello,

Please check the b2022.4
https://www.stimulsoft.com/en/blog/news ... ready-here

Thank you.