Embedding DjVu in HTML

Strings separated by ampersands, and appended to a URL after a question mark is a standard way of passing arguments to a CGI script on the server. DjVu uses these arguments in the client (browser) to control the behavior of the plug-in.

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">
<img src="myAlternative.jpg" width="100%" height="100%">

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:
Determines whether the toolbar is displayed in the DjVu document area.
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.
Determines whether the pop-up menu is enabled.
Determines if a gray border is drawn around the window.
Determines whether keyboard input is accepted.
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.
Determines if hyperlinks are enabled.
Determines if the "DjVu" logo displays in the background of the DjVu document area before the document loads.
Determines whether thumbnails are displayed for multiple page DjVu documents.
DjVu supports the following additional attributes and values:
Determines the initial zoom of the DjVu document.
Valid values are:
width of the DjVu document area
zooms to show entire page
stretches the document to fill the area specified by the width and height attributes
5 to 999
percent of zooming based on DPI of display
Determines the initial display mode.
Valid values are:
Full color
Black and white only
Displays the foreground layer/tr>
Displays the background layer/tr>
Displays the specified page, which may be any valid page number in the DjVu document.
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.
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.
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">
<img src="myAlternative.jpg" width="100%" height="100%">

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'">

Hosted by uCoz