home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / PSUTILS / FIXFMPS.CMD < prev    next >
OS/2 REXX Batch file  |  1994-01-14  |  467b  |  21 lines

  1. extproc perl -Sx 
  2. #!perl
  3. # fixfmps: get conforming PostScript out of FrameMaker version 2 file
  4. # move all FMDEFINEFONTs to start of pages
  5.  
  6. # feed this into perl
  7. eval 'exec perl -S $0 "$@"'
  8.    if $running_under_some_shell;
  9.  
  10. %fonts=();
  11.  
  12. while (<>) {
  13.    if (/^([0-9]+) [0-9]+ .* FMDEFINEFONT$/) {
  14.       $fonts{$1} = $_;
  15.    } elsif (/^[0-9.]+ [0-9.]+ [0-9]+ FMBEGINPAGE$/) {
  16.       print $_, join('',values(%fonts));
  17.    } else {
  18.       print $_;
  19.    }
  20. }
  21.