#!/bin/sh # fixFM mackay Thu Mar 22 12:46:25 PST 1990 # mackay Mon Mar 11 13:54:22 PST 1991 # # fixes the PostScript language files that are produced from Frame Maker 2.0 # on the Sun workstations so that they are page independent. # This is DEFINITELY NOT a general purpose program to fix any other kind # of file. # # The script now tosses in the DSC comment at the beginning of the file # since NextStep 2.0 Previewer will automatically "give up" on anything that # doesn't have that comment. (In version 1.0, it would try even if the # document didn't claim any comformance, and generate an error if it had # problems with the file.) # # Takes as input, 2 filenames; The first filename is the file that # contains the direct output from Frame Maker 2.0. The second filename # is where the resulting page independent file will be written to. # # proper usage: fixFM BadFM.ps GoodFM.ps i=1 awk ' BEGIN {insert=1} $1 == "%%BeginDocument:" {insert=0} $1 == "%%EndDocument" {insert=1} { if ($4 == "FMDEFINEFONT") line[i++]=$0 else if (($1 == "%%Page:" ) && (insert==1)) { print $0 print "%%BeginPageSetup" for (j=0; j $2