pdf-diff icon indicating copy to clipboard operation
pdf-diff copied to clipboard

Output as PDF annotations

Open benoitrosa opened this issue 2 years ago • 2 comments

Hi,

Atfer posting an issue on the original repo, I went ahead and actually implemented the feature, which proved quite easy. This pull request is the basic functionality. I tested both on a very simple Latex MWE with just a few words, and with a very complex scientific publication which was changed from top to bottom between two revisions, and the output is clean :)

Main change made: a new CLI option -p (or --pdfoutput). If activated, it will output two PDFs in the working directory named output1.pdf and output2.pdf. The output PDFs are a copy of the input ones with changes highlighted as annotations.

Dependency on the pdf-annotate python library is necessary (https://github.com/plangrid/pdf-annotate), which in turn requires Python3.8 (it's a pure python library). As of now the import of the library is done in the beginning, perhaps it could be done only if the -p option is used, so that pdf-diff can still be used with PNG output without requiring the lib.

Tests done on Ubuntu 20.04 with python 3.8

benoitrosa avatar Jul 03 '23 14:07 benoitrosa

This is very cool but since I'm not actively working on this project it'll be a long time before I take a close enough look to consider merging it. But thanks!

JoshData avatar Jul 05 '23 18:07 JoshData

No problem, I needed the feature anyway so it's my pleasure ! Perhaps I'll implement a few more things and complete this PR if I find some time, if it can be useful for other people ;)

benoitrosa avatar Jul 06 '23 13:07 benoitrosa