Skip to content
forked from JoshData/pdf-diff

A PDF comparison utility in Python.

License

Notifications You must be signed in to change notification settings

Parobus/pdf-diff

This branch is 2 commits behind JoshData/pdf-diff:primary.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a0d8230 · Jun 20, 2019

History

57 Commits
Jun 20, 2019
Jun 20, 2019
Jun 9, 2014
Jun 9, 2014
Jun 20, 2019
Jun 9, 2014
Jun 20, 2019

Repository files navigation

pdf-diff

Finds differences between two PDF documents:

  1. Compares the text layers of two PDF documents and outputs the bounding boxes of changed text in JSON.
  2. Rasterizes the changed pages in the PDFs to a PNG and draws red outlines around changed text.

Example Image Output

The script is written in Python 3, and it relies on the pdftotext program.

Requirements

libxml2 >= 2.7.0, libxslt >= 1.1.23, poppler

Requirements installation for Ubuntu:

sudo apt-get install python3-lxml poppler-utils

Requirements installation for OS X:

brew install libxml2 libxslt poppler

Installation

From PyPI:

pip install pdf-diff

From source:

sudo python3 setup.py install

Running

Turn two PDFs into one large PNG image showing the differences:

pdf-diff before.pdf after.pdf > comparison_output.png

Maintainer Notes

To deploy:

python3 -m pip install --user --upgrade setuptools wheel twine
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*

About

A PDF comparison utility in Python.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%