views:

1616

answers:

6

Has anyone ever found any lightbox type javascript / css code that can display PDFs? I have tried many libraries and none have worked for me. The environment needs to be IE6/IE7 compatible.

I am looking for something similar to this: Lightbox 2

+1  A: 

Good luck finding anything that will display a PDF in browser without a plugin.

You might consider embedding an IFrame that points to the PDF in a lightbox style. That's about the best you'll be able to do, though.

Randolpho
A: 

If it's not here, it's not anywhere: lightbox clones

ajm
And, I think you're probably going to need to iframe it in, as Randolpho is 100% correct above.
ajm
A: 

You have a couple of solutions here

You could embed the PDF in an iframe (in a lightbox or panel) like http://www.cs.tut.fi/~jkorpela/html/iframe-pdf.html

Otherwise you could upload the PDF to a document sharing site like Issuu and embed their swf in your web page.

David Caunt
A: 

If you can find a PDF library that allows you to convert each page to an image (JPEG, GIF or something), then you could display those in your lightbox.

Obviously you would lose all the zooming and paging functionality of the PDF.

tomlog
+2  A: 

http://stickmanlabs.com/lightwindow/

Specifically, check out the demo "Flash Paper" for embedding PDFs

jvenema
+1 for linking to flash paper. That requires that the PDF be converted to flash, however, which runs against the original request. It's an option to be considered, though.
Randolpho
I know it's not 100% on, but if you want to avoid embedded iframes, relying on Adobe's PDF player, etc, it's a good option. :)
jvenema
A: 

To sum up your options:

If a screen-shot of a portion of the PDF is good enough, then as tomlog answered, you could find a library or existing code to extract said portion as an image, and display that image in the "lightbox".

If, however, you need actual PDF-viewing functionality, it can not be done in IE6/7 without loading into an Adobe Flash/swf object, or contained within the official Adobe Reader browser plug-in somehow.

Going the plug-in route, you will have to use an iFrame.

If the Flash/embedding approach seems better, jvenema suggested http://stickmanlabs.com/lightwindow/ which has a "Flash Paper" demo (Flash Paper is the official way to embed PDF documents) you could check out, or embedding something else, as seen at http://www.scribd.com/ and others.

anonymous coward