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

**URL:** <https://pdfjs.community/t/pdf-loads-very-slow-pages-white-for-seconds-before-content-is-rendered/3542>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [December 10, 2024, 6:26am UTC](https://pdfjs.community/t/pdf-loads-very-slow-pages-white-for-seconds-before-content-is-rendered/3542 "2024-12-10T06:26:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![borut](https://avatars.discourse-cdn.com/v4/letter/b/c77e96/32.png) [@borut](https://pdfjs.community/u/borut)\
**Post date:** [December 10, 2024, 6:26am UTC](https://pdfjs.community/t/pdf-loads-very-slow-pages-white-for-seconds-before-content-is-rendered/3542/1 "2024-12-10T06:26:44Z")

</div>

**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](https://cdn.fs.enwoven.com/ARzF2AR5XTmeZ1x8O4CSsz/kBJYSR7iSW2S2kVVffi7)

**Code snippet**

```javascript
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);
            });

```

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [December 10, 2024, 7:10pm UTC](https://pdfjs.community/t/pdf-loads-very-slow-pages-white-for-seconds-before-content-is-rendered/3542/3 "2024-12-10T19:10:06Z")

</div>

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;

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/6/68596331cd9a4e15ae11c9b5bf591d762d992ba6.jpeg)

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

```javascript
instance.UI.openElement('loadingModal')

```

and close it after the pageComplete event.

> **[PDF.js Express Viewer Events | Documentation](https://pdfjs.express/documentation/learn-more/events.8#documentviewer.pagecomplete)**

Best regards,  
Kevin
