The inline object below contains a PDF file with a 3D interactive model. Because 3D only works in Adobe Reader 8.5 or above, the PDF uses two filtering stages to ensure the 3D element is only displayed when the correct plugin is available. If you have Adobe Reader 9 (or Acrobat 9) then you will see the activated 3D model open below, after a second or two delay.
The first thing we do is insert the PDF using the 'Stirfry' method - a standards-compliant bit of HTML code which works in the main browsers, but ensures that if the user has no PDF viewer plugin, something else appears (in this case the 'get Adobe Reader' image and hotlink:
<object type="application/pdf"
data="http://www.uvsar.com/downloads/PDFsniff3D.pdf" width="320"
height="240">
<div>
<a href="http://www.adobe.com/reader" title="Get Adobe Reader">
<img border="0"
src="http://www.adobe.com/images/shared/download_buttons/get_adobe_reader.png"
width="158" height="39" /></a>
</div>
</object>
If the PDF loads, then we use a single line of Javascript inside the PDF itself to handle versioning (we can't access the version number for Adobe Reader directly in a web browser). The PDF has two pages - page 1 is a "you must upgrade" message, and page 2 contains the actual 3D object, so all the Javascript does is move to page 2 if the viewer version is greater than 8. The Document Javascript therefore says:
if (app.viewerVersion >8) this.pageNum++;You can download the above PDF directly from this link (right-click and Save As), if you want to poke about inside it.