PDF file pages loading slowly (.Net Core Project)

Hello,

I have a pdf document of 20mb size. We’ve seen this document slow down in a patterned way when viewing pages.
As I shared in the source code, the viewer is set to load every 3 pages, but I think these times are increasing arithmatically due to a problem.

“loadDocumentDescription” This is my service in the viewer that runs when I first open the document.

“loadDocumentPages” Service called every 3 pages. And a service that may have a problem with time.

We opened a ticket for “loadDocumentDescription” last month and accelerated the opening time. But now our customers want us to reduce the waiting time for viewing documents.

We will be glad if you can help
Have a nice day!

ScreenLoadings.png (60.1 KB)

networkServicesTime.PNG (111.8 KB)

GroupDocsSlowExample.zip (227.4 KB)

PDF File Link: https://drive.google.com/drive/folders/19brqR8A_FTS0XUUEXsxVc0v8AZWz_jES?usp=sharing

@caglaraydogan

Thank you for sharing the file and the details about this issue. We’ll take a look at how we can improve performance and update you.

Hello Vladimir,

I will wait your update. I will glad to hear if there is any changes about this issue.

Thank you

@caglaraydogan

Unfortunately we have not reproduced the same issue, on our side it works much faster. Can you please share what config do you use for Viewer?

This is my Startup file config settings. You can find more code in

“GroupDocsSlowExample.zip” attachment at first ticket post.

StartupFile.PNG (73.8 KB)

@caglaraydogan

Thank you, we have scheduled this issue for the investigation, and as soon as we have any updates we will let you know.

Hello Vladimir,

Is there any update yet? Our customers had slow issues again.

Thank you

@caglaraydogan

Do you experience this issue with the same file or some other file(s)?

Hello,

Yes its depend on pdf files. Some files are taking too much time. Sometimes its about page count sometimes its about when its scanned pdf files.

Thank you

@caglaraydogan

Got it, we’ll let you know in case we have any updates.

Hello Vladimir,

Is there any update yet? Our customers had slow issues again.

Thank you

@caglaraydogan

Unfortunately, there is no progress in the resolution of this issue. This issue was planned for investigation next month. As soon as we have any updates we’ll let you know.

@caglaraydogan

The rendering performance of scanned PDF can be improved by enabling rendering to HTML with external resources.

When rendering to HTML with embedded resources all the resources are serialized to Base64 strings and embedded into HTML document. This approach has two major disadvantages:

  1. Output HTML document with embedded resources is larger in size compared to HTML document with external resources + external resources. Base64 encoded data is approximately larger by 4/3.
  2. JSON serialization of HTML document with embedded resources takes more time due to the larger file size.

Here is comparison of rendering with embedded and external resources:

To enable rendering to HTML you have to update your code as follows:

services
    .AddGroupDocsViewerUI(config =>
    {
        config.SetViewerType(ViewerType.HtmlWithExternalResources); 
//...        
       
services
    .AddControllersWithViews()
    .AddGroupDocsViewerSelfHostApi(config =>
    {
        config.SetViewerType(ViewerType.HtmlWithExternalResources);

Please let us know if this works for you.