From owner-ntemacs-users@cs.washington.edu  Thu Jul  3 10:06:27 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" " 3" "July" "1997" "10:27:33" "+0000" "Carl Zmola" "zmola@campbellsci.com" nil "55" "Re: Selecting Print Tray???" "^From:" nil nil "7" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id KAA25130 for <voelker@june.cs.washington.edu>; Thu, 3 Jul 1997 10:06:27 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id KAA19931 for <voelker@joker.cs.washington.edu>; Thu, 3 Jul 1997 10:06:25 -0700
Received: (majordom@localhost) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) id JAA21266 for ntemacs-users-outgoing; Thu, 3 Jul 1997 09:28:59 -0700 (PDT)
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id JAA21262 for <ntemacs-users@trout.cs.washington.edu>; Thu, 3 Jul 1997 09:28:57 -0700 (PDT)
Received: from mailman.campbellsci.com ([207.201.118.3]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with ESMTP id JAA22170 for <ntemacs-users@cs.washington.edu>; Thu, 3 Jul 1997 09:28:55 -0700
Message-Id: <199707031628.JAA22170@june.cs.washington.edu>
Received: from carl_zmola (GADIANTON.campbellsci.com [207.201.118.5])           by mailman.campbellsci.com (Netscape Mail Server v2.0) with SMTP           id AAA236; Thu, 3 Jul 1997 10:27:29 -0600
Comments: Authenticated sender is <carl#207.201.118.3@[192.168.2.19]>
MIME-Version: 1.0
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: 7BIT
Reply-to: zmola@campbellsci.com
In-reply-to: <3.0.1.32.19970702130500.0059c008@btc.adaptec.com>
X-mailer: Pegasus Mail for Win32 (v2.52)
Precedence: bulk
From: "Carl Zmola" <zmola@campbellsci.com>
Sender: owner-ntemacs-users@cs.washington.edu
To: ntemacs-users@cs.washington.edu, Anders_Knudsen@btc.adaptec.com
Subject: Re: Selecting Print Tray???
Date: Thu, 3 Jul 1997 10:27:33 +0000


> From:          Anders Knudsen <Anders_Knudsen@btc.adaptec.com>
> I am using ntemacs with the print-nt.el lisp package, and am printing to an
> HP5Si PostScript laser printer. Does anyone know how to get emacs/modify
> print-nt to select a tray to print from. Everytime I print to it, the
> printer always prints to Tray 3, 11x17...regardless of the fact that I have
> letter size selected as the ps page size.

OK I've hacked my ps-print.el to print to the lower-tray on a 4mx.  
and duplex.  This requires some postscript cut and paste.

1) use windows to print a blank document to your postscript printer 
driver, but print it to a file.  

Do this twice, selecting two different print  trays.

2) diff the two files to see what has changed. 

3) in ps-print.el modify  ps-print-prolog to include the correct 
code.

