Easy PDF Sharing

So everyone has been breaking my back over using SlideShare to distribute my presentations – and for a good reason: It’s not open and it uses a proprietary distribution format. Don’t get me wrong, I love SlideShare, but for what I was using it for (a way to embed presentations into a blog post), I think I can do a little bit better.

So, to quiet the complaining I wrote a little shell script this afternoon which converts a PDF into a set of images then builds a little HTML + JavaScript browser that you can copy-and-paste into your blog posts.

The script can be found here (requires that Image Magick be installed):
https://johnresig.com/files/pdfshare.sh.txt

Example:

Probably the best part of this little script is that it gracefully degrades for RSS readers. If you’re reading this in an RSS feed you should see an image above, linking you to the PDF version of the slideshow. Whereas, before, there would’ve been nothing (as Flash and other embeds are stripped from most RSS feed readers). It should be noted that the JavaScript navigation is also stripped, but at least it’s not completely useless.

If you’re viewing the slideshow on the site itself you’ll see little next/previous links for navigating through the slides. Yes, the JavaScript is really bad – I was going for brevity (so you’re not cluttering up your posts with a couple KB of code).

While building this I realized just how easy it would be to build a very-simple SlideShare competitor which only works with images + HTML + JavaScript.

Just to make it clear: I didn’t want to run off in my own direction to build and host these things, I’d rather have just kept using SlideShare. So I sat down with WireShark and figured out where the indvdual slides for my presentations were being stored, on Amazon S3. However, it completely burst my bubble as they’re storing the individual slides as SWFs, rather than as images. Oh well. If anyone knows if they store raw images anywhere, let me know!

Posted: November 11th, 2007


Subscribe for email updates

20 Comments (Show Comments)



Comments are closed.
Comments are automatically turned off two weeks after the original post. If you have a question concerning the content of this post, please feel free to contact me.


Secrets of the JavaScript Ninja

Secrets of the JS Ninja

Secret techniques of top JavaScript programmers. Published by Manning.

John Resig Twitter Updates

@jeresig / Mastodon

Infrequent, short, updates and links.