Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Thu Mar 29, 2018 3:29 am

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'}

1234562
 
Posts: 1
Joined: Wed Mar 28, 2018 7:23 am

Thu Mar 29, 2018 8:11 am

Hello,

Thanks for your feedback. After an initial test with the latest version(Spire.PDF Pack(Hot Fix) Version:4.3.14), I was unable to reproduce the issue. Please update to the version and give it a try.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Apr 02, 2018 8:26 am

Hello,

Did you try the latest version? How is it going?
We will appreciate it if your could give us some feedback.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF