views:

264

answers:

2

Currently I'm using an embed tag with the src directed to the location of the .pdf however the embed tag does not allow for z-index manipulation or other div tags to be placed over it. After extensive searching for a fix to allow for embed tag z-index manipulation I have found that it is adobe that will not allow this to happen with their pdf files.

I need a way to insert (without using embed or iframe tags) a pdf document into an html page and allow other divs to overlap it.

Please Help!

+2  A: 

The <object> tag, maybe? If that won't do it, Adobe's probably going to win this one.

Dean J
What is the syntax to properly implement an object tag? I've used:<object data="/docs/file.pdf" type="application/pdf"></object>doing this won't even display my pdf file on the page...i get a blank white box...
sadmicrowave
That looks correct. Sorry to say, you might be out of luck?
Dean J
A: 

You could drop the Acrobat plugin and use a server side tool to render the PDF to an image. Display that image on your page and overlay it with whatever divs you like.

There are many tools available (free and commercial) that can render PDF to an image. I've used PDFRasterizer.NET for this on a couple of ASP.NET projects.

A component like PDFRasterizer.NET will let you render PDF into images on the fly, streaming it back to the browser directly. On a typical page with text and some images or vector graphics rendering typically takes (much) less than a second. You can save the generated images to disk and use that as a cache to optimize performance. Unless you expect massive traffic there's no real need to process all documents offline.

Marnix van Valen
First, how long does the trial last on that program? Because buying it is out of the question considering it costs thousands of dollars. Second, if there is one, there must be more, do you know of any other programs like PDFRasterizer that are either cheaper or free?... And third, do you know of a way to make PDFRasterizer run everytime the webpage loads to convert the PDFs to images in the background...I have thousands of PDFs in different directories and my website will need to convert all the PDFs in a single directory to images...
sadmicrowave
I've extended my answer to include the general way I use PDFRasterizer. Hope that clarifies it a bit. As for licensing; you can download a free unlimited trial and use that for testing and and development. The only limitation is a banner that's overlayed on each rendered page. The banner is removed when you configure a valid license key for the component. In the end, you only pay for deployment of your application.There are other vendors but I haven't worked with them. Try google for 'pdf to image' or something similar. I'm sure there are free alternatives available as well.
Marnix van Valen