Blame README

Packit df99a1
Packit df99a1
1- WHAT IS DJVU.
Packit df99a1
================
Packit df99a1
Packit df99a1
DjVu (pronounced "déjà vu") a set of compression technologies, a file format,
Packit df99a1
and a software platform for the delivery over the Web of digital documents,
Packit df99a1
scanned documents, and high resolution images.
Packit df99a1
Packit df99a1
DjVu documents download and display extremely quickly, and look exactly the
Packit df99a1
same on all platforms. DjVu can be seen as superior alternative to PDF and
Packit df99a1
Postscript for digital documents, to TIFF (and PDF) for scanned documents, to
Packit df99a1
JPEG for photographs and pictures, and to GIF for large palettized
Packit df99a1
images. DjVu is the only Web format that is practical for distributing
Packit df99a1
high-resolution scanned documents in color. No other format comes close.
Packit df99a1
Packit df99a1
Typical DjVu file sizes are as follows: 
Packit df99a1
Packit df99a1
- Bitonal scanned documents: 
Packit df99a1
        5 to 30KB per page at 300dpi, 
Packit df99a1
        3 to 10 times smaller than PDF or TIFF.
Packit df99a1
Packit df99a1
- Color scanned documents: 
Packit df99a1
           30 to 100KB per page at 300dpi,
Packit df99a1
           5 to 10 times smaller than JPEG.
Packit df99a1
Packit df99a1
- Photos:
Packit df99a1
        2 times smaller than JPEG, 
Packit df99a1
        about the same as JPEG-2000. 
Packit df99a1
Packit df99a1
- Palettized images: 
Packit df99a1
        2 times smaller than GIF,
Packit df99a1
        up to 10 times if there is text.
