Hello ,I was trying to sign a pdf file using a certificate from a usb token.(Aladin usb etoken pro 72)
I used the following code (copied from documentation ) :
"namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{// Creates a new document
PdfDocument doc = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = doc.Pages.Add();
//Create new PDF certificate instance.
PdfCertificate pdfCert = PdfCertificate.FindBySubject(0, "DARABAN GABRIEL");
//Create new PDF signature instance.
PdfSignature signature = new PdfSignature(doc, page, pdfCert, "Signature");
signature.Bounds = new System.Drawing.RectangleF(new System.Drawing.PointF(5, 5), new System.Drawing.SizeF(100, 200));
doc.Save("SignedPdfSample.pdf");
doc.Close(true);
}
}
}"
Everything is ok until the line doc.Save where it raise an overflow error :
Exception thrown: 'System.OverflowException' in Syncfusion.Pdf.Base.dll
An unhandled exception of type 'System.OverflowException' occurred in Syncfusion.Pdf.Base.dll
Arithmetic operation resulted in an overflow.
My guess is that the problem is caused by the certificate i am using .
I use a certificate issued by DIGISIGN
C=RO,O=DigiSign S.A.,2.5.4.97=VATRO-17544945,OU=DigiSign Certification Services,CN=DigiSign Qualified CA Class 3 2017
PKIX QCSyntax-v2 [1.3.6.1.5.5.7.11.2]
ETSI QC Compliance [0.4.0.1862.1.1]
ETSI Transaction Value Limit [0.4.0.1862.1.2]
ETSI Retention Period [0.4.0.1862.1.3]
ETSI Secure Signature Creation Device [0.4.0.1862.1.4]
OID [0.4.0.1862.1.6]
OID [0.4.0.1862.1.5]
Is there any way to resolve the error ?
Thank you