The index cannot be less than zero or greater then Count.

After updating to 2018 release volume 1 release PDF viewer no working,
  new SfPdfViewer(){
                        InputFileStream=new MemoryStream(content)}
as content is array of bytes
i receive the following exception 
The index cannot be less than zero or greater then Count.

5 Replies

GR Gayathri Ramalingam Syncfusion Team February 26, 2018 11:29 AM UTC

Hi Mahmoud, 
 
We are unable to reproduce the reported issue that “Setting the InputFileStream property of SfPdfViewer using bytes throwing exception using the latest build”. We have created a simple sample in our latest version 16.1.0.24 using the details you provided and the issue could not be reproduced. The sample can be downloaded from the below link. 
 
Can you please try using the above sample by attaching your document or modify the sample with your code and let us know if you could reproduce the issue?  So that it will be easy for us to investigate further on this and provide you better solution. 
 
Please let us know if you need further assistance on this. 
 
With Regards, 
Gayathri R 



MH Marco Hurtado March 14, 2018 05:08 AM UTC

I have the same error:

Unhandled Exception:

System.ArgumentOutOfRangeException: The index can't be less then zero or greater then Count.
Parameter name: index

03-14 00:04:06.465 I/MonoDroid(24817): UNHANDLED EXCEPTION:
03-14 00:04:06.525 I/MonoDroid(24817): System.ArgumentOutOfRangeException: The index can't be less then zero or greater then Count.
03-14 00:04:06.525 I/MonoDroid(24817): Parameter name: index
03-14 00:04:06.525 I/MonoDroid(24817):   at Syncfusion.Pdf.Primitives.PdfArray.get_Item (System.Int32 index) [0x0000d] in <f9db0672dae345eba4f5477760011311>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Syncfusion.Pdf.Parsing.PdfLoadedPageCollection.GetPage (System.Int32 index) [0x00019] in <f9db0672dae345eba4f5477760011311>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Syncfusion.Pdf.Parsing.PdfLoadedPageCollection.get_Item (System.Int32 index) [0x00000] in <f9db0672dae345eba4f5477760011311>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Syncfusion.SfPdfViewer.XForms.Droid.LinearLayoutEx.RenderHyperlink (System.Int32 pageIndex) [0x00046] in <63ec8e07584e402e9799a80b9e57b5e5>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Syncfusion.SfPdfViewer.XForms.Droid.ScrollViewEx.loadDocumentWorker_RunWorkerCompleted (System.Object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) [0x00147] in <63ec8e07584e402e9799a80b9e57b5e5>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at System.ComponentModel.BackgroundWorker.OnRunWorkerCompleted (System.ComponentModel.RunWorkerCompletedEventArgs e) [0x00019] in <9624f2cab6ac4ffc9c31e9469d40591a>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at System.ComponentModel.BackgroundWorker.AsyncOperationCompleted (System.Object arg) [0x0000e] in <9624f2cab6ac4ffc9c31e9469d40591a>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Android.App.SyncContext+<>c__DisplayClass2_0.<Post>b__0 () [0x00000] in <e79c73bcbbb547688bef6c7e9665c95e>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Java.Lang.Thread+RunnableImplementor.Run () [0x00008] in <e79c73bcbbb547688bef6c7e9665c95e>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at Java.Lang.IRunnableInvoker.n_Run (System.IntPtr jnienv, System.IntPtr native__this) [0x00008] in <e79c73bcbbb547688bef6c7e9665c95e>:0 
03-14 00:04:06.525 I/MonoDroid(24817):   at (wrapper dynamic-method) System.Object:25728b62-bff9-4c3d-973b-f96e19562fc8 (intptr,intptr)


NK Navaneetha Kannan Sudalai Muthu Syncfusion Team March 15, 2018 07:09 AM UTC

Hi Mahmoud,  

We are able to reproduce the issue “ArgumentOutOfRangeException occurs when loading PDF in Xamarin Forms Android” in single page PDF documents. The issue does not occur in PDF documents with more than one page.  Kindly confirm whether you are facing this issue in single page PDFs.  

We have logged a defect report for the issue. The fix will be included in our Essential Studio 2018 Volume 1 – SP 1 which is expected to be available by the end of March 2018.  

If you need immediate solution please create a support incident from your Direct-Trac account and we will provide the fix.  


  
Best, 
Navaneetha Kannan  



MW Mahmoud Wagdy March 19, 2018 06:34 PM UTC

yes i need the fix for this urgently 


NK Navaneetha Kannan Sudalai Muthu Syncfusion Team March 21, 2018 09:23 AM UTC

Hi Mahmoud,  

We have resolved the issue “ArgumentOutOfRangeException occurs when loading PDF in Xamarin Forms Android” and updated the fix on the support incident created by you. Kindly follow the incident from your Direct-Trac account to track the status of the issue.  



Best, 
Navaneetha Kannan  


Loader.
Up arrow icon