Performance PDF Viewer

I have a client-side Blazor app using the PDF Viewer (v18).  When I display a 3 MB 226 page document, it takes 20 seconds before it displays the first page.  What is the best way to code this to get the best performance?

Thanks,
Arthur

7 Replies

JI Jason Irby April 5, 2020 08:42 PM UTC

Hi Arthur,

[Edit]  Hmm just saw this.  Maybe we are both having this problem? 



AB Arthur Butler April 6, 2020 06:39 AM UTC

Hi Jason, This is a different issue than the one you refer to (which I also encounter when the app first starts).


AA Akshaya Arivoli Syncfusion Team April 6, 2020 06:49 AM UTC

Hi Arthur , 

Thank you for contacting Syncfusion support. 


We are unable to reproduce the reported issue with the provided details from our side. However, we suspect this may due to the network issue while using the online demo link or the remote service Url. Poor network will cause delay in returning the document from web service.  So, can you please try with local web service URL in your project. Please refer to the below link to create PDF Viewer Web service project, 



Please try it and if you still have concerns revert us with more details about issue, exception/console error details if any. Also, we suspect that the reported issue may be document specific, so can you please share us the PDF document in which you are facing the issue. These details will be helpful for us to investigate further and assist you better. 


Regards, 
Akshaya 



AB Arthur Butler April 12, 2020 07:30 PM UTC

Thank you.  I have a client side app and load the PDF documents dynamically as a user selects a document from a list.  I am currently using SfPdfViewer.Load() passing the bytes of the PDF document that I download from my web site.  What I am seeing is that this data is then passed up to the PDF Viewer Web service for processing.

Is there a way to dynamically load the PDF document without downloading the data from one web service (my service) and then uploading to the second web service (PDF Viewer Web service)?  The PDF Viewer Web service will have file system access to the PDF documents that I intend to view.  I see that the PdfViewerController does have code to allow for loading the file given a document path.  Can I do something in the client app to have the web service load the file from file system instead of passing the PDF data to the web service?

Regards,
Arthur


AA Akshaya Arivoli Syncfusion Team April 13, 2020 12:22 PM UTC

Hi Arthur , 

Thank you for your update. 

We can load the PDF document during initialization using the documentPath API. We have created the sample for the same and shared in the below link, 



The document name provided in the documentPath API should be available in the location mentioned in the GetDocumentPath()( PdfViewerController.cs) of the web service project. We can also load the base64 string. 

Refer to the below link to create PDF Viewer Web Service project, 


Please try it and revert us with more details if you need further assistance. 


Regards, 
Akshaya 




AB Arthur Butler April 13, 2020 04:15 PM UTC

I mean to load a different document when the user clicks on a button on the screen.  All the examples that I saw open the file in the client app and send the data of the PDF document to the server using Load();

The simple solution to my problem is to just call Load() as follows:

pdfviewer.Load("document2.pdf", "");


AA Akshaya Arivoli Syncfusion Team April 14, 2020 12:05 PM UTC

Hi Arthur, 

Thank you for your update. 

We can load the PDF document on button click in PDF Viewer using the client side Load() API. We have created sample for the same and shared in the below link, 


The document name provided in the Load() API should be available in the location mentioned in the GetDocumentPath()( PdfViewerController.cs) of the web service project. We can also load the base64 string.  

Note: Our PDF Viewer control is both the server and the client-side oriented. PDF viewer control processes the server-side PDF document (developed with the. NET environment) and sends the processed PDF data as JSON data to the client using the web service to render the PDF document and for further PDF viewer operations. We h 

Please try it and if you have any concerns on this, revert us with the modified sample in which the issue could be reproduced. It will be helpful for us to investigate further and assist you better. 

Regards, 
Akshaya 


Loader.
Up arrow icon