Performance issues while loading file in web viewer

Product: Web Viewer

Product Version: 11.1.1

We are loading file in the web viewer but getting performance issues with the below code:-

1- Web viewer initializing taking approx 3 sec. Below is the code:

  WebViewer(
          {
             path: “…/…/…/js/lib/PdfTronWebViewer11.1.1/”,
             enableMeasurement: true,
             licenseKey: ‘license key’,
             backendType: ‘ems’,
             fullAPI: true,
             annotationUser: 12345,
             isAdminUser:true
          }, viewer
          ).then(instance => {


            });

2- When we are loading file approx 1MB in the Web-viewer with the help of ‘instance.UI.loadDocument’ function. It is also taking 3-4 seconds. Below is the code:

               const arrayBuffer = xhr.response; // Note: not req.responseText
           
            instance.UI.loadDocument(arrayBuffer);

I tried to load the file with the path but that is also taking same time. like below code:-

  instance.UI.loadDocument("My pdf file path");

Please let me know why these are code taking too much time. Because of this code , My pdf file is loading very slow in the web viewer.

Please let me know What changes should I do to increase the performance of web viewer.

Thanks,
Rahul Y

Hi Rahul,

Is this issue recent?

Have you tried loading your file on the showcase to make sure it’s not the file that is causing the issue?

You can test it here: https://showcase.apryse.com/

I would advise you to make the simplest constructor possible and bring back one feature at a time to see when the issue start to occur.
You should also remove enableFeatures if you are using it.

You could start with this:

WebViewer({
  path: "…/…/…/js/lib/PdfTronWebViewer11.1.1/",
  licenseKey: ‘license key’,
}, viewer).then(instance => {});

Best Regards,
Mickaël.

1 Like

I load file on your showcase and it’s loading fine.

I tried with simple code but It’s still taking 2-3 seconds to initialize web viewer. I did try with below code:-

 WebViewer(
  {
    path: "../../../js/lib/PdfTronWebViewer11.1.1/",            
    licenseKey: 'license key'
              
    }, viewer
   ).then(instance => {

 });

And When we are loading file (1 MB) in the webviewer that function is also taking 3-4 seconds to load the file in webviewer.

        instance.UI.loadDocument("My pdf file path");
1 Like

Hi Rahul,

To investigate the issue, could you please provide the minimal sample project and the sample file for us to reproduce the issue, thank you.

You can find base samples here: Free Trial: JavaScript PDF Viewer | Apryse documentation

Make sure to delete any private information

Best Regards,
Mickaël.

1 Like