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. Image for the cookie policy date
close icon

Application crashes when looking at PDF file - System.Collections.Generic.KeyNotFoundException

Captured following error condition in production.
Don't have exact PDF file that caused a problem, but stack-trace seems specific enough to address the problem.

Syncfusion library version used: 16.4.0.54
Device: Pixel 2
OS Version: 9

PdfMainObjectCollection.GetObject (Syncfusion.Pdf.Primitives.PdfReference reference)

System.Collections.Generic.KeyNotFoundException: The given key '88' was not present in the dictionary.

  • Dictionary`2[TKey,TValue].get_Item (TKey key)
  • PdfMainObjectCollection.GetObject (Syncfusion.Pdf.Primitives.PdfReference reference)
  • PdfReferenceHolder.ObtainObject ()
  • PdfReferenceHolder.get_Object ()
  • PdfCrossTable.GetObject (Syncfusion.Pdf.Primitives.IPdfPrimitive pointer)
  • PdfLoadedPageCollection.get_Count ()
  • PdfLoadedPageCollection.GetParent (System.Int32 index, System.Int32& localIndex, System.Boolean zeroValid, System.Boolean enableFastFetching)
  • PdfLoadedPageCollection.GetPage (System.Int32 index)
  • PdfLoadedPageCollection.get_Item (System.Int32 index)
  • LinearLayoutEx.InitializeLayout ()
  • HorizontalScrollViewEx.Initializelayout ()
  • ScrollViewEx.InitializeLayout ()
  • ScrollViewEx.LoadDocument (System.IO.Stream inputStream)
  • SfPdfDocumentViewRenderer.OnElementPropertyChanged (System.Object sender, System.ComponentModel.PropertyChangedEventArgs e)
  • (wrapper delegate-invoke) <Module>.invoke_void_object_PropertyChangedEventArgs(object,System.ComponentModel.PropertyChangedEventArgs)
  • BindableObject.OnPropertyChanged (System.String propertyName)
  • Element.OnPropertyChanged (System.String propertyName)
  • BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent)
  • BindableObject.SetValueCore (Xamarin.Forms.BindableProperty property, System.Object value, Xamarin.Forms.Internals.SetValueFlags attributes, Xamarin.Forms.BindableObject+SetValuePrivateFlags privateAttributes)
  • BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value, System.Boolean fromStyle, System.Boolean checkAccess)
  • BindableObject.SetValue (Xamarin.Forms.BindableProperty property, System.Object value)
  • DocumentViewHelper.set_InputFileStream (System.IO.Stream value)
  • SfPdfViewer.OnPdfViewerPropertyChanged (System.String propertyName)
  • SfPdfViewer.OnInputFileStreamChanged (Xamarin.Forms.BindableObject bindable, System.Object oldValue, System.Object newValue)
  • BindableObject.SetValueActual (Xamarin.Forms.BindableProperty property, Xamarin.Forms.BindableObject+BindablePropertyContext context, System.Object value, System.Boolean currentlyApplying, Xamarin.Forms.Internals.SetValueFlags attributes, System.Boolean silent)
  • BindableObject.


  • 1 Reply

    SS Sathish Sivakumar Syncfusion Team May 3, 2019 08:41 AM UTC

    Hi Vadim, 
     
    Greetings from Syncfusion. 
     
    We tried to reproduce the issue “Application crashes with System.Collections.Generic.KeyNotFoundException” in our side, but the PDF document is displayed properly in SfPdfViewer with v16.4.0.54. We suspect that the issue is specific to the PDF document loaded into SfPdfViewer. We recommend you to update the SfPdfViewer to the latest stable version and share the following details if you still face the same issue. 
     
    1. PDF document with which the issue could be reproduced.
    2. Modify/Simple sample to reproduce the issue.
    3. Replication procedure to reproduce the issue.
    4. Xamarin.Forms version
    5. Android support library version details
     
    Please find the sample with which we tried to reproduce the reported issue in our side. 


    Regards, 
    Sathish 


    Loader.
    Live Chat Icon For mobile
    Up arrow icon