Changeset 79
- Timestamp:
- 04/28/08 10:14:13 (3 months ago)
- Files:
-
- trunk/apps/pdfdiff/ChangeLog (modified) (1 diff)
- trunk/apps/pdfdiff/configure.in (modified) (2 diffs)
- trunk/apps/pdfdiff/pdfdiff.in (modified) (4 diffs)
- trunk/apps/pdfdiff/Perl/Makefile.PL (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/apps/pdfdiff/ChangeLog
r72 r79 1 2008-04-28 Bradley M. Kuhn <bkuhn@ebb.org> 2 3 * configure.in: Added checks for pdiff, diff, and meld. 4 5 * pdfdiff.in: Added proper diff options. 6 1 7 2008-04-27 Bradley M. Kuhn <bkuhn@ebb.org> 2 8 trunk/apps/pdfdiff/configure.in
r68 r79 24 24 AM_INIT_AUTOMAKE(pdfdiff, 0.1) 25 25 26 # allow users to set a classpath, otherwise take it from the enivornment27 28 AC_ARG_WITH(classpath,[ --with-classpath Path to other Java classes], classpath=$withval, classpath=$CLASSPATH)29 30 26 # make sure we have the right version of perl 31 27 … … 35 31 AC_SUBST(PERL_VERSION_NEEDED) 36 32 33 37 34 PDFDIFF_AC_PROG_PERL($PERL_VERSION_NEEDED, AC_MSG_ERROR([*** Did you really expect to use perljvm without perl? ***]), ,AC_MSG_ERROR([*** perl >= $PERL_VERSION_NEEDED is not installed - perljvm will not function without it. ***])) 35 36 AC_PATH_PROG(PDIFF,pdiff) 37 AC_PATH_PROG(DIFF,diff) 38 AC_PATH_PROG(MELD,meld) 39 38 40 39 41 # Generate the Makefiles trunk/apps/pdfdiff/pdfdiff.in
r70 r79 31 31 use Pod::Usage; 32 32 use PDF::Extract::Text; 33 use File::Temp (); 34 35 my $DIFF_CMD = '@DIFF@'; 36 my $PDIFF_CMD = '@PDIFF@'; 37 my $MELD_CMD = '@MELD@'; 33 38 34 39 =head1 SYNOPSIS … … 56 61 57 62 --pdiff=PSFILE_OUTPUT Use "pdiff" to generate output to PSFILE_OUTPUT 58 --pdiff-options=OPTIONS Add OPTIONS to the pdiff command59 63 60 64 MELD … … 135 139 $PDF::OCR::Thorough::DEBUG = 1; 136 140 } 141 142 my($oldTextFile, $newTextFile, $oldFH, $newFH); 143 137 144 if ($saveTemplate) { 138 open(OLD_TEXT, ">${saveTemplate}-old.txt") or 139 pod2usage("$0: cannot open ${saveTemplate}-old.txt for writing: $!"); 140 open(NEW_TEXT, ">${saveTemplate}-new.txt") or 141 pod2usage("$0: cannot open ${saveTemplate}-new.txt for writing: $!"); 142 } 145 $oldTextFile = "${saveTemplate}-old.txt"; 146 $newTextFile = "${saveTemplate}-new.txt"; 147 $oldFH = new IO::File ">$oldTextFile" or 148 pod2usage("$0: cannot open $oldTextFile for writing: $!"); 149 $newFH = new IO::File ">$newTextFile" or 150 pod2usage("$0: cannot open $newTextFile for writing: $!"); 151 } else { 152 $oldFH = new File::Temp(TEMPLATE => 'oldXXXXXXXX', 153 UNLINK => 1, SUFFIX => '.txt', DIR => File::Spec->tmpdir); 154 $oldTextFile = "$oldFH"; 155 $newFH = new File::Temp(TEMPLATE => 'newXXXXXXXXX', 156 UNLINK => 1, SUFFIX => '.txt', DIR => File::Spec->tmpdir); 157 $newTextFile = "$newFH"; 158 } 159 143 160 my $oldExtract = new PDF::Extract::Text(pdfFile => $oldFile) 144 161 or die("cannot do PDF::OCR::Thorough on $oldFile"); … … 149 166 my $newText = $newExtract->getText(); 150 167 151 print "OLD: $oldText\n"; 152 print "NEW: $newText\n"; 168 print $oldFH $oldText; 169 print $newFH $newText; 170 171 $oldFH->close(); 172 $newFH->close(); 173 174 my(@commands); 175 176 if ($pdiffOutputFile) { 177 my $list = [ $PDIFF_CMD, "-o", $pdiffOutputFile ]; 178 push(@{$list}, $extraDiffOptions) if $extraDiffOptions; 179 push(@{$list}, $oldTextFile, $newTextFile); 180 push(@commands, $list); 181 } 182 if ($useMeld) { 183 my $list = [ $MELD_CMD ]; 184 push(@{$list}, $extraDiffOptions) if $extraDiffOptions; 185 push(@{$list}, $oldTextFile, $newTextFile); 186 push(@commands, $list); 187 } 188 189 unless ($pdiffOutputFile or $useMeld) { 190 my $list = [ ($diffCmd ? $diffCmd : $DIFF_CMD) ]; 191 push(@{$list}, $extraDiffOptions) if $extraDiffOptions; 192 push(@{$list}, $oldTextFile, $newTextFile); 193 push(@commands, $list); 194 } 195 foreach my $cmd (@commands) { 196 system(@{$cmd}); 197 } 198 $oldFH = $newFH = undef; 199 200 exit 0; trunk/apps/pdfdiff/Perl/Makefile.PL
r72 r79 29 29 'PDF::OCR' => '1.07', 30 30 'Text::Autoformat' => '1.14', 31 'Text::Aspell' => '0.04' 31 'Text::Aspell' => '0.04', 32 'File::Temp' => '0.00' 32 33 }, 33 34 MAKEFILE => "Makefile.perl-generated",