Blog
Welcome to the Trioro Tech Blog.
On this blog we post some of the technical challenges and solutions that we've come across. From time to time we also post comments on new technology that we've come across.

Thursday, September 13, 2007

Safari inline PDF files


With IE and FireFox, the best chunck of code to use to display an inline pdf is:

<object height="1200" width="780" classid="clsid:CA8A9780-280D-11CF-A24D-444553540000">
<param name="src" value="Filename.pdf"/>
<embed src="Filename.pdf" width="780" height="1200">
<noembed>Your browser does not support embedded PDF files.</noembed>
</embed>
</object>

However, Safari doesn't deal with this very well. :(

Safari will display a PDF file if you use an image tag instead!

<img src="http://www.blogger.com/Filename.pdf" />

Yes, use the PDF file extension. Since the Mac OS has native support for PDFs, this trick will work.

You're still stuck with the problem that you need to different tags depending on your browser. If IE or FireFox stumble across the image tag, they'll display a blank image area.
You can use some code to do a browser check and display the appropriate tag.

Having said ALL that......if you go to Adobe's site, download and install the lastest Acrobat Reader, Safari gets an udpate that allows it to work with the Object tag. Problem Solved. Make sure you stick the "Get Adobe Reader" icon on your page.

Labels:

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home