back

Perl v4- 1997

psdiff: A Postscript Differences Utility

J. Kilian and D. Loewenstern and P. N. Yianilos

Description: An author's tool that reads the Postscript files oldfile and newfile creating output Postscript file outfile in which textual differences are highlighted.

USAGE: psdiff oldfile newfile outfile [red green blue]

In particular, text in newfile that differs from that in oldfile is rendered using different color. The default is red 1 0 0 -- but the three optional arguments allow an arbitrary color to be specified.

Examples:

"Basic usage"

psdiff january.ps february.ps additions.ps

"Use blue to highlight the new text"

psdiff january.ps february.ps differences.ps 0 0 1

"See textual deletions by reversing the arguments"

psdiff february.ps january.ps deletions.ps

Caveats:

1) Changes in graphics are not detected.

2) The program was developed for use with Tex/Latex and the dvipsk Postscript conversion utility. It should work with Postscript files generated by other applications but has not been widely tested.

3) The program operates by inserting a change-color command just before each section of changed text. It cannot detect what color is being used to render text at the point of change, and assumes black 0 0 0. This assumption can be overridden by supplying three additional color arguments following the three described above.

4) The highlighted change may be larger than the actual change. In Postscript text is rendered a string-at-a-time where each string is enclosed in parenthesis. We detect differences at the character level, but report the entire string as a change.

5) Within a changed region a section of text may appear to be unchanged, that is be unhighlighted. This is a normal. The new text frequently contains words or fragments of words that also appear in the old text. When the differences are analyzed, some of these fragments may appear unhighlighted. Our code includes special provisions to minimize this effect.


Links:

back