Improve performance of PDF control ideas

Hi supporter,

In my use case, a pdf viewer can load dynamically a document which is selected in a Treeview (code attached).

The user can user arrow up/down on the Treeview to have a quick look to see what is the document he's looking for.

Therefore, this process must be very fast (<=200ms). Currently, the SfPdfViewerServer works well but not fast enough for fill our requirement. I came up with an idea that I can create multiple hidden SfPdfViewerServer controls for the documents and display the corresponding control for the selected documents. However, in fact the Treeview may contain hundreds of document so we don't have to create hundred of SfPdfViewerServer controls, then maybe we only need to create 5 hidden SfPdfViewerServer controls above and 5 hidden SfPdfViewerServer controls below the current selected documents. When user change the selected documents, we update hidden viewers.

I've attached the code.

Can you please give me opinions about this idea? Potential pros & cons?


Thank you,

Tam



Attachment: PdfViewer_Performance_Idea_a3e5c61.zip


4 Replies

SM Selvakumar Murugan Syncfusion Team July 7, 2021 12:36 PM UTC

Hi Tam, 
 
Thank you for contacting Syncfusion support. 
 
We can load multiple documents using a single SfPdfViewerComponent using Load or DocumentPath API. So we suggest to use single PDF Viewer component instead of creating multiple PDF Viewer instances.. In our architecture, we have perform C# to JS code interaction, so there may be some delay in 1 or 2 sec while loading the PDF document. We will analyse and improve the document loading time and let you know once this is implemented.  
 
Regards,
Selvakumar 



TV Tam Vu Trong July 8, 2021 02:50 AM UTC

Hi  Selvakumar,

Thank you for your reply.

Hope to hearing good news from you soon.





TV Tam Vu Trong July 8, 2021 09:26 AM UTC

Hi  Selvakumar,


One more question: currently the PDFViewer save it's data in SessionStorage in browser and Maximum limit of data saving in SessionStorage is about 5 MB. What happened to the PDFViewer when the limit is reached ? Will an exception be thrown?


Thank you,

Tam



DM Dhivyabharathi Mohan Syncfusion Team July 9, 2021 08:54 AM UTC

Hi Tam Vu, 
  
  
The maximum limit of a session storage depends on a browser. In our PDF Viewer, the exception will not be thrown while the maximum limit of session storage is reached. We will internally be storing in a collection if the maximum limit of session storage is reached. So, the exception will not be thrown in such cases. 
  
  
Regards, 
Dhivya. 


Loader.
Up arrow icon