ClassCreator.com | Blockbuster sites, amazing reunions

Share Tips

New Topic Reply Subscription Options  

How to show a PDF file without User downloading

Forums: General Discussion
Created on: 02/14/18 03:38 PM Views: 1113 Replies: 4
Wednesday, February 14, 2018 at 3:38 PM

This is a method to show a PDF file on you page without the user have to click a link to download. Works on current browsers and Android and iPad. Should work on iPhone.

Mobile devices bring up a "download" request. Probably to let you control you data use.

This link is a sample page showing how it works.\

This is the code. Has multiple sections to support the broadest range of devices. Object works with most, but not mobile devices. Hence the other stuff there.

Replace the PDF with YOUR PDF file in the file vault. Change the "height" to your desired value. Depends on the PDF here. Not critical. You just scroll inside the PDF vs scrolling the windows.

Reply
Saturday, April 27, 2019 at 4:27 PM - Response #1

Jack, I tried the link you provided above and it wanted me to save the pdf. The page opened with nothing on it. You may wish to update your post.


Reply
Saturday, April 27, 2019 at 4:45 PM - Response #2

Works for me on current versions of Chrome, Edge and Firefox. Probably Opera too (verified that also works).

Can no longer test IE since it stopped working for me on two Win10 machines. However, IE is awful and does not support the latest HTML5 well. Tell users to use alternate browsers that are both faster and support more sites.

You might have some settings in browser preventing it from working. Try another browser that you have NOT modified in any way.

Reply
Edited 04/27/19 8:09 PM
Saturday, April 27, 2019 at 4:48 PM - Response #3

Oh and that's for a PC not a mobile device. Mobile devices ask for a download as I noted above.

Reply
Saturday, April 27, 2019 at 8:03 PM - Response #4

I figured out what you did - the default option for PDF file handling was changed.

You set the Option for PDF files to Save. Change it back to "Preview in Firefox".

Most users will not mess with these defaults in the browsers.

Reply
Edited 04/27/19 8:04 PM
New Topic Reply  
Subscription Options: Have all new forum posts sent directly to your email.
Subscription options are available after you log in.