Password encrypted PDF throws error: Source Array was not long enough

Posted by: lhampton on 26 March 2019, 1:09 am EST

    • Post Options:
    • Link

    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?


  • Posted 26 March 2019, 9:59 pm EST


    The issue has been addressed on the corresponding SupportOne ticket:

    Please respond to the same for further discussions, to avoid confusion.



  • Posted 30 April 2019, 5:56 am EST

    1. I tried to open the casedetail for # 372592 but I can no longer do so.
    2. Since there was no resolution, I installed the 2018 V3 release but it did not help.
    3. I tried to install the 2019 V1 release, but that fails with an error. I will search for and possibly open a support ticket for that error.
  • Posted 30 April 2019, 10:35 pm EST


    1. Could you please re-try to open the case. If you’re still unable to open it, please share a screen-shot of the error/issue you observe.
    2. Since even with the older version we’re unable to observe the behavior you mention, installing a newer version should not make any change.
    3. Again, please share the error you get while trying to install 2019v1 ComponentOne version.

      We need the above error(s) information to help you resolve them.

    Thank you,

  • Posted 5 July 2022, 3:32 pm EST


    I get the same exception when try to merge the files. This exception occurs for specific files only.

    Have You resolved this issue?

  • Posted 6 July 2022, 5:31 pm EST

    Hi Igor,

    We have responded to your support Query [CAS-32603-P0G7G5] , please continue the thread there.



Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels