Give your readers an easy way to view your documents with Viewer.js

Sometimes we want to distribute our content as a PDF or some other document format which isn't directly viewable in a web browser. While this can be very useful, the typical result is that we have to download files to our computer then view them outside the browser.

Another option is a "document viewer". For example, the (docs.google.com) Google Docs Viewer is free for anyone to use, and is a document viewer built on the back of the Google Docs system. That means it can handle any document that Google Docs can import. But it has a couple limitations - for example your visitor needs to be logged into their Google account - for example there's some kind of bandwidth cap.

Recently a document viewer was built into Mozilla based on PDF.js, and it works pretty well. Turns out that it can be used by anybody, not just the Mozilla browser, but it's pretty complex to use PDF.js directly.

With that in mind consider (viewerjs.org) Viewer.js. It's a JavaScript library that wraps around PDF.js, making it trivially easy to use, while adding support for a few other document formats thanks to another library.

One mode of using it is: Click Here as a link to a document viewer page. Or you can embed the document viewing experience on the page.