Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1476817
  • 博文数量: 254
  • 博客积分: 8696
  • 博客等级: 中将
  • 技术积分: 2961
  • 用 户 组: 普通用户
  • 注册时间: 2008-04-03 16:46
文章分类

全部博文(254)

文章存档

2015年(4)

2014年(18)

2013年(16)

2012年(8)

2011年(25)

2010年(2)

2009年(74)

2008年(107)

分类: 系统运维

2009-08-27 20:14:57

How to embed TIFF files in HTML documents

Some possible methods of embedding TIFF files in HTML documents are demonstrated below.

The examples assume you have a TIFF document accessible at the relative URL "tiffdocument.tif". To demonstrate how to pass parameters (when possible), we show how to tell AlternaTIFF to display a photo-negative of the image. The examples with a green background are the ones we consider to be the best choices.

You should also make sure your web server is configured to assign the MIME type "image/tiff" to your TIFF files. Most web servers will do this by default.

This document also includes a section on .

Example 1: only

The simplest and most reliable method is probably just to use the embed tag. However, embed is not a standard HTML element (prior to HTML 5).

Make sure to include width, height, and src attributes. The type attribute is optional but recommended.

HTML code How your browser handles it

Example 2: Patent 5838906 workaround

Refer to Microsoft's documentation.

HTML code How your browser handles it
  

embed.js:
  document.write('')

Example 3: Traditional and combination

This may be the most popular way to embed plug-ins and ActiveX controls in web pages. It's bloated and nonstandard, but it works with almost any browser. Note that this will force Internet Explorer to use AlternaTIFF if it is installed, even if it isn't the default TIFF viewer.

HTML code How your browser handles it

 
 

  


Example 4: : The valid-but-kind-of-a-hack way

You can try to cover all bases by putting the URL in both a "data" attribute and a "" element. The result is syntactically valid, and seems to work well enough in current web browsers. But there may be with it, and it may not work at all in older web browsers.

HTML code How your browser handles it

 
 

Example 5: : The IE-only way

The object element works best in IE when you include a classid attribute, which is the unique identifier of the control you want to use. This method will force your visitors to use AlternaTIFF, even if they have another TIFF viewer installed. It's unlikely to work in browsers other than IE.

HTML code How your browser handles it

 
 

Example 6: : The official standard way

This method is not recommended, because too many browsers fail to follow the standard. As of this writing, it does not work in IE.

HTML code How your browser handles it

 

Example 7: Frames

Using frames is easy, but it prevents you from passing parameters to AlternaTIFF, may make scripting more difficult or impossible, and can lead to .

HTML code How your browser handles it

Example 8:

Few browsers support TIFF images in tags.

HTML code How your browser handles it


To create a page that allows Internet Explorer to auto-download and auto-install AlternaTIFF, get the latest CAB file from our , and put it on your web server. You'll need to use an embedding method that uses an tag with a "classid" attribute. Add a "codebase" attribute similar to the following:
   
   
Replace "alttiff.cab" with whatever you named the CAB file. The "version" tag should reflect the minimum version that is supported by your web site. If the visitor already has AlternaTIFF installed, IE will attempt to upgrade it if it is older than the version you specify. To translate an AlternaTIFF version number into the format used here, replace the periods with commas, and append ",1" to the end.
阅读(2552) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~