I created a pdfSignatureField ,but when I saved the file ,occured an exception , how can I solve it?
PdfDocument pdfdoc = new PdfDocument();
PdfPageBase pageSign = pdfdoc.Pages.Add(PdfPageSize.A4, new PdfMargins());
PdfSignatureField signaturefield1 = new PdfSignatureField(pageSign, "Signature1");
signaturefield1.BorderWidth = 1.0f;
signaturefield1.BorderStyle = PdfBorderStyle.Solid;
signaturefield1.BorderColor = new PdfRGBColor(System.Drawing.Color.Black);
signaturefield1.HighlightMode = PdfHighlightMode.Outline;
signaturefield1.Bounds = new RectangleF(100, 100, 100, 30);
pdfdoc.Form.Fields.Add(signaturefield1);
try
{
pdfdoc.SaveToFile("E:\\testSignature\\reportAddSignField.pdf",FileFormat.PDF);
pdfdoc.Close();
}
catch (Exception e) {
Console.Write("asd");
}
the exception info is {"Object Reference Not Set To An Instance Of An Object'}