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

SfPdfViewer - When is the right moment to go to a page after loading?

Hi,

for my app I need to jump to a specific page of a PDF document after it has been loaded.

SfPdfViewer offers the PageNumber property to set the actual page number. Setting this property right after the document is loaded (DocumentLoaded-Event) sometimes doesn't work. It seems not to be dependent on the document size or the page number.

Something that may be related to this error: Sometimes after loading the document it is not possible to scroll down. After pinching (zoom in and out), scrolling down is possible. Also this error seems not to depend on the document size.

May be there's a way to re-layout after loading? I think, this is what happens when zooming in and out.


Thank you

Arno


21 Replies

GR Gayathri Ramalingam Syncfusion Team July 19, 2019 04:18 PM UTC

Hi Arno,  
  
We have created a simple sample to reproduce the reported issue, “Setting the page number property does not navigate to the appropriate destination” in our side, but the behavior is working as expected. Please find the sample in the below link for your reference.  
 
  
However, placing PDF viewer inside Stack Layout will not allow the user to scroll the PDF document until we zoom the PDF viewer control. We need to set the VerticalOptions and HorizontalOptions for the scrollable children to properly layout inside the StackLayout for Xamarin.Forms . We have ensured the same behaviour with Xamarin.Forms WebView which is a scrollable view. Please use the below code example to get this issue resolved.   
Code Example:  
<StackLayout>  
<syncfusion:SfPdfViewer x:Name="pdfViewerControl" VerticalOptions="FillAndExpand"HorizontalOptions="FillAndExpand" />  
</StackLayout>  

Even After applying above proposed solution ,If you are still facing the same issue kindly share the following details to analyze more on this issue and it will be helpful for us to analyze more on this issue.  
1.       1.Simple sample/ modify the above sample to reproduce the issue.  
2.       2.Replication procedure to reproduce the issue.  
 
With Regards, 
Gayathri R 



DA Dr. Arno Pernozzoli July 25, 2019 09:12 AM UTC

Hi,

the layout is now working correctly after adaptation of my code to your sample.
Still the problem with jumping to a page exists.
I'm assigning the DocumentLoaded event handler right after the InitializeComponent call within the page constructor.
The event handler is just setting the SfPdfViewer PageNumber property to jump to the right page.
The document is loaded by assigning a stream to the InputFileStream property of the pdf viewer.

On iOS it's failing from time to time, on UWP it's failing nearly always.

It seems the document loading takes longer and the DocumentLoader event is fired "long" before the document has finally been layouted.

I've attached one of the pdfs concerned. Here I'm trying to jump to page 59.
Document source is IMSLP.org, a source for public domain music sheets.

Cheers
Arno

Attachment: IMSLP447392PMLP727473Chopin_F__Valzer_per_pianoforte_bd3568dd.zip


GR Gayathri Ramalingam Syncfusion Team July 26, 2019 04:00 PM UTC

Hi Arno,  
 
We were able to reproduce the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.UWP" in our side and we suspect this to be a defect. We have forwarded this issue to our development team for further analysis and we will update further details by 30-July-2019. But we could not reproduce this issue in Xamarin.Forms.iOS. Kindly refer the sample in the below link which we created to reproduce the reported issue.  
 
 
Kindly share the following details to analyze more on this issue and it will be helpful for us to analyze more on this issue.  
1.       Modify / Simple sample with which the issue could be reproduced.  
2.       Replication procedure to reproduce the issue or screen shot illustrating the issue.  
3.       iOS device specification with the OS version. . 
 
With Regards, 
Gayathri R 



GR Gayathri Ramalingam Syncfusion Team July 30, 2019 10:45 AM UTC

Hi Arno, 
We have confirmed that the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.UWP” is defect and logged defect report for this issue. The patch for this issue will be delivered on 13th August ,2019.    
 
With Regards, 
Gayathri R 



DA Dr. Arno Pernozzoli August 7, 2019 09:31 AM UTC

Hi,

