1NSDEJAVU(1) DjView-4 NSDEJAVU(1)
2
3
4
6 nsdejavu - DjVu browser plugin
7
8
10 /usr/lib64/netscape/plugins/nsdejavu.so
11
12
14 The shared library nsdejavu.so uses the Netscape browser plugin API to
15 display DjVu images in in a number of popular web browsers. Different
16 web browsers provide various level of support for Netscape plugins.
17 Please check section "Browser Compatibility" for instructions on how to
18 enable the DjVu browser plugin.
19
20 The DjVuLibre browser plugin works by invoking a standalone viewer with
21 the special command line option -netscape. The plugin first searches a
22 program named djview. If this program cannot be found, it searches for
23 djview4 and finally djview3. It is always possible to override this
24 search strategy by setting the environment variable NPX_DJVIEW to the
25 full path of the desired executable.
26
27
28
30 Typing the URL of a recognized DjVu document in your web browser should
31 automatically invoke the DjVu browser plugin. Each browser uses dif‐
32 ferent methods to determine that a particular URL is in fact a DjVu
33 document. Web server normally provide a MIME type to web browsers.
34 The official MIME type for DjVu documents is image/vnd.djvu. For com‐
35 patibility with ancient versions of the DjVu viewer, it is common to
36 use instead the experimental MIME type image/x-djvu or image/x.djvu.
37 Web servers should be configured to send the proper MIME type for DjVu
38 documents. Most web browsers also recognize files ending with .djvu or
39 .djv as DjVu files.
40
41 An easy way to check if an http server is giving an appropriate con‐
42 tent-type is to invoke the following command with a URL corresponding
43 to an actual DjVu file on the server.
44
45 curl -u URL | grep Content-Type
46
47 The result should be one of the following, preferably the first.
48
49 Content-Type: image/vnd.djvu
50 Content-Type: image/x.djvu
51 Content-Type: image/x-djvu
52
53 Any other MIME type indicates a server misconfiguration.
54
55
56
58 The behavior of the DjVu browser plugin can be specified by augmenting
59 the URL using a syntax similar to that used by the CGI programs. This
60 syntax is described by the following template:
61
62 http://.../file.djvu?djvuopts&keyword=value&keyword=value&...
63
64 The DjVu browser plugin only recognizes keywords that appear after the
65 word djvuopts. The keywords recognized by each viewer are listed in
66 the man pages for djview3(1) and djview4(1). Unrecognized keywords are
67 ignored. The most common keywords are:
68
69 page=pagename
70 Specify which page is displayed by name or by ordinal number.
71
72 zoom=zoomfactor
73 Set the zoom factor. Legal values for zoomfactor are:
74
75 ┌───────────────────────────────────────────────────────┐
76 │number Magnification factor in range 10% to 999%. │
77 │one2one Select the "one-to-one" mode. │
78 │width Select the "fit width" mode. │
79 │page Select the "fit page" mode. │
80 │stretch Stretch the image to the plugin window size. │
81 └───────────────────────────────────────────────────────┘
82
83
85 The DjVu browser plugin has been tested with several popular web
86 browsers: Netscape 4 and 6; Gecko based browsers such as Mozilla,
87 Galeon and Firefox; KHTML based browsers such as Konqueror; and Opera.
88 Please read the browser documentation to find out where the plugin
89 library should be installed.
90
91
92
94 You can integrate DjVu content on an HTML web page with either the
95 <embed> or the <object> tag. This method will work even if your web
96 server does not support the DjVu MIME type. The CGI style flags can be
97 directly used as attributes of the embedding tag. The following exam‐
98 ple shows the W3C standard syntax with the OBJECT tag:
99
100 <object data="myfile.djvu" type="image/vnd.djvu"
101 width="100%" height="100%" >
102 <param name="page" value="iii">
103 <param name="zoom" value="stretch">
104 This browser cannot render djvu data.
105 </object>
106
107 And this is the customary syntax with the EMBED tag:
108
109 <embed src="myfile.djvu" type="image/vnd.djvu"
110 width="100%" height="100%"
111 page="iii" zoom="stretch"></embed>
112
114 Recent versions of the djview4 plugin can be controlled from the
115 JavaScript intepreter of browsers implementing the Mozilla NPRuntime
116 API. To access the plugin object, include the attribute id="plugin‐
117 name" into the <object> or <embed> tag and use the JavaScript function
118 getElementById("pluginname").
119
120 The plugin object implements two methods to retrieve and set the value
121 of the options usually recognized as CGI-style flags. It also can
122 evaluate a specified JavaScript expression whenever something changes
123 in the status of the djview interface.
124
125 pluginobject.setdjvuopt("key",value)
126 Set the value of the djvu option key to the character string
127 value. This achieves the same effect as specifying option
128 key=value among the CGI-style flags. For instance, values of
129 the key page can be page IDs, page titles, page numbers, or page
130 names.
131
132 pluginobject.getdjvuopt("key")
133 Return the value of the djvu option key as a string. The
134 returned value is always a character string, even when the
135 return is logically a number. Boolean values are returned as
136 strings yes or no. Besides the usual CGI-style flags, this
137 function recognizes the additional key pages and returns the
138 total number of pages in the DjVu document. An empty string is
139 returned when the key is not recognized.
140
141 pluginobject.onchange="code";
142 Ensure that string code is evaluated in the context of the plug‐
143 in object whenever something changes in the djview graphical
144 user interface. For instance, this evaluation happens when pro‐
145 gressive refinements are painted, and when the user manipulates
146 the image interactively.
147
148 pluginobject.version
149 Return a string describing the plugin version. This property
150 can be used to test whether the djview plugin is scriptable in
151 this browser.
152
153 Note that the scriptability feature may not be accessible until the
154 djview plugin is fully loaded. Therefore it is advisable to check
155 pluginobject.version from the JavaScript onload before calling any
156 other method.
157
158
160 This program was written by Andrei Erofeev <andrew_erofeev@yahoo.com>
161 and was then improved by Bill Riemers <docbill@sourceforge.net> and
162 Léon Bottou <leonb@users.sourceforge.net>.
163
164
166 djvu(1), ddjvu(1), djview4(1) djview3(1)
167
168
169
170DjView-4 1/4/2007 NSDEJAVU(1)