The signature byte range is invalid

I'm using the evaluation version to test signing a PDF. I've created the PFX from the example below.

http://blogs.msdn.com/maximelamure/archive/2007/01/24/create-your-own-pfx-file-for-clickonce.aspx

I then followed the example code (see below) in the help file to sign the PDF. When I open the PDF the image has a big red "X" and says "Invalid Signature". It I look at the signature details i get this i get this:

Error during signature verification.

Unexpected byte range values defining scope of signed data.
Details: The signature byte range is invalid

Any insights into what I'm doing wrong?

string inFile=TestPath + "example1.pdf";

string outFile=TestPath + "signature.pdf";

//create a new certificate from the certificate file

Certificate cert=new Certificate(TestPath+"allen.pfx","psw");

//pass certificate to the PdfFileSignature object

PdfFileSignature pdfSign=new PdfFileSignature(cert);

pdfSign.BindPdf(inFile);

System.Drawing.Rectangle rect=new System.Drawing.Rectangle(100,100, 200, 100);

//Set signature attributes

pdfSign.SignModel = PdfFileSignature.WINDOWCERTIFICATE;

pdfSign.SignatureAppearance = TestPath + "butterfly.jpg";

pdfSign.CertificationLevel = PdfFileSignature.NOT_CERTIFIED;

//sign and save file

pdfSign.Sign(2,"Allen","success","ChangSha",true,rect);

pdfSign.Save(outFile);

I’ve tried various options for SignModel and CertificateLevel, but still getting the same error. Any help would be appreciated

Hi Larry,

Sorry for the late reply.

We're looking into the matter. Please spare us some time so we could investigate the issue at our end. We'll update you the earliest possible.

We're sorry for the inconvenience.

Regards,

Hi Larry,

I have reproduced and logged this issue as PDFKITNET-9529 in our issue tracking system. Our team will be looking into the matter and you'll be updated accordingly.

We appreciate your patience.

Regards,

The issues you have found earlier (filed as 9529) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.