1.10. PDF support: Installing from Source Code

These instructions should be followed if your system does not provide libharu as an optionally installable component. For example, Many common Linux RPM distributions do provide this component on the distribution DVD or CDs. Most other operating systems (e.g. IRIX and Solaris) don't. Sometimes it can be downloaded precompiled from freeware sites. Unfortunately, such freeware has been known to be less than rigorously tested by the hardware companies, or it is too out-of-date to be usable by EMBOSS, and so you may find that you have no option but to compile the libraries yourself from source code.

Before compiling PDF support yourself, read any operating system specific notes for your machine in this chapter.

PDF optional dependencies. The libharu PDF support package can provide optional PNG-handling support. If you require such support then install the libpng and zlib packages as described under PNG prerequisites (Section 1.7, “EMBOSS Installation: Platform-specific Concerns”) for your operating system. Note that, if you have compiled the PNG and ZLIB packages from source code then it makes sense to install the libharu package to the same prefix.

libharu compilation. The procedure for libharu compilation is as follows.

  1. Do a final check to see whether your system already has libharu installed.

    a) On Linux RPM based systems type:

    rpm -q libharu
    rpm -q libharu-devel or just
    rpm -qa "libharu*"

    both library and development packages should be shown. If not then install the relevant RPMs from your distribution DVD or CDs.

    b) On other Unix systems look in any system library directories (those named lib or lib64 depending on your system) for a file called libhpdf.so. A command that will usually find this file is:

    find /usr -name libhpdf.so -print

    If the file is not found in a standard system directory then it's recommended you compile your own for use with EMBOSS.

  2. Get the libharu source code

    This can be downloaded from http://www.libharu.org . This assumes version 2.1.0 is being used. Use whatever is the latest version of libharu. See the current versions section of this chapter.

  3. In a temporary directory type:

    gunzip libharu-2.1.0.tar.gz
    tar xf libharu-2.1.0.tar
    rm libharu-2.1.0.tar
    cd libharu-2.1.0
  4. Compile libharu:

    ./configure --prefix=/usr/local
    make
    make install

    This will install the library and development files under the /usr/local directory tree.

    If you do not require libharu to have PNG support then you can configure and install using:

    ./configure --prefix=/usr/local --without-zlib --without-png
    make
    make install
  5. Delete the libharu source code:

    cd ..
    rm -rf libharu-2.1.0