(Hint.  I put the new ps-print.el in my local loadpath so when I 
reinstall emacs, I won't install over my changes.)


Partial example 

 (defvar ps-print-prologue "
% Carl's addition for CSI clz
%%BeginSetup
a%%BeginFeature: *Duplex DuplexNoTumble

    1 dict dup /Duplex true put setpagedevice
    1 dict dup /Tumble false put setpagedevice
%%EndFeature
%%BeginFeature: *InputSlot Lower

    1 dict
    dup /Policies 2 dict dup /PageSize 2 put dup /MediaType 0 put put
  setpagedevice
  1 dict
    dup /MediaType (LOWER CASSETTE) put
    setpagedevice
%%EndFeature
%%BeginFeature: *PageRegion Letter
%%EndSetup


----------------
more stuff was here, but I'll let you play with it.

Carl

Carl 
zmola@campbellsci.com

From owner-ntemacs-users@cs.washington.edu  Thu Jul  3 15:44:52 1997
X-VM-v5-Data: ([nil nil nil nil nil nil nil nil nil]
	[nil "Thu" " 3" "July" "1997" "16:15:12" "-0600" "Anders Knudsen" "Anders_Knudsen@btc.adaptec.com" nil "69" "Re: Selecting Print Tray...got it!" "^From:" nil nil "7" nil nil nil nil]
	nil)
Received: from joker.cs.washington.edu (joker.cs.washington.edu [128.95.1.42]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id PAA22057 for <voelker@june.cs.washington.edu>; Thu, 3 Jul 1997 15:44:52 -0700
Received: from trout.cs.washington.edu (trout.cs.washington.edu [128.95.1.178]) by joker.cs.washington.edu (8.6.12/7.2ws+) with ESMTP id PAA34564 for <voelker@joker.cs.washington.edu>; Thu, 3 Jul 1997 15:44:50 -0700
Received: (majordom@localhost) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) id PAA24047 for ntemacs-users-outgoing; Thu, 3 Jul 1997 15:15:24 -0700 (PDT)
Received: from june.cs.washington.edu (june.cs.washington.edu [128.95.1.4]) by trout.cs.washington.edu (8.8.5+CS/7.2ws+) with ESMTP id PAA24043 for <ntemacs-users@trout.cs.washington.edu>; Thu, 3 Jul 1997 15:15:20 -0700 (PDT)
Received: from adaptec.com (magic.adaptec.com [162.62.21.8]) by june.cs.washington.edu (8.8.5+CS/7.2ju) with SMTP id PAA19585 for <ntemacs-users@cs.washington.edu>; Thu, 3 Jul 1997 15:15:17 -0700
Received: from kingdom.adaptec.com by adaptec.com (SMI-8.6/SMI-SVR4) 	id PAA11977; Thu, 3 Jul 1997 15:15:16 -0700
Received: from btc.btc.adaptec.com by kingdom.adaptec.com (SMI-8.6/SMI-SVR4) 	id PAA10855; Thu, 3 Jul 1997 15:15:16 -0700
Received: from alderaan (alderaan.btc.adaptec.com [162.62.63.46]) by btc.btc.adaptec.com (8.6.9/8.6.9) with SMTP id QAA20747 for <ntemacs-users@cs.washington.edu>; Thu, 3 Jul 1997 16:15:15 -0600
Message-Id: <3.0.1.32.19970703161512.00594000@btc.adaptec.com>
X-Sender: andersk@btc.adaptec.com
X-Mailer: Windows Eudora Pro Version 3.0.1 (32)
In-Reply-To: <199707031628.JAA22170@june.cs.washington.edu>
References: <3.0.1.32.19970702130500.0059c008@btc.adaptec.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Precedence: bulk
From: Anders Knudsen <Anders_Knudsen@btc.adaptec.com>
Sender: owner-ntemacs-users@cs.washington.edu
To: ntemacs-users@cs.washington.edu
Subject: Re: Selecting Print Tray...got it!
Date: Thu, 03 Jul 1997 16:15:12 -0600

First, thanks to all for the input. I have now successfully printed to the
correct tray!! Carl's tip was especially helpful. Here is my implementation
as of now...I plan on improving this, as time permits. For some reason, my
employer does not pay me to modify lisp routines ;-)

Modification work with HP5Si M PostScript, duplex capable printer.
First my .emacs file:
(setq lpr-command "print")
(setq lpr-destination '("/D:\\\\alderaan\\PTS_HP5")) ;; for normal printer
(setq ps-lpr-destination '("/D:\\\\alderaan\\PTS_HP5")) ;; for postscript
printer
;Printer queue in NT Print Manager ^^^^^^^^^^^^^^^^^^^
(setq ps-paper-type 'ps-letter) ; the type of paper (if needed)
(require  'print-nt)

Here are the mods I made to "ps-print.el"

- find ps-spool-duplex and enable it

  (defvar ps-spool-duplex t		; Not many people have duplex
					; printers, so default to nil.

- find ps-adobe-tag and change to:
  (defvar ps-adobe-tag "%!PS-Adobe-3.0\n"

- find (ps-output "%%EndPrologue\n")) and change to:
  (ps-output "%%EndProlog\n")

- add this line right after (ps-output "%%EndProlog\n")
  (ps-output ps-beginsetup))

- find the line that contains ";; Start Editing Here:"
  and add the following after it.

(defvar ps-beginsetup "%%BeginSetup
mark {
%%BeginFeature: *Resolution 600
 << /HWResolution [600 600]>>  setpagedevice
%%EndFeature
} stopped cleartomark
mark {
%%BeginFeature: *InputSlot Tray3Tp/Tray 3 to Top
    <</DeferredMediaSelection true /MediaPosition 1 /OutputType (TOP OUTPUT
BIN)>> setpagedevice
%%EndFeature
} stopped cleartomark
mark {
%%BeginFeature: *PageRegion Letter
	<</DeferredMediaSelection true /PageSize [612 792] /ImagingBBox null>>
setpagedevice
%%EndFeature
} stopped cleartomark
mark {
%%BeginFeature: *Duplex DuplexNoTumble
	<</Duplex true /Tumble false>> setpagedevice
%%EndFeature
} stopped cleartomark
%%EndSetup")

- the lisp function ps-beginsetup forces letter size paper and scans the trays
  starting at 3, working its way up. Duplex mode is turned on.

To make this more easily customizable (i.e., not having to change and
re-byte compile each time), I would like to make the page size and duplex
mode selectable.

Anyway, it works for me for now!
Thanks again,
-Anders.

