$! This command file is run by PSPRINT/DEV=LINO with the following parameters: $! P1 = complete file specification $! P2 = file format (DVI or PS or TEXT or TWO or WIDE) $! P3 = options for PSDVI $! P4 = options for PRINT $! P5 = /NOTE value ("" if not used) $! P6 = /COPIES value (1 if not used) $! P7 = /OUTPUT value ("" if not used) $! P8 = "bbbbbsss" where b = Y or N and represents the status of the $! boolean qualifiers /DELETE, /LANDSCAPE, /CUTMARKS, /LOWRES, /BANNER $! and sss = /SIZE value (one of those defined in PSPRINT.CLD) $! and is the /PREP value, possibly empty $ $ on control_y then exit $ set symbol/scope=(nolocal,noglobal) ! avoid symbol collision $ $! Don't allow text files to be printed on Linotronic: $ if (p2 .eqs. "DVI") .or. (p2 .eqs. "PS") then goto CONT0 $ write sys$output "Linotronic should not be used to print text files." $ exit $ $ CONT0: $ delflag = f$extract(0,1,p8) ! Y or N $ landflag = f$extract(1,1,p8) ! Y or N $ cutflag = f$extract(2,1,p8) ! Y or N $ lowflag = f$extract(3,1,p8) ! Y or N $ bannerflag = f$extract(4,1,p8) ! Y or N $ size = f$extract(5,3,p8) ! /SIZE value $ prepfile = f$extract(8,999,p8) ! /PREP value $ pagesetup = "" $ if size .eqs. "A3L" then pagesetup = "A3Lsetup" ! defined in lino_header.ps $ if size .eqs. "A4P" then pagesetup = "A4Psetup" ! ditto $ if size .eqs. "A4L" then pagesetup = "A4Lsetup" ! ditto $ if size .eqs. "A5P" then pagesetup = "A5Psetup" ! ditto $ if size .eqs. "A5L" then pagesetup = "A5Lsetup" ! ditto $ if size .eqs. "B5P" then pagesetup = "B5Psetup" ! ditto $ if size .eqs. "B5L" then pagesetup = "B5Lsetup" ! ditto $ if pagesetup .nes. "" then goto CONT1 $! CLD file should prevent us ever getting here: $ write sys$output "Unknown /SIZE value: " + size $ exit $ $ CONT1: $ if (p6 .gt. 0) .and. (p6 .lt. 101) then goto CONT2 $ write sys$output "Bad /COPIES value. Specify 1 to 100." $ exit $ $ CONT2: $ copies = f$string(p6) $ job = f$parse(p1,,,"NAME") $ $ copy tex_ps:empty.ps sys$scratch:'job'.tmp $ tmpfile = f$search("sys$scratch:''job'.tmp") $ write sys$output - "Creating SYS$SCRATCH:''job'.TMP" + f$parse(tmpfile,,,"VERSION") $ open/append tmp 'tmpfile' $ write tmp "/@USER (" + f$getjpi(0,"USERNAME") - + " " + f$trnlnm("SYS$NODE") + p1 + ") def" $ write tmp "/@DATE (" + f$time() + ") def" $ write tmp "/@NOTE (" + p5 + ") def" $ close tmp $ append tex_ps:lino_header.ps 'tmpfile' ! uses above definitions $ $ open/append tmp 'tmpfile' $ write tmp "/dev (LINO) def" $ res = "1270" $ if lowflag .eqs. "Y" then res = "635" ! res also used below $ write tmp "/res " + res + " def" $ write tmp "/fspec (" + p1 + ") def" $ if landflag .eqs. "Y" then write tmp "/land true def" $ if landflag .eqs. "N" then write tmp "/land false def" $ if bannerflag .eqs. "N" then write tmp "/@bannerpage { } def" $ if bannerflag .eqs. "N" then write tmp "/@footerpage { } def" $ write tmp "@bannerpage" $ write tmp "/@oldpagecount statusdict begin pagecount end def" $ write tmp "/#copies " + copies + " def" ! set # of copies $ write tmp pagesetup ! call page setup procedure $ if cutflag .eqs. "N" then - write tmp "/@cutmarks { } def" ! override default $ close tmp $ $ if p2 .eqs. "DVI" then append tex_ps:tex.ps, tex_ps:lino_fonts.ps 'tmpfile' $ if p2 .eqs. "PS" then append tex_ps:ps.ps 'tmpfile' $ $ if prepfile .eqs. "" then goto SKIPPREP $ write sys$output "Including " + prepfile $ append 'prepfile' 'tmpfile' $ SKIPPREP: $ $ global = f$search("global.ps") $ if (global .eqs. "") .or. (p2 .nes. "DVI") then goto SKIPGLOBAL $ write sys$output "Including GLOBAL.PS" $ append 'global' 'tmpfile' $ SKIPGLOBAL: $ $ if p2 .nes. "DVI" then goto PRINT ! skip DVI processing $ $ ver = 1 $ LOOP: $ psdvifile = "sys$scratch:psdvi.tmp;''f$string(ver)'" $ if f$search(psdvifile) .eqs. "" then goto ENDLOOP $ ver = ver + 1 $ goto LOOP $ $ ENDLOOP: $ if size .eqs. "A3L" then land = "/x=297mm/y=420mm" $ if size .eqs. "A4P" then land = "/x=210mm/y=297mm" $ if size .eqs. "A4L" then land = "/x=210mm/y=297mm" $ if size .eqs. "A5P" then land = "/x=148mm/y=210mm" $ if size .eqs. "A5L" then land = "/x=148mm/y=210mm" $ if size .eqs. "B5P" then land = "/x=176mm/y=250mm" $ if size .eqs. "B5L" then land = "/x=176mm/y=250mm" $! offset: 012345678901 $! If /LANDSCAPE given then we have to swap /xsize and /ysize values. $! Following stmt assumes /x value starts at offset 3 and /y value at offset 11. $ if landflag .eqs. "Y" then - land = "/x=" + f$extract(11,5,land) + "/y=" + f$extract(3,5,land) $ on warning then goto BADDVI $ PSDVI 'p1' 'land' /HEADER='tmpfile' - /OUTPUT='psdvifile' - /RES='res' - /FONT=disk$utils:[utilities.tex.'res'pk] - /DUMMY=cmr10.'res'pk - /CONSERVE - /NOREVERSE 'p3' $ delete/nolog 'tmpfile' $ rename/nolog 'psdvifile' 'tmpfile' $ goto PRINT $ $ BADDVI: $ delete/nolog 'tmpfile' $ if f$search(psdvifile) .nes. "" then delete/nolog 'psdvifile' $ write sys$output "" $ write sys$output "Printing aborted due to error(s). Temporary file deleted." $ exit $ $ PRINT: $ on error then exit $ if p2 .eqs. "PS" then append 'p1' 'tmpfile' $ ctrld = "tex_ps:ctrld.dat" $ if p7 .nes. "" then ctrld = "tex_ps:empty.ps" $ append tex_ps:lino_trailer.ps, 'ctrld' 'tmpfile' $ $ if p7 .eqs. "" then goto PRINTJOB $ copy tex_ps:empty.ps, 'tmpfile' 'p7' $ delete/log 'tmpfile' $ write sys$output "" $ write sys$output "Nothing printed. PostScript saved in " + p7 $ exit $ $ PRINTJOB: $ print/queue=LINOTRONICS/form=postscript/name='job' 'tmpfile'/delete 'p4' $ if delflag .eqs. "Y" then delete/log 'p1'