uiOptions - options to adjust the UI of the viewer:.The loadDocumentByUrl is called, but in case of loadDocument method, this The base url is extracted automatically from a url to the index.djvu, when For bundled djvu this parameter is not required. One option - the base url, which is the url to the directory containing theįiles of an indirect djvu. djvuOptions - an object which is passed to the library.By default the browser'sĬolor scheme is used (or the value save in the local storage).
#DJVU FILE OPENER CODE#
language - 2-character language code like ru, en, sv etc.Ignored at all, and the default scale value (which is 1) will be used. Themselves, to wit, 8 will be treated as 6, and 0.001 as 0.1, 0 will be Numbers less/greater than the limits are replaced by the limits pageScale - the scale of a page, it is a number from 0.1 to 6 (~ 10% toĦ00%).pageRotation - the rotation of a page, it can be 0, 90, 180, 270.Number of pages in a document, then the last page number will be used. If it's less than 1, 1 will be used, if it's greater than the total pageNumber - the number of the currently opened page.name - the visible name of the opened document.Text: "Here is your notification/agreement for the user", It has the following shape: // any of the parameters may be omitted, use only those you needīaseUrl: "/url/to/directory/with/indirect/djvu/" The config is an object containing options for the viewer. off(eventName) - to remove an event handler.on(eventName, handler) - to add an event handler.getPageNumber() - returns the current page number.Method again or use the last parameter of the two previous methods. Loaded some options are reset to the initial ones, so you have to call the configure(config) - just sets the options.async loadDocumentByUrl(url, config = null) - loads the documents asĪn ArrayBuffer and then invokes the previous method.The ArrayBuffer and a name of a document which should be shown at footer loadDocument(buffer, name = "***", config = null) - accepts.Programmatic APIįurthermore, the viewer has an API, which allows to open djvu files programmatically: Then just open and you will see the viewer. In order to start the local server (you may change the port as you wish).
#DJVU FILE OPENER INSTALL#
To install the serve package globally and then head to the directory, where our files are kept, and run serve -p 5000 Run the following commands in your shell. Any static web server will do.įor example, if you have Node.js installed, you can just use the serve package to run a simple static web server. To start a local web server in order to make everything work as it works on the Internet. It's concerned with that theĭjVu.js uses the Web Workers API of the web browsers and Chrome doesn't allow the script to create a Worker, when the file is loaded from the file system directly. But if you use Google Chrome or Opera, you won't see anything except for some errors in the console. If you use Mozilla Firefox web browser, then you can just open the index.html and you will see the DjVu.js viewer, which will work absolutely the same wayĪs it does on the main page of this website. Window.ViewerInstance = new DjVu.Viewer() html file (let's say index.html) with the following content. How to use itĬreate a folder with files that you downloaded from here ( djvu.js, djvu_viewer.js).
#DJVU FILE OPENER DOWNLOAD#
You can download the previous versions here. So no separate djvu_viewer.css is provided. Note that since the version 0.5.0 all viewer's CSS is inside the js file. Here you can download the library and the viewer.