nsdejavu

Autres langues

Langue: en

Version: 1/4/2007 (mandriva - 01/05/08)

Section: 1 (Commandes utilisateur)

NAME

nsdejavu - DjVu browser plugin

SYNOPSIS

/usr/lib/netscape/plugins/nsdejavu.so

DESCRIPTION

The shared library nsdejavu.so uses the Netscape browser plugin API to display DjVu images in in a number of popular web browsers. Different web browsers provide various level of support for Netscape plugins. Please check section "Browser Compatibility" for instructions on how to enable the DjVu browser plugin.

The 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 the URL of a recognized DjVu document in your web browser should automatically invoke the DjVu browser plugin. Each browser uses different methods to determine that a particular URL is in fact a DjVu document. Web server normally provide a MIME type to web browsers. The official MIME type for DjVu documents is image/vnd.djvu. For compatibility with ancient versions of the DjVu viewer, it is common to use instead the experimental MIME type image/x-djvu or image/x.djvu. Web servers should be configured to send the proper MIME type for DjVu documents. Most web browsers also recognize files ending with .djvu or .djv as DjVu files.

An easy way to check if an http server is giving an appropriate content-type is to invoke the following command with a URL corresponding to an actual DjVu file on the server.

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 MIME type indicates a server misconfiguration.

CGI-STYLE FLAGS

The behavior of the DjVu browser plugin can be specified by augmenting the URL using a syntax similar to that used by the CGI programs. This syntax is described by the following template:
http://.../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 man pages for djview3(1) and djview4(1) Unrecognized keywords are ignored. The most common keywords are:

page=pagenum_or_pagename
Specify the initial page to be displayed. Page numbers are numbered from 1.
zoom=zoomfactor
Specify the initial zoom factor. Legal values for zoomfactor are shown in the below:
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.

EMBEDDING DJVU IMAGES IN HTML PAGES

You can integrate DjVu content on an HTML web page with the <embed> tag. This method is that it will work even if your web server does not support the DjVu MIME type. The CGI style flags can be directly used as attributes of the embedding tag. The following example shows the W3C standard syntax with the OBJECT tag:
<object data=myfile.djvu type=image/x-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 tag:

<embed src=myfile.djvu type=image/x-djvu
          width=100% height=100%
          page=iii zoom=stretch></embed>

BROWSER COMPATIBILITY

The DjVu browser plugin has been tested with several popular web browsers:

   NETSCAPE 4

The DjVu browser plugin is normally installed in directory /usr/local/lib/netscape/plugins. This is sufficient to enable the DjVu browser plugin because Netscape 4 always searches this directory for plugins. You might have to first remove previous version of the DjVuLibre plugin. Selecting menu Help->About Plugins in netscape displays the current list of plugins. Previous versions of the plugin might be installed in one of the following locations:

$HOME/.netscape/plugins/nsdejavu.so
/usr/lib/netscape/plugins/nsdejavu.so
/opt/netscape/plugins/nsdejavu.so

More complicated cases can be solved by creating a symbolic link into your personal plugin directory:

cd $HOME/.netscape/plugins
ln -s /usr/lib/netscape/plugins/nsdejavu.so .

You must not copy nsdejavu.so but create a symbolic link. This is necessary because nsdejavu.so first locates its normal installation directory by following the symbolic link. The Netscape plugin search rules are explained in the README file that comes with the Netscape distribution. Also check option -fix of program djview3.

   NETSCAPE 6

The DjVuLibre plugin works nicely with Netscape 6.1 or better. It seems that Netscape 6 only recognize plugins installed inside its own plugin directory. This can be done using a symbolic link. Let us assume that Netscape 6 is installed in /usr/local/netscape6. The following commands should do the trick:

cd /usr/local/netscape6/plugins
ln -s /usr/lib/netscape/plugins/nsdejavu.so .

   MOZILLA

The DjVuLibre plugin works nicely with Mozilla 0.9.5 or better. You must establish a link from the Mozilla plugin directory. Assuming that Mozilla is installed under /usr/lib/mozilla-1.1:

cd /usr/lib/mozilla-1.1/plugins
ln -s /usr/lib/netscape/plugins/nsdejavu.so .

You can then restart mozilla and select menu Help->About Plugins to check whether the DjVuLibre plugin is properly recognized.

   GALEON

Galeon internally uses the Mozilla rendering engine. Install the plugin for Mozilla and it should also work for Galeon.

   FIREFOX

The DjVuLibre plugin works nicely with Firefox or better. You must establish a link from the Firefox plugin directory. Assuming that Firefox is installed under /usr/lib/mozilla-firefox:

cd /usr/lib/mozilla-firefox/plugins
ln -s /usr/lib/netscape/plugins/nsdejavu.so .

   KONQUEROR

The DjVuLibre plugin works with KDE-2.2 or better. You must first make sure that konqueror recognizes the DjVU plugin. In Konqueror, select Settings->Configure Konqueror. When the dialog appears, select the icon Netscape Plugins. Make sure that directory /usr/lib/netscape/plugins appears in the list of plugin directories. Then press button Scan for new plugins. Clicking the Plugins tab button should display a list of recognized plugins. Check that nsdejavu.so appears there.

   OPERA

The DjVuLibre plugin works with Opera-6. As explained in the Opera software support pages, you must have the OpenMotif libraries installed.

CREDITS

This program was written by Andrei Erofeev <andrew_erofeev@yahoo.com> and was then improved by Bill Riemers <docbill@sourceforge.net> and Léon Bottou <leonb@users.sourceforge.net>.

SEE ALSO

djvu(1), ddjvu(1), djview4(1) djview3(1)