WebViewer 4.1 unable to download pdf with more than 1.6 megabytes

300 views
Skip to first unread message

Michael Sommer

unread,
Feb 25, 2019, 12:51:47 PM2/25/19
to PDFTron WebViewer
Hi,

we are currently using WebViewer 4.1 and we get a network error in the downloadbar of the browser as soon as we are attempting to download the displayed pdf.

The pdf file is displayed correctly in the ui and everything is working except downloading the displayed file onto the local file system.

I've done some research and i found out that the download works correctly for smaller files but breaks for larger ones. I created some test pdf files and it seems that the download fails for files with size larger than 1.6 megabytes.

We are displaying files that are much larger and we want to make them downloadable as well. So is there a way to make files larger than 1.6 megabytes downloadable or is this file size the upper limit for providing them as download?

I have tested this with Chrome Version 72.0.3626.109

Kind regards

Michael Sommer

Zhijie Zhang

unread,
Feb 25, 2019, 2:16:51 PM2/25/19
to PDFTron WebViewer
Hi Michael,

A similar sounding issue has been reported recently and we made a fix for that. 
With the latest UI from https://github.com/PDFTron/webviewer-ui, I can download a file that is ~4.5mb.
Can you try using the latest UI and see if this issue is resolved? Attached you can find the bundle file.

Best Regards,
Zhijie Zhang
Software Developer
PDFTron Systems Inc.
 
webviewer-ui.min.js.txt

Thorsten Hersam

unread,
Feb 26, 2019, 1:00:43 PM2/26/19
to PDFTron WebViewer
Hi Zhijie,

Your fix works. However now we have another strange behavior. I have a attached a video that shows how laggy downloading works. Interestingly, the larger document is faster ready for download than the smaller PDF.

Kind regards,
Thorsten
pdftron_laggyDownloads.mp4

Michael Sommer

unread,
Feb 26, 2019, 1:00:43 PM2/26/19
to PDFTron WebViewer
Hi Zhijie,

thanks for your fast reply. I replaced the bundle file you have provided and it works now. I have tested it with file
sizes up to around 8mb. It takes a while with such file sizes but it works.

Best Regards

Michael Sommer

Am Montag, 25. Februar 2019 20:16:51 UTC+1 schrieb Zhijie Zhang:

Thorsten Hersam

unread,
Feb 28, 2019, 8:51:46 AM2/28/19
to PDFTron WebViewer
Hi Zhijie,

Did you see my post? I am asking because my colleague Michael also answered to this thread.
We still have this issue with laggy downloads.

Kind regards,

Thorsten

Zhijie Zhang

unread,
Feb 28, 2019, 4:14:49 PM2/28/19
to PDFTron WebViewer
Hi Thorsten,

Sorry for the delay in our response.
We will investigate into it and give you an update when there's further information.
Thanks for your patience.

Best Regards,
Zhijie Zhang
Software Developers
PDFTron Systems Inc.

Zhijie Zhang

unread,
Mar 5, 2019, 3:31:51 PM3/5/19
to PDFTron WebViewer
Hi Thorsten,

Thanks for sending us the video.

Before we start downloading the document, we wait for all the annotations being loaded so that they won't get lost in the downloaded document.
From the video we can see that although the second document is smaller, it has more pages. And we guess that the second document may contain links or other annotations which will slow down the downloading process.
If you don't care about annotations in the downloaded document, you can modify the downloadDocument function in MenuOverlay.js, here is what you can change:

From:

downloadPdf(dispatch, {
  documentPath,
  filename: documentFilename
});  

To:

downloadPdf(dispatch, {
  documentPath,
  filename: documentFilename,
  includeAnnotations: false
});  

We also see that the click event for the download button can be queued up which results in downloading multiple same documents. This is a bug and we will make a fix for it. 
Reply all
Reply to author
Forward
0 new messages