<p>
DjVu is a digital document format with advanced compression technology. 
DjVu allows for the distribution of very high resolution images of scanned documents, digital documents, and photographs. 
DjVu viewers are available for the <a href="https://github.com/RussCoder/djvujs" target="_blank">web browser</a> (search for djvujs in Firefox for an extension), the desktop ( <a href="https://wiki.gnome.org/Apps/Evince" target="_blank">Evince</a>,  <a href="https://okular.kde.org/" target="_blank">Okular</a> an BSD/Linux, and <a href="https://djvu.sourceforge.net/djview4.html" target="_blank">djview</a> on BSD/Linux/Windows/Mac), and <a href="https://f-droid.org/en/packages/org.sufficientlysecure.viewer/" target="_blank">mobile</a> devices.
</p>

<p>
The toolchain for encoding and decoding DjVu is 
<a href="https://djvu.sourceforge.net/" target="_blank">djvulibre</a>
</p>
<p>
<a href="https://djvu.js.org/" target="_blank">djvu.js</a> is a Javascript library useful for online viewing.
</p>

<p>
<a href="https://djvu.org/" target="_blank">djvu.org</a> contains sample documents and specification documents.</p>

<h2>Creating a djvu file</h2>

<p>
The tool you use to convert something to the .djvu format depends on your requirements. If you're converting a basic, black-and-white document, then <code>cjb2</code> (part of the djvulibre distribution) works:
</p>

<pre><code>
$ cjb2 -dpi 300 foo.tiff
$ ls
foo.tiff
foo.djvu
</code></pre>

<p>
If you want to convert something more complex, then use <code>c44</code> (also a part of the djvulibre distribution):
</p>

<pre><code>
$ c44 -dpi 300 bar.jpg bar.djvu
$ ls
bar.jpg
bar.djvu
</code></pre>

<p>
To put both of these files in a single DjVu container:
</p>

<pre><code>
$ djvm -c baz.djvu foo.djvu bar.djvu
$ ls
bar.djvu
baz.djvu
foo.djvu
</code></pre>

<p>
You can add bookmarks, too.
Open a text file called <code>book.marks</code> (or any name you prefer) and enter:
<p/>

<pre><code>
(bookmarks
("Foo" "#1")
("Bar" "#2")
)
</code></pre>

<p>
And then apply it to your DjVu file:
</p>

<pre><code>
$ djvused -e 'set-outline book.marks' -s baz.djvu
</code></pre>

<p>
There's more you can do with DjVu, but this has been an overview of how I use it.
</p>
