updated on Mon Jan 23 12:00:23 UTC 2012
[aur-mirror.git] / lm1100 / gs-lm1100-0.1
blob7c4ae5ad35ba87d951db531b68dd091d30af2621
1 driver "gs-lm1100" {
2    
3         help "Supports the Lekmark 1000 and 1100"
5         requires "gs"
6         requires "lm1100" # Because GDI printer
7         requires "a2ps"
8         requires "convert" # For images
10         verify_exec {
11                 (gs -h |grep -q ppmraw) || 
12                 (echo "Ghostscript driver ppmraw is required"; exit 1)
13         }
15         option {
16           var = "CARTRIDGE"
17                 desc = "Type of Cartridge"
18         default_choice "bw"
20                 choice "bw"{
21                 value =bw
22                         help = "13400HC black cartridge."
23                         desc = "13400HC"
24                 }
25                 choice "c"{
26                         value =c
27                         help = "13619HC color cartridge."
28                         desc = "13619HC"
29                 }
30         }
32         option {
33                 desc = "Resolution"
34                 var = res
35                 default_choice "300x300"
37                 choice "300x300" {
38                         value = 300x300
39                         desc = "300x300"
40                         help = "Print at 300x300 dpi"
41                 }
42         }
44   argument {
45           var = "br"
46                 desc = "Brightness"
47                 def_value "100"
48                 help = "Minimum value: 0, Maximum value: 255 (less = darker)"
49         }
51         option {
52                 var = ps
53                 desc = "Paper size"
54                 default_choice "a4"
56                 choice "a4" {
57                         value = a4
58                         desc = "A4"
59                         help = "A4"
60                 }
61                 choice "letter" {
62                         value = letter
63                         desc = "Letter"
64                         help = "Letter"
65                 }
66         }
67         option {
68                 var = fs
69                 desc = "Foto size"
70                 default_choice "9x12"
72                 choice "9x12" {
73                         value = 1062x1416
74                         desc = "9x12"
75                         help = "9x12 sm"
76                 }
77                 choice "3x4" {
78                         value = 354x472
79                         desc = "3x4"
80                         help = "3x4 sm"
81                 }
82         }
83         option {
84                 var = po
85                 desc = "Paper orientation"
86                 default_choice "R"
88                 choice "R" {
89                         value = R
90                         desc = "Portrait"
91                         help = "Portrait"
92                 }
93                 choice "r" {
94                         value = r
95                         desc = "Landscape"
96                         help = "Landscape"
97                 }
98         }
99         option {
100                 var = pps
101                 desc = "Papers per sheet (for ASCII files only)"
102                 default_choice "1"
104                 choice "1" {
105                         value = 1
106                         desc = "One page"
107                         help = "One page"
108                 }
109                 choice "2" {
110                         value = 2
111                         desc = "Two pages, landscape"
112                         help = "Two pages, landscape"
113                 }
114                 choice "4" {
115                         value = 4
116                         desc = "Four pages"
117                         help = "Four pages"
118                 }
119         }
121         language_driver postscript {
122                 filetype_regx = "postscript"
123         }
125         language_driver image {
126                 convert_exec = {
127                         convert $INPUT -resize ${fs} ppm:$OUTPUT
128                         touch $OUTPUT.nogs
129                 }
130         }
132         language_driver text {
133                 convert_exec = {
134                         a2ps\
135                                 --medium=${ps}\
136                                 -${pps}\
137                                 -${po}\
138                                 -qo ${OUTPUT}\
139                                 ${INPUT}
140                 }
141         }
143         filter_exec {
144                 if [ "$CARTRIDGE" == "bw" ]; then
145                         CARTRIDGE="-bw"
146                 else
147                         CARTRIDGE=
148                 fi
149                 
150                 if [ -f $INPUT.nogs ]; then
151                         lm1100 $CARTRIDGE -b ${br} -p ${ps} $INPUT > ${OUTPUT}
152                 else
153                         gs -q\
154                                 -sDEVICE=ppmraw\
155                                 -r${res}\
156                                 -sPAPERSIZE=${ps}\
157                                 -dNOPAUSE\
158                                 -dSAFER\
159                                 -dBATCH\
160                                 -sOutputFile=-\
161                                 ${INPUT}\
162                         |lm1100 ${CARTRIDGE} -b ${br} -p ${ps} - > ${OUTPUT}
163     fi
164         }