home *** CD-ROM | disk | FTP | other *** search
/ Mega Top 1 / os2_top1.zip / os2_top1 / APPS / TEKST / PSUTILS / FIXFMPS.PL < prev    next >
Perl Script  |  1993-10-27  |  431b  |  20 lines

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