|
| 1 | +## Usage |
| 2 | + |
| 3 | +diff-pdf is a tool for visually comparing two PDFs. |
| 4 | + |
| 5 | +It takes two PDF files as arguments. By default, its only output is its return |
| 6 | +code, which is 0 if there are no differences and 1 if the two PDFs differ. If |
| 7 | +given the `--output-diff` option, it produces a PDF file with visually |
| 8 | +highlighted differences: |
| 9 | + |
| 10 | +``` |
| 11 | +$ diff-pdf --output-diff=diff.pdf a.pdf b.pdf |
| 12 | +``` |
| 13 | + |
| 14 | +Another option is to compare the two files visually in a simple GUI, using |
| 15 | +the `--view` argument: |
| 16 | + |
| 17 | +``` |
| 18 | +$ diff-pdf --view a.pdf b.pdf |
| 19 | +``` |
| 20 | + |
| 21 | +This opens a window that lets you view the files' pages and zoom in on details. |
| 22 | +It is also possible to shift the two pages relatively to each other using |
| 23 | +Ctrl-arrows. This is useful for identifying translation-only differences. |
| 24 | + |
| 25 | +See the output of `$ diff-pdf --help` for complete list of options. |
| 26 | + |
| 27 | + |
| 28 | +## Obtaining the binaries |
| 29 | + |
| 30 | +Precompiled version of the tool for Windows is available from our |
| 31 | +[downloads](http://www.tt-solutions.com/downloads/diff-pdf-2012-02-28.zip) |
| 32 | +section -- the ZIP archive contains everything you need to run diff-pdf. It will |
| 33 | +work from any place you unpack it to. |
| 34 | + |
| 35 | +Precompiled version for openSUSE and Fedora can be downloaded from the |
| 36 | +[openSUSE build service](http://software.opensuse.org). |
| 37 | + |
| 38 | + |
| 39 | +## Compiling from sources |
| 40 | + |
| 41 | +The build system uses Automake and so a Unix or Unix-like environment (Cygwin |
| 42 | +or MSYS) is required. Compilation is done in the usual way: |
| 43 | + |
| 44 | +``` |
| 45 | +$ ./bootstrap |
| 46 | +$ ./configure |
| 47 | +$ make |
| 48 | +$ make install |
| 49 | +``` |
| 50 | + |
| 51 | +(Note that the first step, running the `./bootstrap` script, is only required |
| 52 | +when building sources checked from version control system, i.e. when `configure` |
| 53 | +and `Makefile.in` files are missing.) |
| 54 | + |
| 55 | +As for dependencies, diff-pdf requires the following libraries: |
| 56 | + |
| 57 | +- wxWidgets >= 3.0 |
| 58 | +- Cairo >= 1.4 |
| 59 | +- Poppler >= 0.10 |
| 60 | + |
| 61 | +#### CentOS: |
| 62 | + |
| 63 | +``` |
| 64 | +$ sudo yum groupinstall "Development Tools" |
| 65 | +$ sudo yum install wxGTK wxGTK-devel poppler-glib poppler-glib-devel |
| 66 | +``` |
| 67 | + |
| 68 | +#### Ubuntu: |
| 69 | + |
| 70 | +``` |
| 71 | +$ sudo apt-get install make automake g++ |
| 72 | +$ sudo apt-get install libpoppler-glib-dev poppler-utils wxgtk3.0-dev |
| 73 | +``` |
| 74 | + |
| 75 | +#### OSX: |
| 76 | +- Install Command Line Tools for Xcode `$ xcode-select --install` and |
| 77 | +[Homebrew](http://brew.sh) to manage dependencies, then: |
| 78 | + |
| 79 | +``` |
| 80 | +$ brew install automake autoconf wxmac poppler cairo |
| 81 | +``` |
| 82 | + |
| 83 | +Note that many more libraries are required on Windows, where none of the |
| 84 | +libraries Cairo and Poppler use are normally available. At the time of writing, |
| 85 | +transitive cover of the above dependencies included fontconfig, freetype, glib, |
| 86 | +libpng, pixman, gettext, libiconv, libjpeg and zlib. |
| 87 | + |
| 88 | +Precompiled version of the dependencies for Windows, built with MinGW, are |
| 89 | +available from our [downlods](http://github.com/vslavik/diff-pdf/downloads) |
| 90 | +section (wxWidgets is not included, as it supports MinGW well). |
| 91 | + |
| 92 | + |
| 93 | +### Compiling on Windows using MinGW |
| 94 | + |
| 95 | +1. First of all, you will need working MinGW installation with MSYS environment |
| 96 | +and C++ compiler. The instructions on installing MinGW can be found in the |
| 97 | +[MinGW website](http://www.mingw.org/wiki/Getting_Started): |
| 98 | + |
| 99 | +1. Once installed, launch the MinGW Shell tool. It will open a terminal window; |
| 100 | +type `$ cd /c/directory/with/diff-pdf` to do to the directory with diff-pdf |
| 101 | +sources. |
| 102 | + |
| 103 | +1. You will need to install additional MinGW components that are not normally |
| 104 | +included with MinGW, using these commands: |
| 105 | + |
| 106 | + ``` |
| 107 | + $ mingw-get install msys-wget |
| 108 | + $ mingw-get install msys-unzip |
| 109 | + $ mingw-get install msys-perl |
| 110 | + ``` |
| 111 | + |
| 112 | +1. It's time to build the software now and give it some time to finish (Note |
| 113 | +that this step requires Internet connectivity, as it downloads some dependencies |
| 114 | +packages): |
| 115 | + |
| 116 | + ``` |
| 117 | + $ make -f Makefile.mingw |
| 118 | + ``` |
| 119 | + |
| 120 | +1. If everything went well, diff-pdf is now in the `mingw\Products\` |
| 121 | +directory. |
| 122 | + |
| 123 | + |
| 124 | +## Installing |
| 125 | + |
| 126 | +On Unix, the usual `make install` is sufficient. |
| 127 | + |
| 128 | +On Windows, installation is not necessary, just copy the files somewhere. If |
| 129 | +you built it following the instructions above, all the necessary files will be |
| 130 | +in the `mingw\Products\` directory. |
0 commit comments