Changeset 2977 for trunk/gsdl
- Timestamp:
- 2002-02-20T16:30:17+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/bin/script/gsConvert.pl
r2755 r2977 60 60 print STDERR " or text using third-party programs.\n\n"; 61 61 print STDERR " usage: $0 [options] filename\n"; 62 print STDERR " options:\n\t-type\tdoc|pdf|ps| rtf\t(input file type)\n";62 print STDERR " options:\n\t-type\tdoc|pdf|ps|ppt|rtf\t(input file type)\n"; 63 63 print STDERR "\t-errlog\t<filename>\t(append err messages)\n"; 64 64 print STDERR "\t-output\thtml|text\n"; … … 77 77 # read command-line arguments 78 78 if (!parsargv::parse(\@ARGV, 79 'type/(doc|pdf|ps| rtf)/', \$input_type,79 'type/(doc|pdf|ps|ppt|rtf)/', \$input_type, 80 80 '/errlog/.*/', \$faillogfile, 81 81 'output/(html|text)/', \$output_type, … … 132 132 print "\n"; 133 133 } 134 elsif ($input_type eq "ppt") { 135 print &convertPPT($input_filename, $output_filestem, $output_type); 136 print "\n"; 137 } 134 138 else { 135 139 print STDERR "Error: Unable to convert type '$input_type'\n"; … … 286 290 287 291 } 292 293 294 sub convertPPT { 295 my ($input_filename, $output_filestem, $output_type) = @_; 296 297 my $success = 0; 298 299 # Attempt conversion to HTML 300 if (!$output_type || ($output_type =~ /html/i)) { 301 # formulate the command 302 $cmd = ""; 303 $cmd .= "perl -S ppttohtml.pl "; 304 $cmd .= " \"$input_filename\" \"$output_filestem.html\""; 305 $cmd .= " 2>\"$output_filestem.err\"" 306 if ($ENV{'GSDLOS'} !~ /^windows$/i || $is_winnt_2000); 307 308 309 # execute the command 310 $!=0; 311 if (system($cmd)!=0) 312 { 313 print STDERR "Powerpoint converter failed $!\n"; 314 } else { 315 return "html"; 316 } 317 } 318 319 $success = &any_to_text($input_filename, $output_filestem); 320 if ($success) { 321 return "text"; 322 } 323 324 return "fail"; 325 } 326 327 328 288 329 289 330
Note:
See TracChangeset
for help on using the changeset viewer.