[DjVu Zone]
  DjVu Zone
  What's New
  What is DjVu
  Tutorial
  Documentation
  Digital Libraries
  DjVu on the Web
  DjVu Companies
  Applications
  Downloads
  Benchmarks
  Technical Papers
  Feedback
  www.djvu.com
  Search DjVu Zone
[Get the Plug-in]
[get the plug-in]
Introduction
-About this Tutorial
-What is DjVu
-The Many Faces of DjVu
-When to use DjVu, and what performance to expect?
-The Main Features of DjVu
Creating DjVu Documents: a Quick Introduction
-Working with DjVu Files
-Images, Resolution, and Scanning
-Overview of the DjVu Compression Software
-Compressing Individual Images
-Creating Multipage DjVu Documents
-Compressing Multiple Images into a Multipage DjVu Document
-Hyperlinks and Annotations
Publishing DjVu Documents on the Web
-Introduction: Getting Started
-Simple CGI-style arguments
-Displaying a DjVu Documents in a Frame
-Embeding DjVu Documents into HTML Pages
-Elements of Style
-Linking to the DjVu Web Site
-A complete Example using Frames
-A complete Example using Embedded Objects
Hosting DjVu Documents: Avanced Topics
-Triggering the Automatic Plug-in Download
-Automatic Installation of the Plug-in: how does it work?
-DjVu Display Attributes
-Attributes in the URL
-Scripting
-How Caching Works
Configuring your Web Server for DjVu
-Multipurpose Internet Mail Extensions (MIME)
-Configuring Your Web Server to Support DjVu
The DjVu File Structure
DjVu: A Tutorial

Hosting DjVu Documents: Avanced Topics

Triggering the Automatic Plug-in Download

We offer a piece of JavaScript code to detect automatically the browser type and correctly execute the download and installation. Include the script in the <head> of your web page or before the first appearance of a DjVu document as follows:

<script language="JavaScript" src="http://www.djvu.com/plugins/TriggerUpdate.js">
</script>

This script also includes a function to embed automatically a DjVu document using JavaScript. Add the following code to your page where you want your DjVu document to appear:

<script language="JavaScript">
<!--
EmbededDjVu("my_DjVu_file.djvu","height","width","attributes");
// -->
</script>

To avoid overwhelming our servers, only include the script in the first page where DjVu documents appear. If you would like to include the EmbededDjVu function throughout your site, you can download the script and host it on your server by right clicking here and choosing Save As.

The previous procedure requires that your users have JavaScript enabled. Therefore you should state this to warn your users that they must have JavaScript enabled somewhere before your DjVu page.

Automatic Installation of the Plug-in: how does it work?

Different browsers require different file formats to perform an automatic download and installation of the plug-in. Internet Explorer requires a .cab file and Navigator requires a .jar file. The easiest way to accomplish this is to use the built-in features of both the <object> tag and the <embed> tag that allow you to automatically download the plug-in from our web site.

<object classid="clsid:0e8d0700-75df-11d3-8b4a-0008c7450c4a" width=100% height=100% codebase= "http://www.djvu.com/plugins/DjVuControl.cab#version=3,0,0,0"> <param name="imageURL" value="my_DjVu_file.djvu" > <param name="flags" value="attribute=value attribute=value">
<embed type="image/x.djvu" src="/plugins/welcome.djvu" height="100%" width="100%" pluginspage="http://www.djvu.com/plugins/SmartUpdate.html?
http://www.yourdomain.com/my_DjVu_file.djvu" flags="attribute=value attribute=value"
</embed>
</object>
Note: The values for codebase and pluginspage are broken over two lines in the previous example for display only. Your code should not contain spaces or returns or your results could be inconsistent.

If your navigation is such that your visitors enter via a single page, include the automatic download method solely on that page, thereafter you can use simpler linking and embedding methods throughout your site.

If you would like to host the automated installation files on your own site, you can download the files by right clicking on the following and choosing the Save As option from the pop-up menu:

DjVu Display Attributes

The DjVu plug-in supports a number of attributes that affect how the DjVu document is displayed within the HTML document. While attributes can be specified separately, AT&T recommends using the flags attribute and group the attributes:

<object classid="clsid:0e8d0700-75df-11d3-8b4a-0008c7450c4a" width=100% height=100%>
<param name="imageURL" value="my_DjVu_file.djvu" >
<param name="flags" value="attribute=value attribute=value">
<embed src="my_DjVu_file.djvu" type="image/x.djvu" width="100%" height="100%" flags="attribute=value attribute=value">
</embed>
<noembed>
<img src="myAlternative.jpg" width="100%" height="100%">
</noembed>
</object>
Note that you have to specify the attributes for both sets of tags.

