/* ** StartDVIprint.sd ** ** This is a small hack to run DVIprint from ShowDVI. ** ** NOTES: You must have set the printer name in ENV:DVIprint for this to ** work, or the default (generic) printer will be used. ** ** 'TeX:bin/DVIprint' is used to find DVIprint. Otherwise it would ** have to be in your RexxMast path... */ LF = '0A'X Address COMMAND 'version >nil: exec.library 36' If RC ~= 0 Then CONWINDOW = "CON:20/30/430/100/DVIprint--Output" Else CONWINDOW = "CON:20/30/430/100/DVIprint--Output/AUTO/CLOSE/WAIT/SCREENShowDVI-PubScr" Options Results GetFile LOADEDFILE = RESULT GetDir LOADEDDIR = RESULT GetPage PAGE = RESULT If Right(LOADEDDIR,1)~='/' & Right(LOADEDDIR,1)~=':' Then LOADEDDIR = LOADEDDIR||'/' If Upper(Right(LOADEDFILE,4)) ~= ".DVI" Then LOADEDFILE = LOADEDFILE||".dvi" If LOADEDFILE = "" | ~Exists(LOADEDDIR||LOADEDFILE) Then Do Message "Which file should I print?" Exit End If Show('Port','dviprint') Then Do Message "DVIprint is already running, please wait" Exit End /* ** HES: It would be nice to know how many pages the document has... */ Okay2 "Print all pages with the predefined draft-modus?" If RESULT ~= 1 Then Do GetNumber PAGE "Print from page?" If 0 = RC Then FROM = RESULT Else Do Message "Print cancelled!" Exit 0 End GetNumber PAGE "Print upto page?" If 0 = RC Then TO = RESULT Else Do Message "Print cancelled!" Exit 0 End Okay2 "Should I print in draft mode?" If RESULT = 1 Then DRAFT = "on" Else DRAFT = "off" STR = "Should I start the print"||LF||" of file '"LOADEDFILE"'"LF||" from page "FROM" to page "TO||LF If DRAFT = "on" Then STR = STR||" in draft mode?" Else STR = STR||" in HQ mode?" Okay2 STR If RESULT = 0 Then Do Message "Print cancelled!" Exit 0 End Message "calling DVIprint." Address COMMAND 'TeX:bin/DVIprint' ">"CONWINDOW" from "FROM" to "TO" draft "DRAFT LOADEDDIR||LOADEDFILE If 0 ~= RC Then Message "DVIprint failed." End; Else Do Message "calling DVIprint." Address COMMAND 'TeX:bin/DVIprint' ">"CONWINDOW " " LOADEDDIR||LOADEDFILE If 0 ~= RC Then Message "DVIprint failed." End Exit