Packit df99a1
Packit df99a1
DjVu is used by hundreds of commercial, governmental, and non-commercial web
Packit df99a1
sites around the world to distribute scanned documents, digital documents, and
Packit df99a1
high-resolution photos.
Packit df99a1
Packit df99a1
Demos, and general information about DjVu can be found at 
Packit df99a1
http://www.djvuzone.org, or at http://www.lizardtech.com. 
Packit df99a1
Packit df99a1
DjVu was originally developed at AT&T Labs-Research. AT&T sold DjVu to
Packit df99a1
LizardTech Inc. in March 2000.
Packit df99a1
Packit df99a1
Packit df99a1
Packit df99a1
2- WHAT IS DJVULIBRE? 
Packit df99a1
=====================
Packit df99a1
Packit df99a1
In an effort to promote DjVu as a Web standard, LizardTech's management was
Packit df99a1
enlightened enough to release the reference implementation of DjVu under the
Packit df99a1
GNU GPL in October 2000. DjVuLibre (pronounced like the French "déjà vu
Packit df99a1
libre"), is an enhanced version of that code maintained by the original
Packit df99a1
inventors of DjVu. It is compatible with LizardTech's DjVu software v3.5.
Packit df99a1
Packit df99a1
This package includes: 
Packit df99a1
Packit df99a1
- An up-to-date version of the C++ DjVu Reference Library 
Packit df99a1
- A full-fledged wavelet-based compressor for pictures. 
Packit df99a1
- A simple compressor for bitonal (black and white) scanned pages. 
Packit df99a1
- A compressor for palettized images (a la GIF). 
Packit df99a1
- A full set of utilities to manipulate and assemble DjVu images and documents. 
Packit df99a1
- A set of decoders to convert DjVu to a number of other formats. 
Packit df99a1
Packit df99a1
The full-fledged DjVu file viewer and browser plugin DjView4
Packit df99a1
is available as a separate package.
Packit df99a1
Packit df99a1
Packit df99a1
Packit df99a1
3- BUILDING DJVULIBRE
Packit df99a1
=====================
Packit df99a1
Packit df99a1
3.1- PREREQUISITES
Packit df99a1
------------------
Packit df99a1
Packit df99a1
DjVuLibre-3.5 relies on various components available from the web.  
Packit df99a1
Most recent Linux distribution already come with these.  
Packit df99a1
You can also download and compile them if you wish.
Packit df99a1
Be sure to read the system specific notes 
Packit df99a1
at the end of this file.
Packit df99a1
Packit df99a1
COMPILER --
Packit df99a1
Development is done with the GCC g++ compiler, which is therefore
Packit df99a1
recommended for all platforms.  The CLANG compiler has been tried and
Packit df99a1
seems to work, but its output has not been seriously tested.
Packit df99a1
Packit df99a1
LIBJPEG/LIBTIFF --
Packit df99a1
A small number of DjVu files internally use JPEG encoding instead 
Packit df99a1
of IW44 wavelet encoding.  These files are processed using either 
Packit df99a1
version 6a or 6b of the IJG libjpeg library <http://www.ijg.org>.  
Packit df99a1
Some utility programs are able to read TIFF files. These programs
Packit df99a1
rely on the LIBTIFF library <http://libtiff.org>.
Packit df99a1
You can also compile DjVuLibre with neither JPEG nor TIFF support.  
Packit df99a1
You might never notice the difference.
Packit df99a1
Packit df99a1
THREADS --
Packit df99a1
The DjVu viewer makes heavy use of multiple threads of execution.  
Packit df99a1
Modern  Unix operating systems come with the standardized Posix threads.  
Packit df99a1
DjVuLibre-3.5 fully supports detecting and using Posix threads.
Packit df99a1
Packit df99a1
Packit df99a1
3.2 - CONFIGURE
Packit df99a1
---------------
Packit df99a1
Packit df99a1
Chances are that everything will work by simply running 
Packit df99a1
commands "./configure", "make" and "make install". 
Packit df99a1
Packit df99a1
Various options and environment variables affect the execution of the
Packit df99a1
configuration script.  A complete list can be obtained by typing 
Packit df99a1
"configure --help".  Also see the INSTALL file for further details.
Packit df99a1
Here are the most important ones.
Packit df99a1
Packit df99a1
* Option "--prefix=PREFIXDIR"
Packit df99a1
  This option specifies where the DjVuLibre software will be installed.
Packit df99a1
  The default prefix is /usr/local.  
Packit df99a1
Packit df99a1
* Option "--enable-desktopfiles[=(yes|no)]"
Packit df99a1
  Installs icon and mime type files in the customary xdg directories.
Packit df99a1
  The default is "yes".
Packit df99a1
Packit df99a1
* Option "--with-jpeg=JPEGDIR"
Packit df99a1
  This option specifies a directory where the JPEG library has been
Packit df99a1
  compiled. This directory contains both the include files and the 
Packit df99a1
  library.  Without this option, the configuration script will search 
Packit df99a1
  the JPEG library in standard places.
Packit df99a1
  When everything else fails, you can simply define the environment
Packit df99a1
  variables JPEG_CFLAGS and JPEG_LIBS.
Packit df99a1
Packit df99a1
* Option "--with-tiff=TIFFDIR"
Packit df99a1
  This option specifies a directory where the LIBTIFF library has been
Packit df99a1
  compiled. This directory contains both the include files and the 
Packit df99a1
  library.  Without this option, the configuration script will search 
Packit df99a1
  the LIBTIFF library in standard places.
Packit df99a1
  When everything else fails, you can simply define the environment
Packit df99a1
  variables TIFF_CFLAGS and TIFF_LIBS.
Packit df99a1
Packit df99a1
Always check the output of the configuration script for warnings and errors.
Packit df99a1
In particular, the configuration script might disable the compilation of
Packit df99a1
djview if it cannot locate the required libraries and utilities.  The warning
Packit df99a1
messages are the only way to know.
Packit df99a1
Packit df99a1
3.3 - MAKE
Packit df99a1
----------
Packit df99a1
Packit df99a1
You can then perform the compilation by typing 
Packit df99a1
Packit df99a1
        $ make
Packit df99a1
Packit df99a1
The compilation can last a few minutes.  Again check the output for warnings
Packit df99a1
and errors.  Finally a brief message lets you know that the compilation was
Packit df99a1
successful.  You can then proceed with the installation.
Packit df99a1
Packit df99a1
3.4 - INSTALL
Packit df99a1
------------
Packit df99a1
Packit df99a1
Typing:
Packit df99a1
Packit df99a1
        $ make install
Packit df99a1
Packit df99a1
or if necessary:
Packit df99a1
Packit df99a1
        $ sudo make install
Packit df99a1
Packit df99a1
should:
Packit df99a1
Packit df99a1
- install the executable programs into "${prefix}/bin/".
Packit df99a1
- possibly install the shared library into "${prefix}/lib/".
Packit df99a1
- install the man pages under "${prefix}/man or ${prefix}/share/man/".
Packit df99a1
- install various ancillary files under "${prefix}/share/djvu/".
Packit df99a1
- install "${prefix}/share/pkgconfig.pc".
Packit df99a1
- optionally install the icon and mime type information files
Packit df99a1
Packit df99a1
Where ${prefix} refers to the directory specified by the prefix option
Packit df99a1
of the configuration script, which defaults to "/usr/local", and the
Packit df99a1
paths above can be fine-tuned using appropriate arguments to
Packit df99a1
./configure and make.
Packit df99a1
Packit df99a1
Packit df99a1
4 - BUILDING FOR MAC OS X
Packit df99a1
=========================
Packit df99a1
Packit df99a1
(note: these instructions are slightly outdated.)
Packit df99a1
Packit df99a1
The Mac OS X version of djvulibre can be built in one of two ways:
Packit df99a1
Packit df99a1
- the Unix way
Packit df99a1
- the Xcode way
Packit df99a1
Packit df99a1
These instructions are to help setup and build djvulibre for a
Packit df99a1
multi-architecture binary (ppc, i386).  Your milage with the following
Packit df99a1
configure options (note: libjpeg.a and libtiff.a are installed
Packit df99a1
universal on the machine this was tested with.)
Packit df99a1
Packit df99a1
We recommend that you first install macports with the 
Packit df99a1
libraries zlib, libpng, jpeg and tiff with option +universal.
Packit df99a1
The commands to install these libraries are
Packit df99a1
  $ sudo port install zlib +universal
Packit df99a1
  $ sudo port install libpng +universal
Packit df99a1
  $ sudo port install jpeg +universal
Packit df99a1
  $ sudo port install tiff +universal
Packit df99a1
Packit df99a1
Then you can run configure
Packit df99a1
Packit df99a1
./configure \
Packit df99a1
   --enable-static=yes \
Packit df99a1
   --disable-desktopfiles \
Packit df99a1
   --with-extra-includes=/usr/include \
Packit df99a1
   --with-extra-libraries=/usr/lib \
Packit df99a1
   CFLAGS="-arch ppc -arch i386" \
Packit df99a1
   CXXFLAGS="-arch ppc -arch i386" \
Packit df99a1
   LDFLAGS="-arch ppc -arch i386"
Packit df99a1
Packit df99a1
The --with-extra-include and --with-extra-libraries are here
Packit df99a1
to favor system libraries (in /usr) over those that come with macports.
Packit df99a1
Then you can compile with 
Packit df99a1
Packit df99a1
$ make
Packit df99a1
Packit df99a1
Running "make install" will install djvulibre in directory /usr/local.
Packit df99a1
Note that the produced libraries will depend on the macports jpeg and tiff
Packit df99a1
libraries.  You can change that using the command "install_name_tool"
Packit df99a1
and other macosx tricks...
Packit df99a1
Packit df99a1
Alternatively you can just open the macosx/DjVuLibre/DjVuLibre.xcodeproj 
Packit df99a1
and build everything using Xcode. This can be painful if you do not have
Packit df99a1
the same version of Xcode as the one we used to generate that file.
Packit df99a1
In Leon's opinion, this is hell.  Jeff agrees, those dyld dependancies 
Packit df99a1
trap us forever in the eighth circle.
Packit df99a1
Packit df99a1
Note that the macosx directory contains a few useful tools
Packit df99a1
that are not compiled using the main makefile:
Packit df99a1
Packit df99a1
The djvu.mdimporter program is a spotlight importer for djvu metadata.
Packit df99a1
The djvu.qlgenerator program generates quicklook data (leopard only).
Packit df99a1
Packit df99a1
Packit df99a1
5 - BUILDING FOR WINDOWS
Packit df99a1
========================
Packit df99a1
Packit df99a1
5.1- Using Microsoft Visual C++ 2012
Packit df99a1
------------------------------------
Packit df99a1
Packit df99a1
   See the directory win32.
Packit df99a1
   Populate the zlib, jpeg and tiff directories with
Packit df99a1
   the open source code suggested in the README files.
Packit df99a1
   Check win32/djvulibre/dirs.props to see
Packit df99a1
   how to name the directories.
Packit df99a1
   Then open win32/djvulibre/djvulibre.sln and compile.
Packit df99a1
Packit df99a1
   Next step would then be to follow the instructions
Packit df99a1
   in the djview package to create a djview project and
Packit df99a1
   add it to this solution. Finally you can use the script
Packit df99a1
   djvulibre-install.sh and djvulibre.nsi to prepare
Packit df99a1
   the djvulibre+djview installer.
Packit df99a1
Packit df99a1
Packit df99a1
5.2- Using Mingw
Packit df99a1
----------------
Packit df99a1
Packit df99a1
   You must first install the mingw compiler and the msys environment.
Packit df99a1
   See www.mingw.org for more information.
Packit df99a1
   From the msys shell, run the usual commands 
Packit df99a1
     $ configure
Packit df99a1
     $ make
Packit df99a1
   Then collect the djvulibre dll from directory libdjvu/.libs
Packit df99a1
   and the executables from directory tools/.libs 
Packit df99a1
   Please refer to the file INSTALL for information
Packit df99a1
   about the arguments of the script 'configure'.
Packit df99a1
Packit df99a1
Packit df99a1
5.3- Using Cygwin 
Packit df99a1
-----------------
Packit df99a1
Packit df99a1
   Simply run the usual commands 
Packit df99a1
     $ configure
Packit df99a1
     $ make
Packit df99a1
     $ make install
Packit df99a1
   Please refer to the file INSTALL for information
Packit df99a1
   about the arguments of the script 'configure'.
Packit df99a1
 
Packit df99a1
Packit df99a1