We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Issue in Signing PDF with x509certificate2 Stored In USB Token'

Thread ID:

Created:

Platform:

Replies:

140966 Nov 16,2018 06:44 AM UTC WinForms 0
loading
Tags: PDF
Pradeep Yadav
Asked On November 16, 2018 06:44 AM UTC

I am trying to add x509 certificate to a pdf file. but every time i try to save the file(loaded document) i get this error (System.OverflowException: 'Array dimensions exceeded supported range.'), please help

GetX509() ' to obtain Cert as x509 Certificate from store under current User
Dim document As New PdfLoadedDocument("a.pdf")
Dim page As PdfLoadedPage = TryCast(document.Pages(0), PdfLoadedPage)

Dim pdfCert As PdfCertificate = New PdfCertificate(cert)
Dim signature As PdfSignature = New PdfSignature(document, page, pdfCert, "Signature")
signature.Reason = "Support X509certificate2"
Dim stream As MemoryStream = New MemoryStream()
document.Save(stream) ' Error: (System.OverflowException: 'Array dimensions exceeded supported range.')
Dim file As FileStream = New FileStream("X509cert.pdf", FileMode.Create, FileAccess.Write)
stream.WriteTo(file)
file.Close()
document.Close()

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;