aboutsummaryrefslogtreecommitdiff
path: root/lp/process/post
blob: 63bf036b46637b3ba11692468274d3f7f5d4623c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/local/plan9/bin/rc
if (! ~ $DEBUG '') flag x +
PATCH='%!PS
%%Patch from lp'
switch ($LPCLASS) {
case *hp4simx*;
	PATCH=$PATCH'
%% set the default papertray to be the lower tray for HP4siMX printers
	statusdict begin defaultpapertray end 1 ne {
		statusdict begin
			1 setdefaultpapertray
		end
	} if'
}
for (i in `{echo $IBIN|awk -F, '{ n=split($0, a, ","); for (i=1;i<=n;i++) print a[i]; }'}) {
	switch ($i) {
	case -P*;
	case man manual manualfeed;
		PATCH=$PATCH'
%%BeginFeature: *Select ManualFeed
[{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
    << /ManualFeed true >> setpagedevice
   } {statusdict begin /manualfeed true def end} ifelse
 } stopped cleartomark
%%EndFeature'
	case simplex;
		DUPLEX=0
	case [0-9];
		PATCH=$PATCH'
%%BeginFeature: *Select InputTray
[{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
	<< '$i' << /MediaType (tray'$i') >> >>
    << /MediaType (tray'$i') >> setpagedevice
   } {statusdict begin '$i' setpapertray end} ifelse
 } stopped cleartomark
%%EndFeature'
	case 11x17 [Ll]edger;
		PATCH=$PATCH'
%%BeginFeature: *Select Ledger
[{ systemdict /languagelevel known {languagelevel 1 gt product (HP LaserJet 4Si) ne and} if {
    << /PageSize [792 1224] >> setpagedevice
   } {statusdict begin '$i'tray end} ifelse
 } stopped cleartomark
%%EndFeature'
	case transparency vg viewgraph;
		PATCH=$PATCH'
%%BeginFeature: *Select Transparency
[{ << /MediaType (Transparency) >> setpagedevice
 } stopped cleartomark
%%EndFeature'
	case *;
		echo illegal option ''''-i $i'''' ignored >[1=2]
	}
}
#if (! ~ $#DUPLEX 0) {
#	if (~ $DUPLEX 1 )
#		PATCH=$PATCH'
#statusdict /setduplexmode known {statusdict begin true setduplexmode end} if';
#	if (~ $DUPLEX 0 )
#		PATCH=$PATCH'
#statusdict /setduplexmode known {statusdict begin false setduplexmode end} if';
#}
PATCH=$PATCH'
%%EndPatch from lp
'

{ echo $PATCH; psextract } | $LPLIB/process/hpost