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.

Mon Dec 28, 2015 10:47 am

The below is my code where i am applying digital sign to the existing pdf file.But when i am trying document.SaveTofile() it is giving me the error as- Index was outside the bounds of the array.
Please help me.The below is code-
Code: Select all
            Spire.Pdf.PdfDocument spireDoc = new Spire.Pdf.PdfDocument();
            spireDoc.LoadFromFile(pdfFileName);
            Spire.Pdf.PdfPageBase pageBase = spireDoc.Pages[0];
            String pfxPath = "certificate1.cer";
            PdfCertificate digi = new PdfCertificate(pfxPath, "password");
            Spire.Pdf.Security.PdfSignature signature = new Spire.Pdf.Security.PdfSignature(spireDoc, pageBase, digi, "S");
            signature.ContactInfo = "Swapnil";
            signature.Certificated = true;
            signature.DocumentPermissions = PdfCertificationFlags.AllowFormFill;
            try
            {
                spireDoc.SaveToFile(@"C:\development\Booklet.pdf", FileFormat.PDF);
                spireDoc.Close();
            }

[email protected]
 
Posts: 1
Joined: Fri Dec 11, 2015 7:04 am

Tue Dec 29, 2015 2:28 am

Hi,

Thanks for your posting and using our Spire.PDF.
To help us replicate the error on our side and resolve it soon, could you please share your pdf file and certificate file here?
You can also send them to [email protected].
Thank you.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 3011
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDF

cron