Posted 26 March 2019, 1:09 am EST
One of our customers just tried to import a password protected pdf and received the following exception:
System.ArgumentException: Source array was not long enough. Check srcIndex and length, and the array’s lower bounds." & vbCrLf & " at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)" & vbCrLf & " at C1.C1Pdf.Reader.StandardEncryption.a(Byte[] A_0, Byte[] A_1, Int32 A_2, Int32 A_3, Byte[] A_4, Int32 A_5, Boolean A_6)" & vbCrLf & " at C1.C1Pdf.Reader.StandardEncryption.CheckUserPassword(Byte[] userPassword, Byte[] firstDocIdValue, Int32 keyBitLength, Int32 revision, Byte[] oValue, Byte[] uValue, Int32 pValue, Boolean encryptMetadata)" & vbCrLf & " at C1.C1Pdf.Reader.PdfParser.IsPassword(String password)" & vbCrLf & " at C1.C1Pdf.Reader.PdfParser.a(PdfObject A_0)" & vbCrLf & " at C1.C1Pdf.Reader.PdfParser.a(Int32 A_0, Int32 A_1, Boolean A_2)" & vbCrLf & " at C1.C1Pdf.Reader.PdfParser.c(BinaryReader A_0)" & vbCrLf & " at C1.C1Pdf.Reader.PdfParser.Parse(MemoryStream stream)" & vbCrLf & " at C1.Win.C1Document.C 1PdfDocumentSource.InternalGenerateDefault(IExecutionContext context)" & vbCrLf & " at C1.Win.C1Document.C1PdfDocumentSource.InternalGenerate(IExecutionContext context)" & vbCrLf & " at C1.Win.C1Document.C1DocumentSource.Generate()" & vbCrLf & " at C1.Win.C1Document.C1PdfDocumentSource.LoadFromFile(String fileName)" & vbCrLf & " at MssImages.ctlViewImage.ViewPDF() in C:\vbSource\DotNet4\Imaging\MssImages\ctlViewImage.vb:line 354
It displays correctly in Adobe PDF Viewer so I suspect it is a problem with the C1 component. The file is huge, > 38mb, so I can’t attach it (not to mention that sending it out would be a HIPPA violation).
We are using version 4.0.20181.296 for DotNet 4.
Any ideas?
Thanks