From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 12-APR-1991 05:04:50.99
To:	ARISIA::EVERHART
CC:	
Subj:	PostScript debugging tool

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.97)
	 id AA20919; Fri, 12 Apr 91 04:45:28 EDT
Received: From SOL1.GPS.CALTECH.EDU by CRVAX.SRI.COM with TCP; Thu, 11 APR 91 23:41:16 PST
Received: by SOL1.GPS.CALTECH.EDU (MX V2.2) id 14306; Thu, 11 Apr 1991 22:39:49
          PDT
Date: Thu, 11 Apr 1991 22:39:49 PDT
From: Carl J Lydick <carl@SOL1.GPS.CALTECH.EDU>
To: info-vax@SRI.COM
Message-Id: <00946fd6.9140bac0.14306@SOL1.GPS.CALTECH.EDU>
Subject: PostScript debugging tool

From time to time, somebody writes to info-vax asking about problems they're
having with a PostScript file.  The following is a short, simple (and,
unfortunately, slow) DCL procedure to aid in debugging problem files, if your
PostScript printer is attached to a terminal port.  It copies the file to the
printer one record at a time, then reads any response the printer might make. 
All traffic to/from the printer is logged to SYS$OUTPUT, with a "<" at the
beginning of the line denoting incoming traffic, and a ">" denoting outgoing.

$	IF P1 .EQS. "" THEN -
$		READ/PROMPT="INPUT FILE: " SYS$COMMAND P1
$	IF P2 .EQS. "" THEN -
$		READ/PROMPT="PRINTER PORT: " SYS$COMMAND P2
$	ALLOCATE 'P2'
$	SET TERMINAL/TYPE 'P2'
$	OPEN/READ/WRITE PRINTER 'P2'
$	OPEN/READ INPUT 'P1'
$ LOOP:	CALL CHCK
$	READ/END=DONE INPUT REC
$	WRITE PRINTER REC
$	WRITE SYS$OUTPUT ">", REC
$	GOTO LOOP
$ DONE:	CTLD[0,8] = 4
$	WRITE PRINTER CTLD
$	CLOSE INPUT
$	CALL CHCK
$	CLOSE PRINTER
$	DEALLOCATE 'P2'
$	EXIT 1
$ CHCK:	SUBROUTINE
$	READ/TIME=1/ERR=NONE/PROMPT="" PRINTER REC
$ LOOP:	WRITE SYS$OUTPUT "<",REC
$	READ/TIME=0/ERR=NONE/PROMPT="" PRINTER REC
$	GOTO LOOP
$ NONE:	RETURN

