Hello,
When running following code the system hangs on the line document.Save.
Sample:
class Program
{
static void Main(string[] args)
{
//Create PDF
using (PdfDocument document = new PdfDocument())
{
//Load certificate
PdfCertificate pdfCert = null;
using (FileStream certificateStream1 = new FileStream(@"certificate.pfx", FileMode.Open, FileAccess.Read))
{
pdfCert = new PdfCertificate(certificateStream1, "password");
}
//Add a page to the document.
PdfPage page = document.Pages.Add();
//Draw the text.
page.Graphics.DrawString("Hello World!!!", new PdfStandardFont(PdfFontFamily.Helvetica, 20), PdfBrushes.Black, new Syncfusion.Drawing.PointF(0, 0));
//Creates a digital signature.
PdfSignature signature = new PdfSignature(document, page, pdfCert, "Signature");
signature.TimeStampServer = new TimeStampServer(new Uri(@"http://timestamp.entrust.net/TSS/RFC3161sha2TS"));
signature.EnableLtv = true;
//Save to file system
using (Stream tempPdfNameStream = new FileStream("file.pdf", FileMode.Create))
{
document.Save(tempPdfNameStream); //The program keeps hanging on this line.
}
document.Close();
}
}
}