The following attributes accept true, yes, false, or no as values. The default is true/yes unless otherwise specified:

toolbar
Determines whether the toolbar is displayed in the DjVu document area.
scrollbars
Determines whether scrollbars are used when the document exceeds the size of the DjVu document area. If disabled, the user scrolls the document using the mouse and the hand cursor.
menu
Determines whether the pop-up menu is enabled.
frame
Determines if a gray border is drawn around the window.
keyboard
Determines whether keyboard input is accepted.
passive
Sets the zoom factor to "Fit Page" and disables toolbar, popup menu, scrollbars and keyboard input. You can enable any of the previous options, append the specific setting such as menu=true. Regardless of whether you set this value to true or false the effect is the same. By default this is not in effect.
links
Determines if hyperlinks are enabled.
logo
Determines if the "DjVu" logo displays in the background of the DjVu document area before the document loads.
thumbnails
Determines whether thumbnails are displayed for multiple page DjVu documents.

The following example has toolbar, menu, and scrollbars turned off and zooms to fit the page:
<h5>Please <a href="/download">download the plug-in</a>to see the examples.</h5>

DjVu supports the following additional attributes and values:

zoom
Determines the initial zoom of the DjVu document.
Valid values are:
one2onefullsize
widthwidth of the DjVu document area
pagezooms to show entire page
stretchstretches the document to fill the area specified by the width and height attributes
5 to 999percent of zooming based on DPI of display

The following is the previous example zoomed to 50:

<h5>Please <a href="/download">download the plug-in</a>to see the examples.</h5>

mode
Determines the initial display mode.
Valid values are: /tr> /tr>
colorFull color
bwBlack and white only
foreDisplays the foreground layer
backDisplays the background layer

The following uses all default values, but sets the initial view to black and white. Use the Display command from the pop up menu to see the different mode effects.
<h5>Please <a href="/download">download the plug-in</a>to see the examples.</h5>

page
Displays the specified page, which may be any valid page number in the DjVu document.
highlight
Creates rectangular highlighted area with given coordinates and specified color. Five arguments separated by commas make up the correct value, as follows:
  • 1st is the X coordinate of the lower-left corner of the highlighted rectangle in document's coordinate system.
  • 2nd is the Y coordinate of the lower-left corner of the highlighted rectangle in document's coordinate system.
  • 3rd is the width of the highlighted rectangle.
  • 4th is the height of the highlighted rectangle.
  • 5th is the highlighting color in RRGGBB format. A special value of FF000000 means to use XOR highlighting. The color may be omitted, in which case XOR highlighting will be assumed.
The following example shows a highlight setting of "1000,300,1000,400,0000FF" with the passive attribute set to true:
<h5>Please <a href="/download">download the plug-in</a>to see the examples.</h5>
You can specify more than one highlight attribute. In a multiple page documents, all highlights are applied to the first page or the page specified with the page attribute.

Note, that all the coordinates are internal document coordinates, not screen coordinates.

flags
You can specify any of the attributes in matched pairs, separated by spaces with the whole enclosed in double quotes("). To hide the toolbar and stretch the document to fit, use:

<embed src="my_DjVu_file.djvu" type="image/x.djvu" width="100%" height="100%" flags="toolbar=false zoom=stretch">
</embed>
<noembed>
<img src="myAlternative.jpg" width="100%" height="100%">
</noembed>

Attributes in the URL

You don't have to use the <embed> or <object> tags to use the display attributes. The DjVu plug-in supports passing display parameters like CGI arguments using the standard anchor (a) tag. After specifying the DjVu document, follow it with a question mark (?) and the tags you want separated by ampersands (&). This is an excellent opportunity to use the flags attribute as follows:

<a href="my_DjVu_file.djvu?flags='passive=true page=5'">

Scripting

(under construction)

How Caching Works

(under construction)




DjVu Zone Search DjVu Zone Feedback
What's New What is DjVu Tutorial Documentation Digital Libraries DjVu on the Web
DjVu Companies Applications Downloads Benchmarks Technical Papers www.djvu.com

Copyright 1998-2000 AT&T All rights reserved.
DjVu and the LizardTech logo are trademarks of LizardTech Inc.
DjVu, document imaging, image compression, scan, image, document, web,image processing, digital library, electronic commerce, legacy document, plug-in, JPEG, TIFF, PDF
DjVu: The Technology for Scanned Documents on the Web
technology document image compression innovation,
scan high-resolution page color 300 dpi,
fast download of scanned documents, as fast as html,
zcoder, z-coder, binary adaptive arithmetic coding, wavelet, pattern matching.
download, free, non-commercial, plug-in, plugin, compressor, wavelets