PDF file failed to load from AWS S3 in Chrome

3,430 views
Skip to first unread message

hammer ren

unread,
Aug 14, 2017, 1:07:39 AM8/14/17
to PDFTron WebViewer
We're trialling webviewer to view pdf stored in AWS S3. The url which has been passed into webviewer is our server api to return a direct download link to the AWS S3 stored file. The viewer is working fine in Safari and Firefox but not in Chrome. I'm testing on the latest Macbook pro with all up to date browsers.

The javascript console output "Download failed Expected Size=524288 Received Size=0" from "CoreControls.js:1396". Has anyone had similar experience or situation?

Justin Jung

unread,
Aug 15, 2017, 5:55:36 PM8/15/17
to PDFTron WebViewer
Hello,

It seems like it might be the same problem.

Justin Jung
Software Developer
PDFTron Systems Inc.

hammer ren

unread,
Aug 17, 2017, 1:42:30 AM8/17/17
to PDFTron WebViewer
Thanks Justin. But that build did not solve our issue. 

What we noticed is all the linearized pdf failed to load in Chrome60. So it must be the part of code in pdftron handling how to download the file from S3, which has issue to deal with linearized pdf in Chrome but not in other browsers. Please see the attached linearized pdf. 


chrome-WFM009 Capability Statement Brochure FA WEB.pdf

Matt Parizeau

unread,
Aug 18, 2017, 5:03:45 PM8/18/17
to PDFTron WebViewer
Thanks for sending the document. It seems to work fine on our end when loading the document from WebViewer when the document is on S3. Here is a link to your document on S3 http://pdftron.s3.amazonaws.com/custom/ID-zJWLuhTffd3c/wvtest/test.pdf.

This URL loads successfully for us on Chrome 60 on a Macbook. Can you try setting initialDoc to this URL and see if it works for you. Maybe there is a difference in the S3 configuration.

Matt Parizeau
Software Developer
PDFTron Systems Inc.

hammer ren

unread,
Aug 23, 2017, 11:51:37 AM8/23/17
to PDFTron WebViewer
Hi Matt,

Thanks for your response. I tried the link in your reply and it works fine. But our setup maybe slightly different. Let me explain more details of our setup:
  • webviewer request file from our application server, eg. ourdomain/download/doc/id
  • our application server return the url configured in amazon cloudfront with the secure session string based on the logged in user, eg. download.ourdomain/{hash string required by S3}
  • webviewer use the url return above to download file from S3
Currently, I bypassed the issue by applied {useDownloader: false}. But I guess we lost the benefit of linearised pdf in all the browsers and we do not want getting into the path detecting browsers.

Please help.

Justin Jung

unread,
Aug 23, 2017, 2:24:03 PM8/23/17
to PDFTron WebViewer
Hello,

There could be issues with the cloudfront and the urls that WebViewer uses by default. See this post which talks about changing cache hinting to work with cloudfront.

Justin Jung

hammer ren

unread,
Aug 25, 2017, 12:51:19 PM8/25/17
to PDFTron WebViewer
Hi Justin,

That did not work for us.

hammer ren

unread,
Aug 25, 2017, 12:51:19 PM8/25/17
to PDFTron WebViewer
Can any one point out how webviewer download document via different browser?


On Thursday, August 24, 2017 at 4:24:03 AM UTC+10, Justin Jung wrote:

Justin Jung

unread,
Aug 25, 2017, 6:15:00 PM8/25/17
to PDFTron WebViewer
Hello,

Can you send us a link to your project so we can take a closer look at the errors? If it is private, you can email the link to sup...@pdftron.com.

hammer ren

unread,
Aug 28, 2017, 7:46:37 PM8/28/17
to PDFTron WebViewer
Hi,

I've sent an email to support email yesterday.

hammer ren

unread,
Aug 30, 2017, 11:42:43 AM8/30/17
to PDFTron WebViewer
It's solved by changing our process loading document. Thanks anyway.
Reply all
Reply to author
Forward
0 new messages