jQuery Document Viewer


Document Viewer is a jQuery plugin that allows you to view several file formats directly in a web page. The file formats that Document Viewer supports are:

  1. PDF Files
  2. Images – png, jpg, jpeg, gif
  3. Audio – mp3, m4a, oga, webma, fla
  4. Video – m4v, ogv, ogg, webmv, flv


Initialize the plugin

var documentViewer = $('#document-preview').documentViewer();

Load A document


Load a document without an extension

documentViewer.load('http://absolute/url/to/1', {extension:'pdf'});

Load a document passing all options

documentViewer.load('http://absolute/url/to/file.pdf', {
        alert('document loaded');
        //you can play any jPlayer options here

Document Viewer uses the following 3rd party utilities:

  • pdf.js
  • jPlayer
  • Flowplayer
  • Google Code Prettify

Important Notes & Quirks

  • This is a jQuery plugin with an optional PHP dependency if you want to use text & code documents.
  • This plugin uses pdf.js to render pdfs. Pdf.js is being developed by a very solid team, but it is still in beta, which means that it may not render all PDFs 100% correctly.
  • The plugin works in IE7 & 8 for all types except pdfs.

Need a project management system? Try my new app

Duet Project Management

MediaBox – Audio & Video


Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

You May Also Like
Read More

Tiva Timetable

Tiva Timetable is a responsive schedule javascript library with clean and modern flat interface. It is very easy…
Read More

LePopup WordPress

Successful LePopup script of LeSeries collection is now available also in WordPress version! Clear and simple management, easy…
Read More

Accordion FAQ WordPress Plugin

FEATURES Drag & Drop FAQ Post and Categories Reorder Create Multiple FAQ Pages Accordion Style FAQ List Style…