summaryrefslogtreecommitdiff
path: root/Build/source/libs/xpdf/xpdf-src/INSTALL
blob: f45ce6bad37c5adbf1526d37b5769698d9d99625 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
Xpdf
====

version 4.01.01
2019-mar-14

The Xpdf software and documentation are
copyright 1996-2019 Glyph & Cog, LLC.

Email: xpdf@xpdfreader.com
WWW: http://www.xpdfreader.com/


Compiling xpdf
--------------

Xpdf is written in C++ (with a little bit of C).  It should work with
any ANSI-compliant C++ and C compilers.  The systems and compilers
it's been tested with are listed on the xpdf web page.

Xpdf requires the Qt toolkit.  The non-GUI command line tools do not
use Qt.

The following notes give specific instructions for compiling on
different systems.


*********************
***  Linux, OS X  ***
*********************

* Make sure you have the following installed:

    - CMake 2.8.8 or newer
    - FreeType 2.0.5 or newer
    - Qt 4.8.x or 5.x (for xpdf only)
    - libpng (for pdftoppm and pdftohtml)
    - zlib (for pdftoppm and pdftohtml)

  If Qt isn't found, the GUI viewer (xpdf) won't be built, but the
  command line tools will still be built.

* Create a build directory.  These instructions assume that you create
  a directory called "build" under the top-level xpdf source
  directory, but the build directory can be anywhere you like.  Create
  the directory and cd into it:

      cd ..../xpdf-X.YY
      mkdir build
      cd build

* Run cmake:

      cmake -DCMAKE_BUILD_TYPE=Release {other options - see below} ..

  If your build directory isn't under the source, use the full path to
  the source directory:

      cmake -DCMAKE_BUILD_TYPE=Release {other options} ..../xpdf-X.YY

* If cmake doesn't find FreeType, you can set FREETYPE_DIR to point to
  the FreeType install directory.  Add this to the cmake command line:

      -DFREETYPE_DIR=/opt/freetype

  Cmake will look for ${FREETYPE_DIR}/include.

  You can also set the FreeType library location with:

      -DFREETYPE_LIBRARY=/opt/freetype/lib/libfreetype.so

* If cmake doesn't find Qt, make sure qmake is on your executable
  search path.

* To change the xpdf install directory, use:

      -DCMAKE_INSTALL_PREFIX=/opt/xpdf

  If you're familiar with autoconf, this is similar to the "--prefix"
  option.

* Other configuration options are:

    -DSPLASH_CMYK=ON
        Enable CMYK rasterization support.

    -DA4_PAPER=ON
        Switches the default paper size for PostScript output (xpdf
        and pdftops) to A4.  The default is Letter size.

    -DNO_TEXT_SELECT=ON
        With this option, xpdf will not copy text.  (This is only
        useful on closed systems where the user can't get at the PDF
        file directly.)

    -DOPI_SUPPORT=ON
        Enables support for generation of OPI (Open Prepress
        Interface) comments with pdftops.

    -DMULTITHREADED=0
        Disables multithreading, which also disables building the GUI
        viewer (xpdf).  This does not affect the command line tools.
        Disabling multithreading should only be necessary if you're
        building with a compiler other than gcc, clang, or Microsoft
        Visual Studio.

    -DSYSTEM_XPDFRC="/etc/xpdfrc"
        Look for a system-wide xpdfrc config file in this directory.

     -DCMAKE_DISABLE_FIND_PACKAGE_Qt4=1
     -DCMAKE_DISABLE_FIND_PACKAGE_Qt5Widgets=1
        Do not search for the Qt4/Qt5 libraries.  This will disable
        building the GUI viewer (xpdf).

     -DCMAKE_C_FLAGS="..."
     -DCMAKE_CXX_FLAGS="..."
        Set additional options to pass to the C and/or C++ compilers.

     -DCMAKE_EXE_LINKER_FLAGS="..."
        Set additional options to pass to the linker.

     -DCMAKE_INSTALL_BINDIR
        Set the bin directory, relative to CMAKE_INSTALL_PREFIX
        (typically "bin").

     -DCMAKE_INSTALL_MANDIR
        Set the man directory, relative to CMAKE_INSTALL_PREFIX
        (typically "man" or "share/man").

* Build:

      make

  This will build the executables in the build directory:

      xpdf/xpdf
      xpdf/pdftops
      xpdf/pdftotext
      xpdf/pdftohtml
      xpdf/pdfinfo
      xpdf/pdffonts
      xpdf/pdfdetach
      xpdf/pdftoppm
      xpdf/pdftopng
      xpdf/pdfimages
      xpdf-qt/xpdf

* If desired, install the binaries and man pages:

      make install

If you want to run a quick test, there is a tiny PDF file included
with xpdf, as misc/hello.pdf .


*****************
***  Windows  ***
*****************

The Windows build procedure is essentially the same as for Unix.  If
building with cygwin, the procedure is identical to Unix.

If building with Visual Studio:

* Make sure you have CMake, FreeType, libpng, and zlib installed.

* You'll need to set the FREETYPE_DIR variable to point to your
  FreeType installation, CMAKE_INCLUDE_PATH to point to your libpng
  includes, CMAKE_LIBRARY_PATH to point to your libpng library, and
  ZLIB_ROOT to point to your zlib installation.

      cmake -G "NMake Makefiles"
            -DCMAKE_BUILD_TYPE=Release
            -DFREETYPE_DIR="c:/software/freetype"
            -DCMAKE_INCLUDE_PATH="c:/software/libpng"
            -DCMAKE_LIBRARY_PATH="c:/software/libpng"
            -DZLIB_ROOT="c:/software/zlib"
            ..

* Build:

      nmake