Force Download PDF

Here’s a nifty little PHP script that fixes a small issue (that I find personally annoying, frankly) when having PDF files available for download through links on our sites. The issue? It usually just loads and displays the PDF for reading in the browser, instead of downloading it to the user’s computer.

Let’s say you’re giving away a PDF ebook, and you want users to really have it in their possession, instead of them simply reading it in their browser, then leaving and forgetting about it forever and ever. Minor, yeah, since the user can usually download the PDF from its browser display. But that’s an undesirable extra step, and any marketer worth their chops knows you have to get rid of any and all unnecessary steps between users and what you really want them to do. Besides, not all those users will know how to download a PDF from one showing in their browser. I guarantee it, and there’s likely way more of them than you think.

The solution is to force a download. This PHP script by Will Bontrager does the trick. You may recognize that he’s the programmer behind the previously mentioned Numerology Colors Generator. You may also recognize that yes, “PHP script” means programming source code you’ll need to upload as a computer program file to your server, which you’ll then need to call and access from within your site whenever you want to force a PDF download.

If getting your hands dirty with this level of tech is something you’ve never done before, sure, it can be intimidating. But frankly, you’ll probably discover it’s not really that tough. Will is very thorough and clear with his instructions, and he’s unusually helpful too. Getting this little script, with its simple scope, working on your site is actually a very ideal way for you to learn how to install and use PHP scripts on your Web server. It’ll open up a whole new world of website and wordpreneur software possibilities for you to tap and put to work.

Worth a try, I’d say. Have fun!

Share the love