|
NAMEnsdejavu - DjVu browser pluginSYNOPSIS/usr/local/lib/djview4/plugins/nsdejavu.soWARNINGUsing nsdejavu as a plugin in 2020 is very difficult because popular browsers either do not support netscape plugins (chrome), or removed support for netscape plugins other than flash (firefox). We regret this decision because djview/nsdejavu is a perfect example of very well behaved plugin that would have been easy to support.DESCRIPTIONThe shared library nsdejavu.so uses the Netscape browser plugin API to display DjVu images in in a number of popular web browsers. It works by invoking a standalone viewer out-of-process 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 EXTENSIONSTyping 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.
The result should be one of the following, preferably the first.
Any other MIME type indicates a server misconfiguration. CGI-STYLE FLAGSThe 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:
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:
BROWSER COMPATIBILITYThe 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 PAGESYou can integrate DjVu content on an HTML web page with either the <embed> or the <object> tag. This method 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:
And this is the customary syntax with the EMBED tag:
INTERFACING THE DJVIEW PLUGIN WITH JAVASCRIPTRecent 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.
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. CREDITSThis 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 ALSOdjvu(1), ddjvu(1), djview4(1)
Visit the GSP FreeBSD Man Page Interface. |