Add ppt2eps tool set.
4 use Digest::MD5 qw(md5_hex);
5 my $f_remove_unused_eps = 0;
8 die 'wrong number of argument';
10 my $prnfile = $ARGV[0];
12 my $basename = $prnfile; $basename =~ s/\.prn$//;
13 my $dirname = $prnfile; $dirname =~ s![^/]*$!!;
14 my $notedumpfile = $basename . '.note.txt';
15 my $md5file = $basename . '.md5';
21 open(MD5, $md5file) or die;
23 if (/^([01-9a-f]+)\s+([-_01-9a-zA-Z]+)/) {
31 open(NOTES, $notedumpfile) or die;
36 if (/\@file=([-_01-9a-zA-Z]+)/) {
39 my $pngfile = $basename . '.ppt.tmp_slide' . $page . '.png';
42 $md5 = md5_hex(`cat $pngfile`);
43 $curr_md5{$md5} = $epsbase;
44 } else { # can't happen
45 die "no png file: $pngfile";
48 if (exists $prev_md5{$md5}) {
49 if ($prev_md5{$md5} eq $epsbase) {
51 delete $prev_md5{$md5};
53 system("mv $dirname$prev_md5{$md5}.eps $dirname$epsbase.eps");
54 delete $prev_md5{$md5};
57 system("psselect $page $prnfile > $dirname$epsbase.ps");
58 system("ps2eps -R + -B -f $dirname$epsbase.ps");
59 system("ps2eps -C $dirname$epsbase.eps");
60 system("mv $dirname$epsbase.eps.eps $dirname$epsbase.eps");
61 system("rm $dirname$epsbase.ps");
67 if ($f_remove_unused_eps) {
71 open(MD5, '>', $md5file) or die;
72 foreach my $m (keys %curr_md5) {
73 print MD5 $m . "\t" . $curr_md5{$m} . "\r\n";
76 system("rm " . $basename . '.ppt.tmp_slide*.png');