Compiling Mupdf from Source
MuPdf is a free and open source software library written in C that implements a pdf and xps parsing and rendering engine. You can download mupdf from http://code.google.com/p/mupdf/downloads/list. For windows just download “mupdf-1.0-tools-windows.zip“ and install. For linux you cannot get a ready made package. You should download the source file and compile it. For compiling from source, you will need several third party libraries: freetype2, jbig2dec, libjpeg, openjpeg, and zlib. From mupdf-download link, given above, you can download both the source file (mupdf-1.0-source.tar.gz) and third party files (mupdf-thirdparty-2012-04-23.zip).
(From here I explain very detail. It is for beginners in linux. If you are already familiar with “make“, don’t waste your time. Compile all the dependencies first. And after that compile mupdf source).
Compiling third party dependencies.
Extract the third party files. You will get a folder named “thirdparty“. Inside thirdparty, there will be 5 folders. We have to compile all of them one by one. Before starting you should install libtool.
sudo apt-get install libtool.
After that we can start our compilation work. Lets start with freetype-2.4.9.
cd freetype-2.4.9
./configure (If it doesn’t work, sh autogen.sh and then ./configure).
make
sudo make install
Next we go for jbig2dec.
cd jbig2dec
sh autogen.sh
./configure (If you have no permission over configure to run, chmod 777 configure).
make
sudo make install
Next is jpeg-8d.
With the jpeg-8d given by mupdf, I can’t compile it. So i decided to download it separately. You can also download it from http://www.ijg.org/. Download jpegsrc.v8d.tar.gz from there (It is for linux). Decompress it. Then you will get a folder named jpeg-8d. Now continue our compilation.
cd jpeg-8d (new jpeg-8d)
./configure (If you have no permission over configure to run, chmod 777 configure).
make
sudo make install
Now we go for openjpeg-1.5.0
cd openjpeg-1.5.0
./configure (If you have no permission over configure to run, chmod 777 configure).
make
sudo make install
Next is zlib-1.2.5
cd zlib-1.2.5
./configure (If you have no permission over configure to run, chmod 777 configure).
make
sudo make install
Compiling MuPdf source
Now all the dependencies are compiled. Now we can start compiling our mupdf source. Extract mupdf-1.0-source.tar.gz. Then,
cd mupdf-1.0-source
make
sudo make install
Now it is done.
man mupdf will show you the man page.
Note :- I am using ubuntu 11.10






