JoshData/pdf-diff

Output as PDF annotations instead of images

benoitrosa opened this issue · 1 comments

Hi,

I just found this repo and after testing on a very complex PDF pair, it works quite well. Thanks a lot for making this tool !

I think it would be extremely useful (and maybe not so complex after a quick look at the code) to output a pair of PDFs with changes highlighted as annotations (something like strikeouts for removals, and highlights for additions).

I had a look in the code and I see that changes are saved in a format with basically x-y coordinates in the PDF file, before being transformed into x-y coordinates in the image space for rendering the changes. I think that using directly the PDF coordinates and adding annotations using a lib like PDF Annotate (https://github.com/plangrid/pdf-annotate) could be done.

I think it would be super useful ! I'll have a look if I can spare some time this summer, but if that's already in the pipeline, or if you think you could implement it quickly (because you know well your code structure), feel free to do so before me!

Hi again,

I actually went ahead and implemented the functionality using PdfAnnotate as described above. I just made a pull request with my basic commit, closing this issue for better coherence.