🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.postscript.programming
Article #1360

Putting intelligence into .ppd file

#1360
From: Martin Dulieu
Date: Fri, 25 Oct 2002 12:00
56 lines
3323 bytes
Is it possible to do what I'm trying? 

I have multiple Solaris systems. An application on a central machine needs the ability to spool prints to various different printers on remote systems. 

The mechanism is: 

1. All printing is routed via a print-spooling mechnism which prints to remotely hosted printers. Thus the only valid queue name for the application is "bwps". 

2. The user chooses the correct final destination printer at the unix level prior to firing up the application. The choice is stored in the users $HOME directory in a file named ".printers" which contains the following columns: 
a) Real printer queue name 
b) Spooler queue which services it 
c) Location of printer 
d) Long description of printer type. 
e) Short description of printer type. 

3. The application associates the default.ppd file with the bwps "queue" 

4. The default.ppd file contains the line: *Include: "datap462_a4.ppd". 

5. The datap462_a4.ppd file contains the correct settings for OCE printers, including the lines: 
* OpenUI *InputSlot: PickOne 
* OrderDependency: 20 AnySetup 
* InputSlot 
* DefaultInputSlot: Upper 
* InputSlot Upper: "0 statusdict /setpapertray get exec" 
* InputSlot Lower: "1 statusdict /setpapertray get exec" 
* ?InputSlot: " save 
 [ (Upper) (Lower) ] statusdict /papertray get exec 
 (get exec) stopped ( pop pop (Unknown)} if = flush 
restore 

6. This works properly for OCE printers, but if the eventual printer is an HP4100N (which only has one tray), the error message: 
ERROR: configurationerror 
OFFENDINGCOMMAND: setpapertray 

STACK: 

-dictionary 
- mark- 
1 

is produced (it's complaining that the postscript header tried to configure a second paper tray). 

7. If the line: 
* InputSlot Lower: "1 statusdict /setpapertray get exec" 
is removed, the application can print to the HP printers, but not the OCE printers. 

8. Ideally what is wanted (smallest change), is some form of filter within the datap462_a4.ppd file such that the second InputSlot line will only be read for OCE printers, and skipped if the printer is a HP. 

9. In other words, when building the postscript headers, code in the datap462_a4.ppd file needs to do the equivalent of the unix command: 

grep bwps $HOME/.printers | grep hplj | wc 

then if the count were 0, we execute the second line, otherwise we skip it. 

10. I have no knowledge of Postscript programming, and so can't write this myself, (or even be certain it is possible - can Postscript program read the user's .printers file?).
Technical Details
Message-ID: <1de6519c.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10c61a,ac1f37c059a41a02,start
X-Google-Attributes: gid10c61a,public
X-Google-ArrivalTime: 2002-10-25 05:20:08 PST
From: "Martin Dulieu" <allonnissos@ntlworld.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-08!supernews.com!newshosting.com!news-xfer1.atl.newshosting.com!news.stealth.net!news.stealth.net!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.postscript.programming
Subject: Putting intelligence into .ppd file
Message-ID: <1de6519c.-1@WebX.la2eafNXanI>
Date: Fri, 25 Oct 2002 05:00:35 -0700
Lines: 79
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit