tags:

views:

84

answers:

1

I have been tasked with recreating the Acrobat Reader with javascript. However, my "reader" will not present PDFs. Instead, my reader will present images that have been rasterized from PDFs. When I say recreate Acrobat, I need something that has these features:

  1. Display a series of images vertically
  2. Zoom and Pan on the images
  3. Paging up and down to navigate images as pages

I have looked everywhere for a JQuery plugin. I was wondering if anybody has any suggestions that might help me. Please let me know.

A: 

This is a much deeper subject than even I realized just a short time ago. I will give you the short version and it meets all of your needs specified as long as your pdf's are publicly accessible via http. This did not meet all of our needs but I hope it helps you.

Partial Solution

Not all browsers support this but some browsers support pdf as the source of embed, object and iframe tags and even allows you to view them without added javascript.

<embed src="file1.pdf" width="500" height="650"></embed>
<object type="application/pdf" data="file1.pdf" width="500" height="650" ></object>
<iframe src="PDFDirectory/Test.pdf"></iframe>

Answer

To get them to work in all browsers, rasterization and either JS or Flash is the answer. Surprisingly even google presents their pdf's in their viewer as a series of rasterized images. The good news is that you don't have to manually convert them and keep up with them if you take advantage of Google's publicly available viewer. Let google do all the hard work for you and save yourself from the frustration of GhostScript and ImageMagick (which is what we ended up having to use)! All you have to do is paste the url to your pdf and get the embed code! Not to mention that it was easy to programmatically generate the respected code.

https://docs.google.com/viewer

klappy
The point of the project is to get away from PDFs. Our PDFs are hundreds of pages long and downloading the entire PDF is very painful. we want the images but we also want the Acrobat functionality.
Dave
I still recommend taking a look at google's PDF viewer even if you don't use it. They have done a good job at only downloading the necessary pages saving bandwidth while having a clean simple interface to zoom, pan, and even browse thumbnails. You can embed the view or as a link. Do you have to use the images for anything else? They somehow even overlay selectable text in a sense. Check it out before you write it off ;)
klappy
The functionality is exactly what I need. thanks for the suggestion.
Dave