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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error loading a 2nd pdf

Thread ID:

Created:

Updated:

Platform:

Replies:

130463 May 14,2017 11:44 PM UTC May 18,2017 12:14 PM UTC Xamarin.Forms 4
loading
Tags: PdfViewer
elbrinner
Asked On May 14, 2017 11:44 PM UTC

Hello,

I have a pdf listing, when accessing an item, I click on the back button and then access another item I get an error.

Is it possible that you have to free memory in the OnDisappearing () event?

Thank you



05-15 01:12:50.595 D/Mono    ( 7233): Assembly Ref addref Syncfusion.SfPdfViewer.XForms[0xab20d508] -> System.Collections[0xab2fe920]: 7
05-15 01:12:50.605 D/Mono    ( 7233): Unloading image System.IO.dll [0xacc3e520].
05-15 01:12:50.615 D/Mono    ( 7233): Image addref System.IO[0xacbc44c8] -> System.IO.dll[0xab826078]: 7
05-15 01:12:50.615 D/Mono    ( 7233): Config attempting to parse: 'System.IO.dll.config'.
05-15 01:12:50.615 D/Mono    ( 7233): Config attempting to parse: '/Users/builder/data/lanes/4468/f913a78a/source/monodroid/builds/install/mono-armv7/etc/mono/assemblies/System.IO/System.IO.config'.
05-15 01:12:50.615 D/Mono    ( 7233): Assembly Ref addref Syncfusion.SfPdfViewer.XForms[0xab20d508] -> System.IO[0xab824ec8]: 5
05-15 01:12:50.695 W/art     ( 7233): JNI RegisterNativeMethods: attempt to register 0 native methods for md54100a7aa05517a6fb8d42415dec0bb59.SfPdfDocumentViewRenderer
05-15 01:12:50.815 D/Mono    ( 7233): DllImport searching in: '__Internal' ('(null)').
05-15 01:12:50.815 D/Mono    ( 7233): Searching for 'java_interop_jnienv_new_byte_array'.
05-15 01:12:50.815 D/Mono    ( 7233): Probing 'java_interop_jnienv_new_byte_array'.
05-15 01:12:50.815 D/Mono    ( 7233): Found as 'java_interop_jnienv_new_byte_array'.
05-15 01:12:50.815 D/Mono    ( 7233): DllImport searching in: '__Internal' ('(null)').
05-15 01:12:50.815 D/Mono    ( 7233): Searching for 'java_interop_jnienv_set_byte_array_region'.
05-15 01:12:50.815 D/Mono    ( 7233): Probing 'java_interop_jnienv_set_byte_array_region'.
05-15 01:12:50.815 D/Mono    ( 7233): Found as 'java_interop_jnienv_set_byte_array_region'.
05-15 01:12:50.825 D/Mono    ( 7233): DllImport searching in: '__Internal' ('(null)').
05-15 01:12:50.825 D/Mono    ( 7233): Searching for 'java_interop_jnienv_get_byte_array_region'.
05-15 01:12:50.825 D/Mono    ( 7233): Probing 'java_interop_jnienv_get_byte_array_region'.
05-15 01:12:50.825 D/Mono    ( 7233): Found as 'java_interop_jnienv_get_byte_array_region'.
05-15 01:12:50.875 W/art     ( 7233): JNI RegisterNativeMethods: attempt to register 0 native methods for md54100a7aa05517a6fb8d42415dec0bb59.HorizontalScrollViewEx
05-15 01:12:50.925 W/art     ( 7233): JNI RegisterNativeMethods: attempt to register 0 native methods for md54100a7aa05517a6fb8d42415dec0bb59.ImageViewEx
05-15 01:12:52.545 D/ViewRootImpl( 7233): ViewPostImeInputStage ACTION_DOWN
05-15 01:12:53.635 D/ViewRootImpl( 7233): ViewPostImeInputStage ACTION_DOWN
Thread finished: <Thread Pool> #5
05-15 01:13:09.385 D/Mono    ( 7233): [0xac8293b0] worker finishing
El subproceso 'Unknown' (0x5) terminó con código 0 (0x0).

elbrinner
Replied On May 15, 2017 09:38 AM UTC

Problem solved, when returning the element is eliminated and must be re-created.

if(pdfViewerControl.PageCount !=0)
                            {
                                 pdfViewerControl = new SfPdfViewer();
                            }
                            pdfViewerControl.LoadDocument(vm.FileStream);

Balasubramanian Sundararajan [Syncfusion]
Replied On May 15, 2017 11:38 AM UTC

Hi Elbrinner, 
 
As per your latest update, we could see that you are using an workaround of creating a new instance of SfPdfViewer()  to resolve the issue. It is not necessary to create a new instance of PDF viewer every time loading a new PDF document as we will unload the previous document contents internally before loading a new document. So we suspect that this may be an issue with SfPdfViewer(). 
  
After analyzing your stack trace details, we found that we have resolved a similar kind of issue in our latest version of PDF viewer (15.2.0.40) and it is available for download in the below location. 
  
  
Can you please try and let us know whether the issue is resolved in your side? If you are already using the latest version and you could reproduce the issue, kindly modify the below sample or provide a simple sample to reproduce the issue. So that we could analyze more and provide you better solution. 
 
 
Please let me know if you have any queries. 
 
Thanks, 
Balasubramanian S 


elbrinner
Replied On May 16, 2017 06:13 PM UTC

Hi Elbrinner, 
 
As per your latest update, we could see that you are using an workaround of creating a new instance of SfPdfViewer()  to resolve the issue. It is not necessary to create a new instance of PDF viewer every time loading a new PDF document as we will unload the previous document contents internally before loading a new document. So we suspect that this may be an issue with SfPdfViewer(). 
  
After analyzing your stack trace details, we found that we have resolved a similar kind of issue in our latest version of PDF viewer (15.2.0.40) and it is available for download in the below location. 
  
  
Can you please try and let us know whether the issue is resolved in your side? If you are already using the latest version and you could reproduce the issue, kindly modify the below sample or provide a simple sample to reproduce the issue. So that we could analyze more and provide you better solution. 
 
 
Please let me know if you have any queries. 
 
Thanks, 
Balasubramanian S 


I'm using the latest version.

The error in my case happened on a page that is a list of documents that navigates to another page that opens the pdf. When you click back and then enter another item, it failed.


I can not run the example, clicking on restore package does not.

When finished, upload the application to github.

Sathish Sivakumar [Syncfusion]
Replied On May 18, 2017 12:14 PM UTC

Hi Elbrinner, 
 
Thank you for your update. 
 
We are unable to reproduce the issue “Exception thrown when we navigate back to the page contains list of PDF document and selecting the new PDF document from the collection to display in SfPdfViewer in Xamarin.Forms with Essential Studio 2017 volume 2 version 15.2.0.40” in our end. We have created a simple sample with which tried to reproduce the issue in our side and it will be available in the below: 
 
 
We request you to kindly provide us the following details to analyze more about your issue. 
 
  1. Simple sample or modify the above sample to reproduce the issue
  2. Android API version and its details
  3. Essential Studio version
  4. Visual Studio version
  5. Culture settings of your machine
 
The above details will be more helpful for us to analyze more about your issue and provide the better solution. 
 
Regards, 
Sathish 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;