cascremers / pdfdiff Goto Github PK
View Code? Open in Web Editor NEWCommand-line tool to inspect the difference between (the text in) two PDF files
Command-line tool to inspect the difference between (the text in) two PDF files
pdfdiff version: 0.93
OS version: 21.4.0 Darwin Kernel Version 21.4.0: Mon Feb 21 20:34:37 PST 2022; root:xnu-8020.101.4~2/RELEASE_X86_64 x86_64
Problem description:
If no diff tools before vimdiff are available and vimdiff is installed (and used for diff), the program runs infinitely during the comparison of any 2 pdf files.
Expected behavior:
The program outputs the diff or shows the graphical interface for comparison.
Actual behavior:
The program waits indefinitely.
Additional information:
vimdiff is the only interactive console-level interface here and by default, if you open the text files with vimdiff it opens the interface and waits for your command to close the diff. I suggest that infinite wait time is just because vimdiff waits for the commands and do not return output to the python program. The simplest solution is just to drop vimdiff probably.
If I run pdfdiff, I got the following error:
File "./pdfdiff.py", line 144
print "Error: %s" % (notfound)
^
SyntaxError: invalid syntax
uname -i : 4.9.61-3-MANJARO #1 SMP PREEMPT Thu Nov 9 01:18:52 UTC 2017 x86_64 GNU/Linux
Hi cas,
I just found this tool while reviewing a student's paper.
I tested on my mac on python3 (v3.9.1) but I get the following error:
Traceback (most recent call last):
File "/usr/local/src/pdfdiff/pdfdiff.py", line 494, in
if len(filter(lambda s:s.startswith(diffViewerPrefix),get_viewer_list())) == 0:
TypeError: object of type 'filter' has no len()
The issue seems to be that filter returns something different than what it used to be. I will keep hunting for a fix, but if you have one I'd appreciate it, as I am not a python expert ;).
BTW: I just looked at your webpage and I might contact you for work at some point ;)
I've customised slightly as I want diff to be run as:
diff --unified=0 --report-identical-files
It seems these extra parameters aren't acted on (and I don't understand lamda..). I also tried kdiff3 selection and it seems also that it's parameters:
kdiff3 --cs WordWrap=1 --cs ShowWhiteSpaceCharacters=0
may not be getting passed when view_diff runs:
Currently, pdfdiff.py handles ligatures by considering a hard-coded set of ligature encodings. This set is incomplete and depends on the encoding of the input.
Ideally, we detect the encoding of text input files (this is hard, but one can consider, e.g. using the chardet libs) and then use python's codecs module to normalize the input, in particular for ligatures.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.