System.ArgumentException: An item with the same key has already been added [when more than 1 pages (2+ pages)]

Dear SyncFusion team,


We have purchased and configured Xamarin.Android.SfPdfViewer like :


                        Stream objStream = webresponse.GetResponseStream();
                        mPDFView.ZoomPercentage = Constants.PDF_VIEWER_ZOOM_PERCENTAGE;
                        mPDFView.DocumentSaveInitiated += PdfView_DocumentSaveInitiated;
                        mPDFView.PageViewMode = PageViewMode.Continuous;
                        mPDFView.LoadDocument(objStream);

and in XAML:

<Syncfusion.SfPdfViewer.Android.SfPdfViewer
                android:background="@android:color/holo_red_dark"
                android:id="@+id/pdfView"
                android:layout_width="match_parent"
                android:layout_height="match_parent"/>


It works fine when pages length is 1. But when page is more than 2 it is failing and the exception: 

Unhandled Exception:
System.ArgumentException: An item with the same key has already been added. Key: Img0

in the level of SfPdfViewer library.

Can you please clarify the way to fix it ?

Version is latest 18.3.0.35


7 Replies 1 reply marked as answer

AV Ashokkumar Viswanathan Syncfusion Team October 5, 2020 06:11 AM UTC

Hi Sharon, 
 
Greetings from Syncfusion support, 
 
We have tried to replicate the issue, “Application crashes with System.Argument exception while loading PDF document containing more than 2 pages” in our end, its working as expected.  
 
Please find the sample which we have tried in our end, 
 
Kindly share the following details to analyze more on this issue and assist you with the better solution.      
  1. Simple sample/ modify the above sample(if any changes)
  2. PDF document.
  3. Complete Android device specification.
  4. Replication procedure/video illustrating the issue in detail.
 
Note :  Please let us know the value assigned to the zoom percentage. Kindly refer the below screenshot, 
 
 
Regards, 
Ashok Kumar Viswanathan. 



YR Yuri Roy October 5, 2020 07:30 AM UTC

Dear Ashok,

the constant can be removed and still bug will be reproduced. It seems it is specific to the file. Can you please try to reproduce with attached below file ?

Regards,


Attachment: document_f660d7fd.zip


AV Ashokkumar Viswanathan Syncfusion Team October 5, 2020 09:22 AM UTC

Hi Sharon,   
   
Thank you for providing the PDF document, 
   
We were able to reproduce the issue, “Application crashes with System.Argument exception while loading a particular PDF document” in our end.  Currently, we are validating the issue and  we will update further details on October 7th , 2020.  
  
Regards,  
Ashok Kumar Viswanathan. 



NK Navaneetha Kannan Sudalai Muthu Syncfusion Team October 7, 2020 05:29 PM UTC

Hi Sharon,  

We confirm that the issue “Application crashes with System.Argument exception while loading a particular PDF document” is a defect. The patch for the fix will be updated on October 28, 2020.  

Please find the feedback link below.  

Best, 
Navaneetha Kannan 



AV Ashokkumar Viswanathan Syncfusion Team October 28, 2020 05:24 PM UTC

Hi Sharon, 
 
Sorry for the inconvenience caused,  
 
We are still working on the issue, “Application crashes with System.Argument exception while loading a particular PDF document” due to its complexity and we will provide patch on November 4th, 2020 without any further delay. 
 
Regards, 
Ashok Kumar Viswanathan. 



AV Ashokkumar Viswanathan Syncfusion Team November 4, 2020 05:54 PM UTC

Hi Sharon,  
  
Sorry for the inconvenience caused,   
  
We are still working on the issue, “Application crashes with System.Argument exception while loading a particular PDF document” due to its complexity and we will provide patch on November 11th, 2020 without any further delay.  
  
Regards,  
Ashok Kumar Viswanathan.  



AV Ashokkumar Viswanathan Syncfusion Team November 11, 2020 04:16 PM UTC

Hi Sharon,  
   
Thank you for the patience,       
     
The issue with “Application crashes with System.Argument exception while loading a particular PDF document” has been fixed and the custom NuGet for the same can be downloaded from the following link        
     
 
However, the signature field contains more than image in the provided PDF document. Currently, PDfViewer control supports to load only one image in the loaded signature field. 
    
Disclaimer:   
Please note that we have created this NuGet for version 18.3.0.35 specifically to resolve the following issue(s) reported in this/the Forum 158332.    
 
   
Note : Kindly follow the steps to clear the NuGet cache and then install patched NuGet to get the issue resolved.   
    
       
This fix will be included in our 2020 Volume 4 Main Release which will be available in December 2020.    
    
Regards,    
Ashok Kumar Viswanathan. 


Marked as answer
Loader.
Up arrow icon