I finally found the time to build a sample reproducing the "page jump" error on iOS.
You have to tap on "Open PDF" and navigate back at least 2-3 times to reproduce the error.
Behavior is the same on iOS simulator (iPad 12'9 3rd generation) and device (same as simulator).

Pls. find attached a complete project to reproduce the error. It includes a white paper from your web site as test resource.

Thank you!
Arno

Attachment: PdfSample_577e90eb.zip


GR Gayathri Ramalingam Syncfusion Team August 8, 2019 11:48 AM UTC

Hi Arno, 
 
We were able to reproduce the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.iOS" in our side and we suspect this to be a defect. We have forwarded this issue to our development team for further analysis and we will update further details by 13-August-2019. 
 
With Regards, 
Gayathri R 



GR Gayathri Ramalingam Syncfusion Team August 13, 2019 01:02 PM UTC

Hi Arno,

The issue with "Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.UWP" has been fixed and the patch for this fix can be downloaded from the following location. 

Recommended approach - exe will perform automatic configuration
Please find the patch setup from below location: 

Advanced approach – use only if you have specific needs and can directly replace existing assemblies for your build environment
Please find the patch assemblies alone from below location:
 
 
NuGet: 
 

Assembly Version: 17.2.0.34
Installation Directions : 
This patch should replace the files “Syncfusion.SfPdfViewer.XForms.UWP.dll” under the following folder.
$system drive:\ Files\Syncfusion\Essential Studio\$Version # \precompiledassemblies\$Version#\4.5.1
Eg : $system drive:\Program Files\Syncfusion\Essential Studio\9.3.0.61\precompiledassemblies\9.3.0.61\4.0

To automatically run the Assembly Manager, please check the Run assembly manager checkbox option while installing the patch. If this option is unchecked, the patch will replace the assemblies in precompiled assemblies’ folder only. Then, you will have to manually copy and paste them to the preferred location or you will have to run the Syncfusion Assembly Manager application (available from the Syncfusion Dashboard, installed as a shortcut in the Application menu) to re-install assemblies.

Note : 
You can change how you receive bug fixes by navigating to the following link and updating your preferences.
 
 
Disclaimer: 
Please note that we have created this patch for version 17.2.0.34 specifically to resolve the following issue(s) reported in this/the forum(s). 146060

If you have received other patches for the same version for other products, please apply all patches in the order received.
This fix will be included in our 2019 Vol 2 Service pack release which will be available in August 2019.
 
Meanwhile, we have confirmed that the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.iOS” is defect and logged defect report for this issue. This fix will be included in our 2019 Vol 3 Main release which will be available in the end of September 2019.  
  



 
 
Regards, 
Gayathri R 
 



DA Dr. Arno Pernozzoli September 27, 2019 07:06 AM UTC

Hi,

I noticed that on the beta 17.3.0.9 the issue is still open.
Will this definitely be fixed in the final version, as I'm waiting for it for my first app release?

Thank you!

Arno


GR Gayathri Ramalingam Syncfusion Team September 30, 2019 05:29 AM UTC

Hi Arno, 
 
Thank you for your update.  
 
We did not include fix for the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.UWP” in our Essential Studio 2019 Volume 3 beta release. As we mentioned earlier, this fix will be included in our 2019 Vol 3 Main release which will be expected to rolled out  on 03rd October 2019. We will inform you once the release is rolled out.  
  
 
With Regards, 
Gayathri R 




DA Dr. Arno Pernozzoli October 7, 2019 09:15 AM UTC

Hi,

I just noticed that the issue “Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.iOS” is not fixed in the latest release. This is blocking my app release at the moment. Could you pls. tell me, when it will be fixed?

Thank you!
Arno


PG Pon Geetha A J Syncfusion Team October 9, 2019 10:56 AM UTC

Hi Arno, 
 
Greetings from Syncfusion. 
 
We have fixed the issue of Setting the page number property does not navigate to the appropriate destination in Xamarin.Forms.iOS in our latest release of 17.3.0.14. We have attached the video demonstrating the fix with sample provided by you in your previous update. 
 
Please find the video in the below link 
 
We suspect the latest assembly is not referred properly in your application, so the reported issue is still reproduced at your end. Please remove the assemblies from GAC using Syncfusion Assembly Manager which is available in the Syncfusion Dashboard and also, delete bin and obj folders of the sample. Then install the latest assemblies again using the Syncfusion Assembly Manager and ensure the file version of “Syncfusion.SfPdfViewer.XForms.dll” and “Syncfusion.SfPdfViewer.XForms.iOS.dll” is same as 17.3451.0.14 which is referred in your project. This could resolve the issue. 
  
  
Regards, 
Jhansi Priya Ramesh 



AJ Ariel Jose October 27, 2019 05:09 AM UTC


Hola Dr. Arno Pernozzoli. Mi nombre es Ariel José Peña, estoy escribiendo desde Colombia. se trata de la aplicación LIVO Es urgente hablar contigo. Mi correo electrónico es djarieljpp@outlook.es


VS Vladimir Subrt February 19, 2020 10:46 AM UTC

Hi 
I turn your attention on this ticket. Error describe above is fixed only for PageViewMode="Continuous". 
If is used PageViewMode="PageByPage" jump to requested page is not done.  Page 1 of PDF document is presented on screen. 
I was testing it via  PdfSample_577e90eb.zip attached above. 
I use the newest nuget 17.4.0.5O. 

This error is realy blocker  in applications that need to jump to a specific page after updating the document.


JP Jhansi Priya Ramesh Syncfusion Team February 20, 2020 09:14 AM UTC

Hi Vladimir, 

We were able to reproduce the issue “Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page mode” in Xamarin Forms iOS and suspect this to be a defect. Currently, we are validating the same and will update the further details on 21st February 2020.   

Regards, 
Jhansi Priya Ramesh 



MS Michal Saman February 24, 2020 10:04 AM UTC

Dear Pryia,

Could you give us any update on this topic, please?

Thank you very much!

Michal


GR Gayathri Ramalingam Syncfusion Team February 24, 2020 01:57 PM UTC

Hi Michal, 
 
We have confirmed that the issue “Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page mode” is defect and logged defect report for this issue. The fix for this issue will be included in our upcoming weekly NuGet published under nuget.org and it is expected to be available on 17th March 2020.  
 
With Regards, 
Gayathri R 



JP Jhansi Priya Ramesh Syncfusion Team March 17, 2020 04:19 PM UTC

Hi Michal,  
   
 
Thank you for the patience,       
     
As there is no weekly release today, please find the custom NuGet with the fix for issue “Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page mode” from below,        
     
Custom NuGet :  
 
Disclaimer  
Please note that we have created this NuGet for version 17.4.0.55 specifically to resolve the following issue(s) reported in this/the Forum. 146060. 
 
 
   
   
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 Vol 1 Main Release which is expected to be available in March 2020.    
    
 
Regards,    
Jhansi Priya Ramesh  



DA Dr. Arno Pernozzoli August 4, 2020 07:52 PM UTC

Hi,

since version 18.2.0.47 we have the same problem again.
Page jumped to when set in DocumentLoaded handler. Problem occurs on device only, simulator seems to work. Again a timing or thread issue?

There's a workaround which seems to cover the issue, invoke the page number setting on the main thread asynchronously.

Device.InvokeOnMainThreadAsync(() => pdfViewerControl.PageNumber = (int)viewModel.PageNumber);

Cheers
Arno


AV Ashokkumar Viswanathan Syncfusion Team August 5, 2020 01:01 PM UTC

Hi Arno,  
 
Thank you for contacting Syncfusion support, 
 
We were able to reproduce the issue, “Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page mode” in iOS Platform. Currently, we are validating the issue and we will update further details on August 7th , 2020. 
 
Regards, 
Ashok Kumar Viswanathan. 



NK Navaneetha Kannan Sudalai Muthu Syncfusion Team August 7, 2020 04:01 PM UTC

Hi Arno,  

We confirm that the issue “Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page mode” is a defect. The patch for the fix will be updated on August 28, 2020.  

Please find the feedback link below.  

Best, 
Navaneetha Kannan 



AV Ashokkumar Viswanathan Syncfusion Team August 28, 2020 10:52 AM UTC

Hi Arno,    
    
The issue with Setting the page number property does not navigate to the appropriate destination while loading the document in a single-page modein Xamarin.Forms iOS platform has been fixed and the custom NuGet for the same can be downloaded from the following link        
     
Custom NuGet :  
 
Please find the feedback link below, 
 
Disclaimer:   
Please note that we have created this NuGet for version 18.2.0.47 specifically to resolve the following issue(s) reported in this/the forum . F146060
 
   
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 3 Main Release which will be available in September 2020.    
    
Regards,    
Ashok Kumar Viswanathan. 


Loader.
Live Chat Icon For mobile
Up arrow icon