Exception and App Crash on loading large PDF's

Hello,

I implemented your SfPdfViewer Control into my Xamarin Forms Solution. 
Syncfusion Nuget version: 18.4.0.34
Xamarin Forms version: 4.7.0.1351

Everything is working on all platforms for small Pdf's.
Now our customer has bigger Pdf's and the PdfViewer throws an Exception (+ App Crash) while loading/rendering the Pdf.

I tested it with a PDF with a size of 245 MB, I am able to open it with the UWP Plattform for 64 bit. 
All others (UWP 32 Bit, Android and iOS) throw exceptions.

With a Pdf with a size of 2KB, all plattforms are working!


I hope you can help me.

Best regards.

19 Replies 1 reply marked as answer

SP Satheesh Palanisamy Syncfusion Team January 26, 2021 12:49 PM UTC

Hi ,  
  
We were able to reproduce the issue , “Large documents are not loading in SfPdfviewer” in Xamarin forms iOS and UWP x86 platform. Currently, we are validating the issue and we will update further details on January 28th ,2021.

We have tried to reproduce the issue “Large documents are not loading in SfPdfviewer” in our end in Xamarin forms Android platform but it is working as expected.
 

kindly share the details below to provide the solution at earliest
 
  1. PDF document 


Regards,  
Satheesh P. 



MK Muralitharan Karikalan Syncfusion Team January 28, 2021 04:08 PM UTC

Hi Team, 
 
We have resolved the issue, “Large documents are not loading in SfPdfviewer” in iOS platform in our 2020 volume 4 service pack release.  
 
We are glad to announce that our Essential Studio 2020 Volume 4 service pack release v18.4.0.39  is rolled out and is available for download under the following link. 
  
 
If you are still facing the issue with our latest NuGet, Kindly provide us more details about the issue to help you with better solution. 
 
Note: For UWP, Since x86 architecture is more memory consumable, we will encounter out of memory exception while deserializing the PDF content objects (like images) using PDF library and manipulating large streams (because of large PDF file size) in SfPdfViewer. So, we suggest you to use x64 architecture to avoid this issue.  
 
Kindly share us the Pdf document which we requested to reproduce the issue in Android platform. 
 
Regards, 
Muralitharan K 



GW Gerhild Wachauer replied to Muralitharan Karikalan March 2, 2021 12:56 PM UTC

Hi Team, 
 
We have resolved the issue, “Large documents are not loading in SfPdfviewer” in iOS platform in our 2020 volume 4 service pack release.  
 
We are glad to announce that our Essential Studio 2020 Volume 4 service pack release v18.4.0.39  is rolled out and is available for download under the following link. 
  
 
If you are still facing the issue with our latest NuGet, Kindly provide us more details about the issue to help you with better solution. 
 
Note: For UWP, Since x86 architecture is more memory consumable, we will encounter out of memory exception while deserializing the PDF content objects (like images) using PDF library and manipulating large streams (because of large PDF file size) in SfPdfViewer. So, we suggest you to use x64 architecture to avoid this issue.  
 
Kindly share us the Pdf document which we requested to reproduce the issue in Android platform. 
 
Regards, 
Muralitharan K 


Hi,

sorry for my delay, i finally added your pdf viewer into my project. 
I have the Nuget Version v18.4.0.44. 

UWP 64 bit and iOS is working as intended without any problems.

Android crashes the app if the file is > 60MB. 
I cant upload my file to this forums entry, these are customer files which are not allowed for sharing. 
Checked it with different files, the crashes occurs only for bigger files.
I attached my Stacktrace and the short overview inside my AppCenter logs.




Thanks for your help.


Best Regards,

Michael


Attachment: stackTraceSyncFusionPdfViewer_74835e3f.zip


MK Muralitharan Karikalan Syncfusion Team March 3, 2021 01:53 PM UTC

Hi Team,  
   
We were able to reproduce the issue, Application crashes with null reference exception while disposing a particular PDF document in SfPdfViewer. We will include the fix for the issue in our upcoming Weekly NuGet release which is expected to be available on March 09, 2021. Kindly check with your documents and confirm us whether the issue is resolved or not once our weekly releases.  
  
