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);