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