nsdejavu (1)
Leading comments
t Copyright (c) 2001 Leon Bottou, Yann Le Cun, Patrick Haffner, AT&T Corp., and Lizardtech, Inc. This is free documentation; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GNU General Public License's references to "object code" and "executables" are to be interpreted as the output of any document formattin...
NAME
nsdejavu - DjVu browser pluginSYNOPSIS
/usr/lib/x86_64-linux-gnu/mozilla/plugins/nsdejavu.soDESCRIPTION
The shared library nsdejavu.so uses the Netscape browser pluginThe DjVuLibre browser plugin works by invoking a standalone viewer with the special command line option -netscape. The plugin first searches a program named djview. If this program cannot be found, it searches for djview4 and finally djview3. It is always possible to override this search strategy by setting the environment variable NPX_DJVIEW to the full path of the desired executable.
MIME TYPES AND EXTENSIONS
Typing theAn easy way to check if an http server is giving an appropriate content-type is to invoke the following command with a
- curl -u URL | grep Content-Type
The result should be one of the following, preferably the first.
-
Content-Type: image/vnd.djvu
Content-Type: image/x.djvu
Content-Type: image/x-djvu
Any other
CGI-STYLE FLAGS
The behavior of the DjVu browser plugin can be specified by augmenting the- .../file.djvu?djvuopts&keyword=value&keyword=value&...
The DjVu browser plugin only recognizes keywords that appear after the word djvuopts. The keywords recognized by each viewer are listed in the corresponding man page. Unrecognized keywords are ignored. The most common keywords are:
- page=pagename
- Specify which page is displayed by name or by ordinal number.
- zoom=zoomfactor
-
Set the zoom factor.
Legal values for
zoomfactor
are:
number Magnification factor in range 10% to 999%. one2one Select the "one-to-one" mode. width Select the "fit width" mode. page Select the "fit page" mode. stretch Stretch the image to the plugin window size.
BROWSER COMPATIBILITY
The DjVu browser plugin has been tested with several popular web browsers: Netscape 4 and 6; Gecko based browsers such as Mozilla, Galeon and Firefox; KHTML based browsers such as Konqueror; and Opera. Please read the browser documentation to find out where the plugin library should be installed.EMBEDDING DJVU IMAGES IN HTML PAGES
You can integrate DjVu content on an-
<object data=myfile.djvu type=image/vnd.djvu
width=100% height=100% >
<param name=page value=iii>
<param name=zoom value=stretch>
This browser cannot render djvu data.
</object>
And this is the customary syntax with the
-
<embed src=myfile.djvu type=image/vnd.djvu
width=100% height=100%
page=iii zoom=stretch></embed>
INTERFACING THE DJVIEW PLUGIN WITH JAVASCRIPT
Recent versions of the djview4 plugin can be controlled from the JavaScript interpreter of browsers implementing the Mozilla NPRuntime API. To access the plugin object, include the attribute id=pluginname into the <object> or <embed> tag and use the JavaScript function getElementById(pluginname).The plugin object implements two methods to retrieve and set the value of the options usually recognized as CGI-style flags. It also can evaluate a specified JavaScript expression whenever something changes in the status of the djview interface.
- pluginobject.setdjvuopt(key,value)
- Set the value of the djvu option key to the character string value. This achieves the same effect as specifying option key=value among the CGI-style flags. For instance, values of the key page can be page IDs, page titles, page numbers, or page names.
- pluginobject.getdjvuopt(key)
- Return the value of the djvu option key as a string. The returned value is always a character string, even when the return is logically a number. Boolean values are returned as strings yes or no. Besides the usual CGI-style flags, this function recognizes the additional key pages and returns the total number of pages in the DjVu document. An empty string is returned when the key is not recognized.
- pluginobject.onchange=code;
- Ensure that string code is evaluated in the context of the plugin object whenever something changes in the djview graphical user interface. For instance, this evaluation happens when progressive refinements are painted, and when the user manipulates the image interactively.
- pluginobject.version
- Return a string describing the plugin version. This property can be used to test whether the djview plugin is scriptable in this browser.
Note that the scriptability feature may not
be accessible until the djview plugin is fully loaded.
Therefore it is advisable to check
pluginobject.version
from the JavaScript
onload
before calling any other method.