Regards,  
Muralitharan K  
  



MK Muralitharan Karikalan Syncfusion Team March 9, 2021 09:08 AM UTC

Hi Team,    
    
We have included the fix for the issue, Application crashes with null reference exception while disposing a particular PDF document in SfPdfViewer in our weekly NuGet release v18.4.0.47. Kindly update to the mentioned version to resolve the issue. Kindly check with your documents and confirm us whether the issue is resolved or not.  
    
Please find the packages link below,    
  
Regards,    
Muralitharan K                



GW Gerhild Wachauer March 11, 2021 12:05 PM UTC

Hi, 

thanks I already updated to the newest version  18.4.0.47.
The fix is working for the Android Platform, I was not able to reproduce a app crash yet.

For the UWP (64 bit) platform there are also the "same" problems. I have a list of documents which gets opened in the detail view. 
If im open a file from a size > 16 MB close it (with pdfViewer.Unload) and open another file with size > 16MB, the app crashes. 
Im loading files with the pdfViewer.LoadDocumentsAsync(stream, cancellationToken) and Unload the pdfViewer if im navigate back to the overview list.

I was able to open and close files without app crashes with pdf files with a size less or same than 10 MB. 

Can you please try to reproduce it? 
These are my AppCenter logs, maybe it helps.
There is one Exception with tells "the document is corrupted", Im already checked it, the files gets open if restart my application, so there should be no problem with the pdf. 



And from another AppCenter App (same App but the Test-Stage instead of Dev)


Best Regards,

Michael




MK Muralitharan Karikalan Syncfusion Team March 12, 2021 09:25 AM UTC

Hi  Michael,  
  
Greetings from Syncfusion support,  
  
We were unable to reproduce the issue, “Application crashes with exception while loading large PDF documents” and it is working as expected. Could you please try the below-provided sample and let us know whether we have missed out anything while replicating the issue.  
   
Please find the sample in the below link, which we have used to reproduce the issue 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 to reproduce the issue.   
2.Replication video/procedure to reproduce the issue.  
3.PDF document   
4.Stack trace 
 
Regards,  
Muralitharan K  



GW Gerhild Wachauer March 15, 2021 09:09 AM UTC

Hi Muralitharan K,


I recorded it with the windows10 built in tool (i think its only possible to record one Application).
So I splitted it to different recordings. 
The recordings where the app is shown stops recording because the app crashed. 
You can see the error (same for all tests) at the end of the video where I show the Visual Studio side.

Hope we can find a fast fix for this, this is a show stopper in our application.

Thanks and BR,

Michael




GW Gerhild Wachauer March 15, 2021 09:25 AM UTC

Missed the attachment, sorry, im adding it here. 



Attachment: Captures_b87548dc.rar


MK Muralitharan Karikalan Syncfusion Team March 16, 2021 01:06 PM UTC

Hi Michael, 
 
Thanks for your update, 
 
We were able to reproduce the issue, “Application crashes with exception while Loading and Unloading the large documents” .  While analyzing the issue we found that this issue is different from the issue, “Application crashes with null reference exception while disposing a particular PDF document in SfPdfViewer” which we have provided the fix earlier. Currently, we are validating this issue and we will update the further details on March 18, 2021. 
 
Regards, 
Muralitharan K 



MK Muralitharan Karikalan Syncfusion Team March 18, 2021 12:45 PM UTC

Hi Michael,   
    
We have confirmed that the issue “Application crashes with exception while Loading and Unloading the large documents” is a defect and logged a defect report for this issue. The patch for this issue will be delivered on April 8, 2021.   
   
Please find the feedback link below,   
    
Regards,   
Muralitharan K.   



MK Muralitharan Karikalan Syncfusion Team April 8, 2021 03:07 PM UTC

Hi Michael,    
    
We have resolved the issues “Application crashes with exception while Loading and Unloading the large documents” and the custom NuGet for the same can be downloaded from the following link.    
        
 
However, we have resolved some issues in the sample level and find the modified sample from below link, 
       
