Cannot digitally sign PDF with ASPOSE.PDF.NET


When the Aspose.Pdf.Facades.PdfFileSignature.Save() function is called to apply a digital certificate to a PDF this error is thrown:

“'Index was out of range. Must be non-negative and less than the size of the collection”

This old article appears to describe the same issue:

This did work two years ago, but now no longer seems to work on certain computers (even on latest version of ASPOSE.PDF).



Thank you for contacting support.

Would you please share SSCCE code along with necessary resources so that we may try to reproduce and investigate it in our environment. Before sharing requested data, please ensure using latest version of the API.


I attached a ZIP with two projects. It appears the issue is only when the API is called from a web app.

  1. AsposeTest: Console app where the API works correctly
  2. AsposeTestWeb: A simple web page where the API fails. We cannot get the API to work in web apps anymore.

For the console app:
Create a cert, place it in the Documents folder and update the code with the cert name (if the use something other than and update the password.
For the web app:
Do the same with the cert as was done for the console app. Also, there is a variable named root that will need to be updated to the fully qualified path to the web app, if they place it somewhere other than the path currently specified in the variable root.
Create a website in IIS and point it to the folder where the web app resides. (845.9 KB)



Thank you for sharing requested data.

We have logged a ticket with ID PDFNET-46766 in our issue management system for further investigation and resolution. The ticket ID has been linked with this thread so that you will receive notification as soon as the ticket is resolved.

We are sorry for the inconvenience.


Is there a status of this ticket? We are stuck right now because we are now no longer able to sign PDFs.




We are afraid it has not been investigated yet. Please note it has been logged under free support model and will be resolved under first come first serve policy which may take some months.

Moreover, we also offer paid support model where issues are resolved on urgent basis and have priority over the issues logged under free support model. You may check our Paid Support options for your reference.


Sorry I am confused. We are active on our subscription, and we found a bug that was introduced (it used to work fine, now it does not). Now I am told “it may take some months” to fix an introduced bug unless we pay additional money on top of the subscription??



We treat all free support tickets with equal precedence by first come first serve model as fair policy. Therefore, your ticket is pending owing to previously logged tickets and may take time before it is scheduled for investigations. In case your ticket is a blocker and you want it to be resolved on priority then Paid Support is helpful in such situations. Kindly feel free to mention if there is any further confusion.