March 30th, 2013, 06:18 PM
Force PDFs in Lightbox
Hi, I've been using Bumpbox to display PDF files on my website in a popup lightbox format. I've been using it for over a year and never had any problems, but just recently it stopped working. An empty lightbox would pop up and the PDF would be downloaded straight to my hard drive.
I use Firefox and have it set to automatically download most files, including PDFs. However, I don't believe this was a problem before. Since Bumpbox was being used, it would display PDFs in the popup and only downloaded them from direct links on other sites. I changed my PDF settings to "preview in Firefox" and now it's loading in the lightbox just fine. I don't know if it's a result of having updated to the latest version of FF or what, considering I didn't personally change anything since it was last working.
I recently started redoing the site with Joomla so I don't know if that's causing the problem, although I moved the earlier version (raw CSS/HTML) into a subdirectory, where the overall site functions as it always did, and the same issue is happening there too. So I'm just wondering if it might be an issue with newer browser versions.
The code placed at the bottom of the page is:
And the links themselves are written as:
Any suggestions for forcing the PDF display through Bumpbox instead of potentially being downloaded based on user settings? Thanks!
<a href="filename.pdf" class="bump" rel="850-550">
March 31st, 2013, 11:27 PM
Looking at the Bumpbox demo, it's just putting the PDF file into an iframe. The browser is going to do whatever it is set to do when you visit a PDF file (display it inline, download it automatically, prompt you to download it, etc.). There is no way to override that behavior.
My advice: provide a direct link to the PDF file or don't use PDF.
April 3rd, 2013, 01:48 PM
Thanks, I ended up just using the Bumpbox but including a note that if the lightbox pops up empty, the PDF was likely downloaded per their browser settings. Best compromise for now, I think. Appreciate the help!