SfPdfViewer crash: Cannot access a disposed object. Object name: 'Stream has been closed'.

Hi,

We are using SfPdfViewer (version 19.3.0.55) in our Xamarin.Forms (version 5) application in order to convert the selected PDF file to image, the operation was working fine but recently we had a crash after selecting the PDF file.


The exception says:

Cannot access a disposed object.
Object name: 'Stream has been closed'.

Here is the StackTrace:

  at System.IO.FileStream.Seek (System.Int64 offset, System.IO.SeekOrigin origin) [0x0000d] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.IO/FileStream.cs:734
at System.IO.FileStream.set_Position (System.Int64 value) [0x0001a] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/corlib/System.IO/FileStream.cs:402
at Syncfusion.SfPdfViewer.XForms.iOS.ScrollViewEx.LoadDocument (System.IO.Stream inputStream) [0x00103] in <540aa434a4d8484faecc6bc5697630be>:0
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) [0x00000] in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/src/Xamarin.iOS/mcs/class/referencesource/mscorlib/system/runtime/compilerservices/AsyncMethodBuilder.cs:1021
at Foundation.NSAsyncSynchronizationContextDispatcher.Apply () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/Foundation/NSAction.cs:178
--- End of stack trace from previous location where exception was thrown ---


at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00013] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIApplication.cs:73
at MyApp.iOS.Application.Main (System.String[] args) [0x00001] in /Users/khalidessaadani/MyApp/MyApp/MyApp/MyApp.iOS/Main.cs:12


I would appreciate if you could help me solve this problem.


Best regards.


3 Replies

SP SarathKumar Prakash Syncfusion Team December 27, 2021 09:42 AM UTC

Hi Khalid Essaadani, 
 
We were unable to reproduce the issue. 
Kindly share the following details to analyze more on this issue and assist you with the better solution     
1.Simple sample to reproduce the issue.    
2.Replication video/procedure to reproduce the issue.  
3.PDF Document   
 
Regards, 
Sarath Kumar. 



KE Khalid Essaadani December 28, 2021 08:28 AM UTC

Hi Sarath Kumar,


Thanks for your reply, I will try to create a small sample to reproduce the issue and keep you posted.


Best regards,


Khalid.



SP SarathKumar Prakash Syncfusion Team December 28, 2021 10:24 AM UTC

Hi Khalid Essaadani,  
  
We will wait to hear from you. 
  
Regards,  
Sarath Kumar.  


Loader.
Up arrow icon