Viewing linearized (fast web view) of password protected pdf

Which product are you using?
PDF.js Express Plus

PDF.js Express Version
8.7.0

Detailed description of issue
Is it possible to viewing linearized document using fast web view on password protected pdf?

When I pass linearized password protected pdf to viewer, I can see that is downloading using range bytes and 206 Partial Content but pdf is no showing until not be fully downloaded.

Expected behaviour
Password protected linearized pdf is showing immandiantelly without waiting for whole file.

Hello, I’m Ron, an automated tech support bot :robot:

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:APIs:Forums:

Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Hi there,

Is this happening for a specific file only? If so, can you provide the sample file?

Is the server hosting the file statically? If not, does it support range requests?

Also, if you load the document with the password in the loadDocument programatically, is the linearized PDF loaded immediately?
https://pdfjs.express/api/UI.html#.loadDocumentOptions

Best Regards,

Kevin Kim

Web Development Support Engineer

PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

This happening for all files. Files are hosting as static file on server and supported range requests.

It’s look like this not working for protected and for not protected files too. Even with your demo website.

Is it possible to using fast web view with password protected pdf? Pdf file don’t have to be fully downloaded first?

This is my sample code:
this.pdfViewerInstance.UI.loadDocument('https://mywebsite/files/foo.pdf', { filename: 'myfile.pdf', extension: 'pdf', password: '1234' });

When loading the attached fast-viewing document on the sample site: JavaScript PDF Viewer Demo

I am able to see the network making requests as you scroll down the PDF:

newsletter_opt1.pdf (1.0 MB)

What is the size of the PDF file you are using? Can you provide a sample document for reproducing?

Best Regards,

Kevin Kim

Web Development Support Engineer

PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

These files have around 200MB, but when we using fast web view we don’t should get 206 status?

File is showing only when is fully downloaded but should be showed partially and rest of the file should be downloaded in background, right? I prepare sample document for you.

Hi there,

Here is a relevant forum topic that will answer your questions:

you can see (firefox) that 206 requests are supported:

Best Regards,

Kevin Kim

Web Development Support Engineer

PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here

Thank you, thats look completely like my issue.

It’s true that on Firefox I can see 206, but still I can see the document only when they are fully downloaded.

As I understand the problem is only with Chrome? Do you plan to fix it on chrome?

Moreover, when I investigated webviewer pdfjs express vs pdf tron I noticed that pdftron worked correctly for any browsers - document is showed almost immadiantely and rest of them is downloaded in background. Should pdfjs express and pdftron they not work the same for this case (fast loading)?

Hi there,

As Logan mentioned in the other thread, this is the expected behaviour of PDF.js. It downloads range requests on demand/when needed, and in parallel downloads the entire document. I am not sure why they implemented it this way, but this is intended.

As for the issue with Chrome, I will add the issue to our backlog to be worked on in the future.

Best Regards,
Kevin Kim
Web Development Support Engineer
PDFTron Systems, Inc.


Share how you are using PDF.js Express in your organization you could win a $500 Amazon gift card. All participants will receive 6 months of PDF.js Express+ for free. Learn more here