Comparing pdf documents

At work, we generate PDF receipt documents, and we wanted to write a unit test to compare PDF documents to verify its generated correctly.
List of programs that can compare pdfs
  1. diff-pdf = decided on this as its free, multi platform, works and easy to use
  2. pdftotext = free, multi platform but requires extra step of converting pdf to text
  3. diffpdf = paid software
Installing diff-pdf on mac (from github readme)
$ brew install diff-pdf
Installing diff-pdf on alpine (first time)
# install compilation tools 
$ apk add make autoconf automake g++ gawk

# install required libraries
$ apk add glib-dev poppler-dev poppler-utils wxgtk-dev

# get codebase to generate binary
$ git clone https://github.com/vslavik/diff-pdf.git
$ cd diff-pdf

# generate configure script
$ ./bootstrap

# generate makefile
$ ./configure

# generate binary (diff-pdf)
$ make
List of research sites: stackoverflow, ask ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *