Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better event for the render: download option? #58

Open
adaptifyDesigns opened this issue Feb 25, 2017 · 4 comments
Open

Better event for the render: download option? #58

adaptifyDesigns opened this issue Feb 25, 2017 · 4 comments

Comments

@adaptifyDesigns
Copy link

I'm using the render: download option. Some of the pdf documents I'm rendering are quite large, and can take a while to process. So I'm hoping to show a spinner/loading icon while that is happening, but since the "Finished" state fires right after the html is scraped, the loading icon barely has a chance to display at all, and then there is a long pause waiting for the document to render and download.

Has anyone found a way around this? Unfortunately there is no simple method to detect the browsers download event, so I'm not really sure what to do. But I think it definitely represents a major UX flaw, especially for larger documents. The user is left wondering what is happening, and whether it worked or not...

Any ideas?

@kbrown01
Copy link
Contributor

kbrown01 commented Feb 25, 2017 via email

@adaptifyDesigns
Copy link
Author

Thank you so much for the creative idea. It is a little too complex for me, so I've come up with a different solution. I'm using the click event on the Download button to trigger a loading animation, and a hidden element becomes visible and covers the Download button with a message asking the user to wait for the download to complete. The message also instructs the user to "click the x in the upper right corner" in order to use the download button again (clicking the x removes the loading animation). This way the user knows to wait until the PDF is generated, and then they can also reset the Download button and us it again if they want.

So far this is working for most, although I have received a few reports that the feature is not working. One user said that the PDF generated but did not have a file name, and he could not save the file to his computer. He was using an older version of Chrome (49.x.xxx...) on Windows XP.

Another user said that the loading animation just kept going and going, but no file was ever generated or downloaded. I haven't gotten their system details yet.

I chose not to specify the "render" option for my download button options, hoping that this would be the most compatible, allowing each browser to choose the best render mode, but now I'm wondering if there is another configuration that would be more cross browser compatible.

What is the best way to make this work on as many browsers and operating systems as possible?

Thanks!

@kbrown01
Copy link
Contributor

kbrown01 commented Mar 3, 2017 via email

@adaptifyDesigns
Copy link
Author

Ok, great. Thank you for your response.

The only reason I was confused, is because when I chose not to specify the "render" mode, using chrome on Mac OS the default was an automatic download, without any base64 encoded preview, which is also what happens (for me on Chrome) when I choose the "Open > As PDF" option on your demo pages. So I assumed that the feature was no longer functioning properly.

No matter, I will switch to render: 'download' for best compatibility.

Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants