Subject: Error when signing with timestamp
Date: 2012-12-27 20:52:59
From: Armando secret
Source: error-signing-timestamp
----------------------------------------------------------------------

When I try to sign a PDF with a timestamp server, I get the following error: "Arithmetic operation resulted in an overflow".

Below is sample code:

[code lang='c#']
using (PdfImportedDocument doc = new PdfImportedDocument("input.pdf"))
{
    using (PdfBitmap bmp = new PdfBitmap("signature.png"))
    {
        PdfCertificate pdfCert = new PdfCertificate("test.pfx", "123");
        PdfPageBase page = doc.Pages[0];
        PdfDigitalSignature signature = new PdfDigitalSignature(doc, page, pdfCert, "Signature");
 
        signature.Bounds = new RectangleF(new PointF(5, 5), bmp.PhysicalDimension);
        signature.Reason = "I agree with this document";
        signature.Location = new PointF(100, 610);
        signature.Appearence.Normal.Graphics.DrawImage(bmp, 0, 0);
        signature.TimeStampServer = new TimeStampServer(new Uri("http://timestamp.globalsign.com/scripts/timstamp.dll"));
 
        doc.Save("output.pdf"); //<---- here is where exception is thrown
    }
}
[/code]

I'm using the latest version (5.1.40.12221)

Thanks

---------------------------------------------------------------------- Note: This question has been asked on the Q&A forum of Thang Dang's fraudulent ComponentPro brand If you purchased anything from ComponentPro, you have been scammed. Contact the payment processor who sold you the license and ask for your money back. Back to ComponentPro Q&A Forum Index