Disclaimer: Please note that we have created this NuGet for version v18.4.0.47 specifically to resolve the following issue(s) reported in this/the forum 161853  
      
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 2021 Volume 1 service pack release which is expected to available in the month of May, 2021.        
    
Regards,    
Muralitharan K.    



EH Earl Hayes May 5, 2021 06:47 PM UTC

Any updates on when the 2021 Volume 1 Service pack will be released? My company currently has an application on 19.1.0.55 and we are experiencing crashing with certain larger pdf documents in this same order of processes. Can there be a custom nuget made for more recent builds if this is still going to take awhile? Thank you!


MK Muralitharan Karikalan Syncfusion Team May 6, 2021 10:21 AM UTC

Hi earl,  
   
Greetings from Syncfusion support,  
   
The fix for the issue, “Application crashes with exception while Loading and Unloading the large documents” will be included in our 2021 volume 1 service pack release which is expected to be available on May 12, 2021. We will let you know once our service pack release is rolled out. Kindly confirm whether the issue you are facing is resolved or not once the service pack is released.  
   
Regards,  
Muralitharan K  



MK Muralitharan Karikalan Syncfusion Team May 13, 2021 10:02 AM UTC

Hi earl, 
 
We have included the fix for the issue, “Application crashes with exception while loading and unloading the large documents” in our 2021 Volume 1 service pack Release v19.1.0.63. Kindly confirm us whether the issue is resolved in your side or not. 
 
Please find the feedback link for the issue, 
https://www.syncfusion.com/feedback/23480/uwp-application-crashes-with-exception-while-disposing-a-particular-pdf-document                                                                                                                                         
 
We are glad to announce that our Essential Studio 2021 Volume 1 service pack Release v19.1.0.63 is rolled out and is available for download under the following link. 
 
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 
 
Regards, 
Muralitharan K 


Marked as answer

GW Gerhild Wachauer May 20, 2021 01:44 PM UTC

Hi Muralitharan K,

Thank you for the fix.

I updated my Project to the Syncfusion Nuget v19.1.0.63. 
Its working in Debug Mode for UWP, but in Release Mode (AppCenter Deploy + Microsoft Store Release) the app crashes now on closing the file with a size of 245 MB. Tested it for x64 Builds.

Best Regards,

Michael








MK Muralitharan Karikalan Syncfusion Team May 21, 2021 05:47 PM UTC

Hi  Michael,  
  
We have Unload/ Disposed the 260MB document from PDF Viewer in Release mode. But we were unable to reproduce the issue, “Application crashes while Unload/ Dispose the pdfViewerControl in Release mode”. Could you please try the below-provided sample and let us know whether we have missed out anything while replicating the issue.  
   
Please find the sample in the below link, which we have used to reproduce the issue 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 to reproduce the issue.   
2.Replication video/procedure to reproduce the issue.  
3.PDF document   
4.More details about the crash and stack trace 
  
Regards,  
Muralitharan K  



GW Gerhild Wachauer June 2, 2021 08:53 AM UTC

Hi Muralitharan K, thanks for the quick response. 

I tried your sample and I got some problems.
Im not able to start the App in Release Mode: 



The "SavedDocument.pdf" is in the Project File included, but missing, so you need to remove it first from the project reference before start. 

In the Debug Mode, the Document did not load, so I cant verify if its working: 




In addition, I found also that you dont include the assemblies inside the UWP App Start which is documented here: 
https://help.syncfusion.com/xamarin/pdf-viewer/getting-started#resolving-issue-when-deploying-an-application-in-releasemode-in-the-uwp-platform




So I was not possible to determine the Problem, please provide a working sample.

Thanks and Best Regards, 

Michael




MK Muralitharan Karikalan Syncfusion Team June 3, 2021 08:06 PM UTC

Hi Michael, 
 
Sorry for the inconvenience caused. Please find the sample from below link, 
 
Regards, 
Muralitharan K 


Loader.
Up arrow icon