PDF loads very slow, pages white for seconds before content is rendered

Which product are you using?
PDF.js Express Viewer

PDF.js Express Version
8.7.5

Detailed description of issue
When opening PDF in PDF.js Express Webview it is very sluggish. Pages are first shown just white and only after few seconds the contetnt is loaded. Also when you scroll trough pages they are just white for long time before images in pdf are loaded.

Expected behaviour
Actual PDF content should be displayed or at least some indicator that content it loaded instead of showing just white pages for long time.

Does your issue happen with every document, or just one?
We have alot of larger documents, and they are generally loading slowly. We are currently using PDF.js and are considering to switch to PDF.js Express for better performance but actually performance seems worse.

Link to document
https://cdn.fs.enwoven.com/ARzF2AR5XTmeZ1x8O4CSsz/kBJYSR7iSW2S2kVVffi7

Code snippet

WebViewer({
                path: '/js/pdfjs-express-dist',
                licenseKey: '****',
                initialDoc: 'https://cdn.fs.enwoven.com/ARzF2AR5XTmeZ1x8O4CSsz/kBJYSR7iSW2S2kVVffi7',
            }, viewerElement)
            .then(instance => {
                instance.UI.disableElements(['menuButton']);
            })
            .catch(error => {
                console.error('Error initializing PDFJSExpress:', error);
            });

Hi there,

This looks like the slowness is due to the images within the PDF. If you look at the network tab you can see that on initial load, there is over 100 requests for blob sources;

These images are requested as you scroll down, causing the delay in loading the pages.

If you want to show an indicator while these images load, you could use

instance.UI.openElement('loadingModal')

and close it after the pageComplete event.

Best regards,
Kevin