/src/ghostpdl/contrib/pcl3/src/pclcap.c
Line | Count | Source (jump to first uncovered line) |
1 | | /****************************************************************************** |
2 | | File: $Id: pclcap.c,v 1.17 2001/03/08 09:17:51 Martin Rel $ |
3 | | Contents: Description of PCL printer capabilities and supporting functionality |
4 | | Author: Martin Lottermoser, Greifswaldstrasse 28, 38124 Braunschweig, |
5 | | Germany. E-mail: Martin.Lottermoser@t-online.de. |
6 | | |
7 | | ******************************************************************************* |
8 | | * * |
9 | | * Copyright (C) 2000, 2001 by Martin Lottermoser * |
10 | | * All rights reserved * |
11 | | * * |
12 | | ******************************************************************************/ |
13 | | |
14 | | /*****************************************************************************/ |
15 | | |
16 | | #ifndef _XOPEN_SOURCE |
17 | | #define _XOPEN_SOURCE 500 |
18 | | #endif |
19 | | |
20 | | /* Standard headers */ |
21 | | #include "std.h" |
22 | | #include <assert.h> |
23 | | #include <string.h> /* for memset() */ |
24 | | #include <stdlib.h> |
25 | | |
26 | | /* Special headers */ |
27 | | #include "pclcap.h" |
28 | | #include "pclsize.h" |
29 | | |
30 | | /*****************************************************************************/ |
31 | | |
32 | | /* Number of elements in an array */ |
33 | | #define array_size(a) (sizeof(a)/sizeof(a[0])) |
34 | | |
35 | | /* Distance in terms of pixels at 300 ppi */ |
36 | | #define BP_PER_DOT (BP_PER_IN/300) |
37 | | |
38 | | /*****************************************************************************/ |
39 | | |
40 | | /* |
41 | | Lists of media dimensions supported by each model and the (monochrome raster |
42 | | mode) margins in force for them. Read the comments on 'pcl_PageSize' in |
43 | | pclgen.h before reading further. |
44 | | |
45 | | These data have been obtained from various sources. A number of |
46 | | inconsistencies and omissions, partially within a single source, indicate |
47 | | that this information is not entirely reliable. If you find more reliable |
48 | | information than the one used here or you discover an entry to be definitely |
49 | | wrong by doing a test on the printer in question, send me a message. |
50 | | |
51 | | The PCL documentation (TRG500, DJ3/4, DJ6/8 and DJ1120C) should be the most |
52 | | reliable and I have usually given it priority. Besides this I have used HP |
53 | | support documents (e.g., "HP DeskJet 660C Printer - Printable Regions", |
54 | | BPD02519), user manuals for individual printers, a support document covering |
55 | | a range of printers ("HP DeskJet and DeskWriter Printers - Printable |
56 | | Areas/Minimum Margins", BPD05054), and the "Software Developer's Guide for HP |
57 | | DeskJet Printer Drivers", May 1996 (called "DG" in what follows). |
58 | | |
59 | | The DG seems the least reliable. Apart from several internal inconsistencies |
60 | | (conversion between units), some strange data (unexplicably large top margins) |
61 | | and frequent deviations from the documentation for the series-500 Deskjets |
62 | | (TRG500), I also suspect that some of the sizes listed are not supported by |
63 | | the printer at the PCL level but are handled in the driver, i.e., the driver |
64 | | uses a PCL Page Size code other than the one belonging to the size requested. |
65 | | In addition, HP distinguishes at least between margins when printing from DOS |
66 | | and margins when printing in Windows (see, e.g., BPD02519 for the DJ 660C). |
67 | | The DG lists the Windows margins which are usually larger than the hardware |
68 | | margins. I assume the DOS margins to be the real hardware margins. |
69 | | |
70 | | A statement that the DeskJets 500 and 500C but not 510, 520, 540, 550C, 560C |
71 | | or any newer models load envelopes long edge first can be found on p. 24 of |
72 | | DG. In addition, BPD01246 describes how to load envelopes on the HP DeskJet, |
73 | | DeskJet Plus, DJ 500 and DJ 500C printers and it has to be done flap first, |
74 | | i.e., long edge first. |
75 | | |
76 | | Some care is necessary when inserting margin specifications. In particular |
77 | | for envelopes, older (pre-1997) HP documentation frequently gives them in |
78 | | landscape orientation instead of in portrait orientation as needed here |
79 | | (except when the MS_TRANSVERSE_FLAG is set). A useful rule of thumb: If the |
80 | | bottom margin is not the largest of the four margins but the left margin is, |
81 | | it's very likely landscape. The value should be around 0.5 in (ca. 12 mm). |
82 | | */ |
83 | | |
84 | | static const eprn_PageDescription |
85 | | /* Order of margins: left, bottom, right, top. */ |
86 | | hpdj3xx_sizes[] = { |
87 | | /* These are the page descriptions for the DeskJets Portable, 310, 320 and |
88 | | 340, taken from DJ3/4, pp. 1 and 20. When printing in colour, the |
89 | | bottom margin is larger by 50 d. |
90 | | Note that BPD05054 gives different margins. |
91 | | */ |
92 | | {ms_Letter, |
93 | | 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT}, |
94 | | {ms_Legal, |
95 | | 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT}, |
96 | | {ms_A4, |
97 | | 37*BP_PER_DOT, 120*BP_PER_DOT, 43*BP_PER_DOT, 30*BP_PER_DOT}, |
98 | | {ms_Executive, |
99 | | 75*BP_PER_DOT, 120*BP_PER_DOT, 75*BP_PER_DOT, 30*BP_PER_DOT}, |
100 | | {ms_none} |
101 | | }, |
102 | | hpdj400_sizes[] = { |
103 | | /* These are the page descriptions for the DeskJet 400 taken from DJ3/4, |
104 | | pp. 1 and 21, and are stated to be valid valid for black and colour. |
105 | | Page 21 contains the following statement: "The mechanism will |
106 | | physically shift the page image downwards by a nominal 0.08 inch |
107 | | (2.0 mm)." I conclude this to mean that the real top margin is |
108 | | 0.08 inch instead of zero as specified and that the real bottom margin |
109 | | is smaller than specified by 0.08 inch. |
110 | | Note that BPD05054 gives different margins. |
111 | | */ |
112 | | {ms_Letter, |
113 | | 0.25f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 0.25f*BP_PER_IN, 0.08f*BP_PER_IN}, |
114 | | {ms_Legal, |
115 | | 0.25f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 0.25f*BP_PER_IN, 0.08f*BP_PER_IN}, |
116 | | {ms_A4, |
117 | | 0.125f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 3.6f*BP_PER_MM, 0.08f*BP_PER_IN}, |
118 | | {ms_Executive, |
119 | | 0.25f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 0.25f*BP_PER_IN, 0.08f*BP_PER_IN}, |
120 | | {ms_JISB5, |
121 | | 3.175f*BP_PER_MM, (0.5f-0.08f)*BP_PER_IN, 3.25f*BP_PER_MM, 0.08f*BP_PER_IN}, |
122 | | /* DJ3/4 p. 21: "Envelopes are printed in the landscape mode". As the |
123 | | margins are given such that the largest value is designated as "bottom" |
124 | | and the bottom is designated on page 19 as a long edge, I conclude that |
125 | | the DJ 400 feeds envelopes long edge first. The list on p. 1 gives the |
126 | | dimensions for Env10 in portrait and EnvDL in landscape orientation. |
127 | | */ |
128 | | {ms_Env10 | MS_TRANSVERSE_FLAG, |
129 | | 0.125f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 0.08f*BP_PER_IN, 0.08f*BP_PER_IN}, |
130 | | {ms_EnvDL | MS_TRANSVERSE_FLAG, |
131 | | 0.125f*BP_PER_IN, (0.5f-0.08f)*BP_PER_IN, 0.11f*BP_PER_IN, 0.08f*BP_PER_IN}, |
132 | | {ms_none} |
133 | | }, |
134 | | hpdj500_sizes[] = { |
135 | | /* These are taken from the TRG500 p. 1-18 except for No. 10 envelopes |
136 | | which are supported according to p. 3-2 and where I took the margins |
137 | | from BPD05054. The resulting collection agrees with BPD05054 which |
138 | | declares it to be valid for the HP DeskJet and the HP DeskJet Plus as |
139 | | well. |
140 | | Order of margins: left, bottom, right, top. */ |
141 | | {ms_Letter, |
142 | | 0.25f*BP_PER_IN, 0.57f*BP_PER_IN, 0.25f*BP_PER_IN, 0.1f*BP_PER_IN}, |
143 | | {ms_Legal, |
144 | | 0.25f*BP_PER_IN, 0.57f*BP_PER_IN, 0.25f*BP_PER_IN, 0.1f*BP_PER_IN}, |
145 | | {ms_A4, |
146 | | 3.1f*BP_PER_MM, 0.57f*BP_PER_IN, 3.6f*BP_PER_MM, 0.1f*BP_PER_IN}, |
147 | | {ms_Env10 | MS_TRANSVERSE_FLAG, /* Margins from BPD05054 */ |
148 | | 0.75f*BP_PER_IN, 0.57f*BP_PER_IN, 0.75f*BP_PER_IN, 0.1f*BP_PER_IN}, |
149 | | {ms_none} |
150 | | }, |
151 | | hpdj500c_sizes[] = { |
152 | | /* The data are from the TRG500 pp. 1-18 and 1-19 except for No. 10 |
153 | | envelopes which are supported according to p. 3-2 and which I took from |
154 | | BPD05054. The values listed in both documents agree. |
155 | | These are the values for the black cartridge; the CMY cartridge needs |
156 | | 0.17 inches more at the bottom. |
157 | | Order of margins: left, bottom, right, top. */ |
158 | | {ms_Letter, |
159 | | 0.25f*BP_PER_IN, 0.4f*BP_PER_IN, 0.25f*BP_PER_IN, 0.1f*BP_PER_IN}, |
160 | | {ms_Legal, |
161 | | 0.25f*BP_PER_IN, 0.4f*BP_PER_IN, 0.25f*BP_PER_IN, 0.1f*BP_PER_IN}, |
162 | | {ms_A4, |
163 | | 3.1f*BP_PER_MM, 0.4f*BP_PER_IN, 3.6f*BP_PER_MM, 0.1f*BP_PER_IN}, |
164 | | {ms_Env10 | MS_TRANSVERSE_FLAG, |
165 | | /* Margins from BPD05054, but I've chosen 0.4 in for the bottom margin |
166 | | instead of 0.57 in as listed there because it looks to me like the |
167 | | colour bottom. Compare with the DJ 500. */ |
168 | | 0.75f*BP_PER_IN, 0.4f*BP_PER_IN, 0.75f*BP_PER_IN, 0.1f*BP_PER_IN}, |
169 | | {ms_none} |
170 | | }, |
171 | | common_sizes[] = { /* DJs 510, 520, 550C und 560C for printing in black */ |
172 | | /* The data are from the TRG500 p. 1-19 except for envelopes which are |
173 | | supported according to p. 3-2 and where I took the margins from |
174 | | BPD05054. The values listed in both documents agree. |
175 | | For colour, the bottom margin must be increased by 0.13 inches. |
176 | | Order of margins: left, bottom, right, top. */ |
177 | | {ms_Letter, |
178 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
179 | | {ms_Legal, |
180 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
181 | | {ms_Executive, |
182 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, 0.04f*BP_PER_IN}, |
183 | | {ms_A4, |
184 | | 3.1f*BP_PER_MM, 0.46f*BP_PER_IN, 3.6f*BP_PER_MM, 0.04f*BP_PER_IN}, |
185 | | /* Envelopes are supported according the TRG500, the margins are from |
186 | | BPD05054. */ |
187 | | {ms_Env10, /* given in landscape by HP */ |
188 | | 0.123f*BP_PER_IN, 0.71f*BP_PER_IN, 0.125f*BP_PER_IN, 0.04f*BP_PER_IN}, |
189 | | {ms_EnvDL, /* given in landscape by HP */ |
190 | | 3.1f*BP_PER_MM, 18.0f*BP_PER_MM, 3.6f*BP_PER_MM, 1.0f*BP_PER_MM}, |
191 | | {ms_none} |
192 | | }, |
193 | | hpdj540_sizes[] = { |
194 | | /* The data are from the TRG500 pp. 1-20 and 1-21 except that I have used |
195 | | a top margin of 0.04 inch from the DG instead of zero from the TRG500. |
196 | | Taking into account that the bottom margin is larger by 0.13 inches in |
197 | | colour, the resulting data agree with those in the DG, pp. 65-66. |
198 | | Order of margins: left, bottom, right, top. */ |
199 | | {ms_Executive, |
200 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
201 | | {ms_Letter, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
202 | | {ms_Legal, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
203 | | {ms_A4, 3.2f*BP_PER_MM, 11.7f*BP_PER_MM, 3.2f*BP_PER_MM, 0.04f*BP_PER_IN}, |
204 | | {ms_A5, 3.2f*BP_PER_MM, 18.0f*BP_PER_MM, 3.2f*BP_PER_MM, 0.04f*BP_PER_IN}, |
205 | | {ms_JISB5, 4.2f*BP_PER_MM, 11.7f*BP_PER_MM, 4.2f*BP_PER_MM, 0.04f*BP_PER_IN}, |
206 | | {ms_Index4x6in, |
207 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
208 | | {ms_Index5x8in, |
209 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
210 | | {ms_A6 | PCL_CARD_FLAG, |
211 | | 3.2f*BP_PER_MM, 18.0f*BP_PER_MM, 3.2f*BP_PER_MM, 0.04f*BP_PER_IN}, |
212 | | {ms_Env10, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
213 | | /* given in landscape by HP */ |
214 | | {ms_EnvDL, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
215 | | /* given in landscape by HP */ |
216 | | {ms_EnvC6, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
217 | | /* given in landscape by HP */ |
218 | | {ms_Postcard, 4.2f*BP_PER_MM, 18.0f*BP_PER_MM, 4.2f*BP_PER_MM, 0.04f*BP_PER_IN}, |
219 | | {ms_none} |
220 | | }, |
221 | | hpdj660c_sizes[] = { |
222 | | /* These are taken from "HP DeskJet 660C Printer - Printable Regions", |
223 | | BPD02519, 1996 (obtained in March 1997), except that I've again |
224 | | increased the top margin from zero to 0.04 inches following BPD05054 |
225 | | and DG pp. 69-70. These are the values for printing in black from DOS. |
226 | | Colour printing increases the bottom margin by 0.13 inch. Adding this |
227 | | value reproduces the data from BPD05054 and the DG. This is, however, a |
228 | | contradiction with DG because BPD02519 gives different values for |
229 | | printing from Windows. |
230 | | */ |
231 | | {ms_Letter, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
232 | | {ms_Legal, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
233 | | {ms_Executive, |
234 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
235 | | {ms_A4, 0.13f*BP_PER_IN, 0.46f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
236 | | {ms_A5, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
237 | | {ms_JISB5, 0.17f*BP_PER_IN, 0.46f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
238 | | /* The bottom margin for JISB5 is given with large differences. BPD02519 |
239 | | specifies it as 0.46 in for black from DOS, 0.59 in DOS/colour (agreeing |
240 | | with +0.13 in for 'bottom_increment') and the same for Windows black or |
241 | | colour. BPD05054 gives 0.84 in without distinguishing between black and |
242 | | colour, and the DG gives 0.59 in. */ |
243 | | {ms_Env10, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
244 | | /* given in landscape by HP */ |
245 | | {ms_EnvDL, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
246 | | /* given in landscape by HP */ |
247 | | {ms_EnvC6, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
248 | | /* given in landscape by HP */ |
249 | | {ms_Index4x6in, |
250 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
251 | | {ms_Index5x8in, |
252 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
253 | | {ms_A6 | PCL_CARD_FLAG, |
254 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
255 | | {ms_Postcard, |
256 | | 0.17f*BP_PER_IN, 0.71f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
257 | | {ms_EnvUS_A2, |
258 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
259 | | /* Supported (BPD02925, BPD05054, DG), margins from BPD05054 agreeing |
260 | | with DG p. 70 */ |
261 | | {ms_none} |
262 | | }, |
263 | | hpdj680c_sizes[] = { |
264 | | /* For a change, these data are taken from the DG pp. 73-74. It is assumed |
265 | | that they are there given for colour printing and that the additional |
266 | | bottom margin included is 0.13 inches. Except for banner printing which |
267 | | is not supported by the DJ 660C, this gives identical margins as those |
268 | | for the DJ 660C. |
269 | | These data also almost agree with the German printer manual, |
270 | | Hewlett Packard |
271 | | "Weitere Informationen ueber den HP DeskJet 690C Series-Drucker" |
272 | | 1. Auflage, September 1996 |
273 | | Bestellnummer C4562-60105, Artikelnummer C4562-90160 |
274 | | for the DJ 690C. The difference is at most 0.31 mm except for the bottom |
275 | | margin in the case of JIS B5 which is given as 21.2 mm instead of 14.9 mm |
276 | | (0.83 in vs. 0.59 in). |
277 | | The DJ 690C does support banner printing (DJ6/8 p. 9). |
278 | | */ |
279 | | {ms_Letter, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
280 | | {ms_A4, 0.13f*BP_PER_IN, 0.46f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
281 | | {ms_Legal, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
282 | | {ms_Env10, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
283 | | {ms_Executive, |
284 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
285 | | {ms_EnvDL, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
286 | | {ms_A5, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
287 | | {ms_JISB5, 0.17f*BP_PER_IN, 0.46f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
288 | | {ms_EnvC6, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
289 | | {ms_Index4x6in, |
290 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
291 | | {ms_Index5x8in, |
292 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
293 | | {ms_A6 | PCL_CARD_FLAG, |
294 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
295 | | {ms_Postcard, |
296 | | 0.17f*BP_PER_IN, 0.71f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
297 | | {ms_EnvUS_A2, |
298 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
299 | | {ms_Letter | MS_BIG_FLAG, /* banner */ |
300 | | 0.25f*BP_PER_IN, 0.0f, 0.25f*BP_PER_IN, 0.0f}, |
301 | | {ms_A4 | MS_BIG_FLAG, /* banner */ |
302 | | 0.13f*BP_PER_IN, 0.0f, 0.13f*BP_PER_IN, 0.0f}, |
303 | | /* BPD05054 claims left and right margins of 0.25 in. */ |
304 | | {ms_none} |
305 | | }, |
306 | | hpdj6xx_and_8xx_sizes[] = { |
307 | | /* This entry is a combination from the sizes supported according to |
308 | | DJ6/8 pp. 23-24 by all series 600 and 800 DeskJets, and the corresponding |
309 | | margins from 'hpdj660c_sizes[]' above. This is only used for |
310 | | series 600 DeskJets for which there is no other information and not for |
311 | | series 800 DeskJets. |
312 | | */ |
313 | | {ms_Executive, |
314 | | 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
315 | | {ms_Letter, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
316 | | {ms_Legal, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
317 | | {ms_A5, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
318 | | {ms_A4, 0.13f*BP_PER_IN, 0.46f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
319 | | {ms_JISB5, 0.17f*BP_PER_IN, 0.46f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
320 | | {ms_Postcard, |
321 | | 0.17f*BP_PER_IN, 0.71f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
322 | | {ms_DoublePostcard, /* not present in 'hpdj660c_sizes[]'; guessed */ |
323 | | 0.17f*BP_PER_IN, 0.71f*BP_PER_IN, 0.17f*BP_PER_IN, 0.04f*BP_PER_IN}, |
324 | | {ms_A6 | PCL_CARD_FLAG, |
325 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
326 | | {ms_Index4x6in, |
327 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
328 | | {ms_Index5x8in, |
329 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
330 | | {ms_Env10, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
331 | | {ms_EnvDL, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
332 | | {ms_EnvC6, 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
333 | | {ms_EnvUS_A2, |
334 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
335 | | {ms_none} |
336 | | }, |
337 | | hpdj850c_sizes[] = { |
338 | | /* Apart from JIS B5, these specifications have been taken from the German |
339 | | HP user manual for the DeskJet 850C, "HP DeskJet 850C Handbuch", |
340 | | C2145-90248, 3/95. They are valid for black and colour printing. |
341 | | The manual agrees with "HP DeskJet 850C and 855C Printer -- Printable |
342 | | Regions" (BPD02523), HP FIRST #: 2789, 1995-09-05, and the newer |
343 | | "HP DeskJet 855C, 850C, 870C and 890C Series Printers -- Printable Areas" |
344 | | (BPD02523), effective date 1996-06-06. |
345 | | There are some minor deviations in the DG, pp. 81-82, which I have |
346 | | partially adopted. |
347 | | First some shorthand notation for margin types. The order is: |
348 | | left, bottom, right, top. |
349 | | */ |
350 | | #define type1 6.4f*BP_PER_MM, 11.7f*BP_PER_MM, 6.4f*BP_PER_MM, 1.0f*BP_PER_MM |
351 | | #define type2 3.4f*BP_PER_MM, 11.7f*BP_PER_MM, 3.4f*BP_PER_MM, 1.0f*BP_PER_MM |
352 | | #define type3 3.4f*BP_PER_MM, 11.7f*BP_PER_MM, 3.4f*BP_PER_MM, 11.7f*BP_PER_MM |
353 | | #define type4 3.2f*BP_PER_MM, 11.7f*BP_PER_MM, 3.2f*BP_PER_MM, 1.0f*BP_PER_MM |
354 | | #define type5 3.2f*BP_PER_MM, 22.0f*BP_PER_MM, 3.2f*BP_PER_MM, 1.0f*BP_PER_MM |
355 | | {ms_Letter, type1}, |
356 | | {ms_Legal, type1}, |
357 | | {ms_Executive, type1}, |
358 | | {ms_A4, type2}, |
359 | | {ms_A5, type2}, /* also BPD05054. DG: type4 */ |
360 | | {ms_JISB5, type4}, /* from DG */ |
361 | | /* The German handbook as well as BPD02523 and BPD05054 state that this |
362 | | should be type3. This is however demonstrably wrong for the DJ 850C. |
363 | | Besides I can't see why the top margin should be so much larger for |
364 | | JIS B5 than for the other sizes. 'type4' agrees fairly well with what |
365 | | I've measured on a DJ 850C. In particular the right and bottom clipping |
366 | | margins are definitely close to 3 and 11.5 mm, respectively. |
367 | | */ |
368 | | {ms_Index4x6in, type4}, |
369 | | {ms_Index5x8in, type4}, |
370 | | {ms_A6 | PCL_CARD_FLAG, type4}, |
371 | | {ms_Postcard, type4}, |
372 | | {ms_Env10, type5}, |
373 | | {ms_EnvDL, type5}, |
374 | | {ms_EnvC6, type5}, |
375 | | /* BPD02926 claims that the series-800 DeskJets support also US A2 envelope |
376 | | size (ms_EnvUS_A2). I've experimented with a DeskJet 850C and I don't |
377 | | believe it: when sent this page size code, the printer establishes |
378 | | clipping regions which agree with those for US Letter size. This |
379 | | indicates that the PCL interpreter has not recognized the page size code |
380 | | and has therefore switched to the default size. */ |
381 | | {ms_none} |
382 | | #undef type1 |
383 | | /* type2 will be needed in a moment */ |
384 | | #undef type3 |
385 | | #undef type4 |
386 | | #undef type5 |
387 | | }, |
388 | | hpdj1120c_sizes[] = { |
389 | | /* These values are from DJ1120C, pp. 11-12, and from BPD05567. I don't |
390 | | consider them particularly trustworthy. */ |
391 | | {ms_Executive, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, |
392 | | 0.12f*BP_PER_IN}, |
393 | | {ms_Letter, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, |
394 | | 0.12f*BP_PER_IN}, |
395 | | {ms_Legal, 0.25f*BP_PER_IN, 0.46f*BP_PER_IN, 0.25f*BP_PER_IN, |
396 | | 0.12f*BP_PER_IN}, |
397 | | {ms_Tabloid, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
398 | | 0.12f*BP_PER_IN}, |
399 | | {ms_Statement, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
400 | | 0.12f*BP_PER_IN}, /* Not in BPD05567. */ |
401 | | {ms_HPSuperB, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
402 | | 0.12f*BP_PER_IN}, |
403 | | {ms_A6, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
404 | | 0.12f*BP_PER_IN}, /* Not in BPD05567. */ |
405 | | {ms_A5, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
406 | | 0.12f*BP_PER_IN}, |
407 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
408 | | {ms_A4, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
409 | | 0.12f*BP_PER_IN}, |
410 | | /* BPD05567: 0.13 in, 0.46 in, 0.13 in, 0.12 in. */ |
411 | | {ms_A3, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
412 | | 0.12f*BP_PER_IN}, /* Only in BPD05567. */ |
413 | | {ms_JISB5, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
414 | | 0.12f*BP_PER_IN}, |
415 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
416 | | {ms_JISB4, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
417 | | 0.12f*BP_PER_IN}, /* Not in BPD05567. */ |
418 | | {ms_Postcard, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
419 | | 0.12f*BP_PER_IN}, |
420 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
421 | | {ms_A6 | PCL_CARD_FLAG, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
422 | | 0.12f*BP_PER_IN}, |
423 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
424 | | {ms_Index4x6in, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
425 | | 0.12f*BP_PER_IN}, |
426 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
427 | | {ms_Index5x8in, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
428 | | 0.12f*BP_PER_IN}, |
429 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
430 | | {ms_Env10, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
431 | | 0.12f*BP_PER_IN}, |
432 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
433 | | {ms_EnvDL, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
434 | | 0.12f*BP_PER_IN}, |
435 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
436 | | {ms_EnvC6, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
437 | | 0.12f*BP_PER_IN}, |
438 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
439 | | {ms_EnvUS_A2, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
440 | | 0.12f*BP_PER_IN}, |
441 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
442 | | {ms_EnvChou3, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
443 | | 0.12f*BP_PER_IN}, |
444 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
445 | | {ms_EnvChou4, 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, |
446 | | 0.12f*BP_PER_IN}, |
447 | | /* BPD05567: 0.12 in, 0.46 in, 0.12 in, 0.12 in. */ |
448 | | {ms_EnvKaku2, 0.20f*BP_PER_IN, 0.46f*BP_PER_IN, 0.20f*BP_PER_IN, |
449 | | 0.12f*BP_PER_IN}, /* Not in BPD05567. */ |
450 | | /* Banners are listed only in BPD05567: */ |
451 | | {ms_Letter | MS_BIG_FLAG, |
452 | | 0.25f*BP_PER_IN, 0, 0.25f*BP_PER_IN, 0.04f*BP_PER_IN}, |
453 | | {ms_A4 | MS_BIG_FLAG, |
454 | | 0.13f*BP_PER_IN, 0, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN}, |
455 | | {ms_none} |
456 | | }; |
457 | | |
458 | | /*---------------------------------------------------------------------------*/ |
459 | | |
460 | | /* Custom page size descriptions. |
461 | | First the limits: width min and max, height min and max. |
462 | | Then the margins in the usual order: left, bottom, right, top. |
463 | | |
464 | | Again, I have assumed something I could find no explicit documentation for, |
465 | | namely that these limits refer to raster space (which is identical to |
466 | | pixmap device space for the 'pcl3' device). It is, however, clear from the |
467 | | upper limits for the DJ 850C that "height" does not refer to the direction |
468 | | orthogonal to the feeding direction. |
469 | | */ |
470 | | static const eprn_CustomPageDescription |
471 | | hpdj540_custom_sizes[] = { |
472 | | /* These values are taken from the document "HP DeskJet 540 Printer - |
473 | | Print Regions", BPD02194, 1996, except for the right margin which is |
474 | | stated to be application-dependent (the TRG500 recommends that one should |
475 | | enforce at least 1/8 in) and the top margin which I've extended from |
476 | | zero to 0.04 in. |
477 | | These are the correct values for printing in black. Note that the |
478 | | DeskJet 540 in colour mode needs a bottom margin which is larger by |
479 | | 0.13 in. |
480 | | */ |
481 | | { /* Page width 7.12 to 8.5 in */ |
482 | | ms_CustomPageSize, |
483 | | 0.13f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, 0.04f*BP_PER_IN, |
484 | | 7.12f*BP_PER_IN, 8.5f*BP_PER_IN, 5.83f*BP_PER_IN, 14*BP_PER_IN |
485 | | }, |
486 | | { /* Page width 5 to 7.12 in */ |
487 | | ms_CustomPageSize, |
488 | | 0.13f*BP_PER_IN, 0.71f*BP_PER_IN, 0.125f*BP_PER_IN, 0.04f*BP_PER_IN, |
489 | | 5*BP_PER_IN, 7.12f*BP_PER_IN, 5.83f*BP_PER_IN, 14*BP_PER_IN |
490 | | }, |
491 | | {ms_none, 0, 0, 0, 0, 0, 0, 0, 0} |
492 | | }, |
493 | | hpdj_6xx_and_8xx_custom_sizes[] = { |
494 | | /* Ranges from DJ6/8 p. 23, margins from A4 for the DJ 660C (BPD02519) */ |
495 | | { |
496 | | ms_CustomPageSize, |
497 | | 0.13f*BP_PER_IN, 0.46f*BP_PER_IN, 0.13f*BP_PER_IN, 0.04f*BP_PER_IN, |
498 | | 5*BP_PER_IN, 8.5f*BP_PER_IN, 148*BP_PER_MM, 14*BP_PER_IN |
499 | | }, |
500 | | {ms_none, 0, 0, 0, 0, 0, 0, 0, 0} |
501 | | }, |
502 | | hpdj850c_custom_sizes[] = { |
503 | | { /* |
504 | | The following values have been taken from the German DeskJet 850C |
505 | | manual, "HP DeskJet 850C Handbuch", C2145-90248, 3/95. |
506 | | They agree with the values given in the newer version of BPD02523 for |
507 | | the DeskJets 850C, 855C, 870C and 890C except that the left and right |
508 | | margins are stated to be 3.44 mm instead of 3.4 mm. This is almost |
509 | | certainly a misprint because the accompanying value in inches is |
510 | | identical (0.13 in, i.e. 3.30 mm), and specifying the margins to a |
511 | | hundredth of a millimetre is ridiculous. |
512 | | */ |
513 | | ms_CustomPageSize, |
514 | | type2, |
515 | | 100*BP_PER_MM, 216*BP_PER_MM, 148*BP_PER_MM, 356*BP_PER_MM |
516 | | }, |
517 | | {ms_none, 0, 0, 0, 0, 0, 0, 0, 0} |
518 | | }, |
519 | | hpdj1120c_custom_sizes[] = { |
520 | | { /* Taken from DJ1120C pp. 10 and 12. The minimum sizes are guessed |
521 | | (smallest supported discrete dimensions) */ |
522 | | ms_CustomPageSize, |
523 | | 0.125f*BP_PER_IN, 0.46f*BP_PER_IN, 0.125f*BP_PER_IN, 0.12f*BP_PER_IN, |
524 | | 90*BP_PER_MM, 13*BP_PER_IN, 146*BP_PER_MM, 19*BP_PER_IN, |
525 | | }, |
526 | | {ms_none, 0, 0, 0, 0, 0, 0, 0, 0} |
527 | | }, |
528 | | any_custom_sizes[] = { |
529 | | /* Any value is permitted in this case. This is approximated by permitting |
530 | | 10^-37-10^37 bp for both, width and height (10^37 bp = 3.5*10^33 m). |
531 | | Note that 10^37 is the smallest upper bound and 10^-37 the largest lower |
532 | | bound for 'float' values permitted by the C standard. */ |
533 | | { |
534 | | ms_CustomPageSize, |
535 | | type2, /* use DJ 850C margins */ |
536 | | 1.0E-37f, 1.0E37f, 1.0E-37f, 1.0E37f |
537 | | }, |
538 | | {ms_none, 0, 0, 0, 0, 0, 0, 0, 0} |
539 | | }; |
540 | | |
541 | | #undef type2 |
542 | | |
543 | | /*****************************************************************************/ |
544 | | |
545 | | /* Resolution lists */ |
546 | | static const eprn_Resolution |
547 | | threehundred[] = { |
548 | | { 300, 300 }, { 0, 0 } |
549 | | }, |
550 | | six_by_three[] = { |
551 | | { 600, 300 }, { 0, 0 } |
552 | | }, |
553 | | sixhundred[] = { |
554 | | { 600, 600 }, { 0, 0 } |
555 | | }, |
556 | | basic_resolutions[] = { |
557 | | { 75, 75 }, { 100, 100 }, { 150, 150 }, { 300, 300 }, { 0, 0 } |
558 | | /* This is the list of resolutions supported by the series 300, 400 and |
559 | | 500 DeskJets (except the DJ 540) in black and colour and by the series |
560 | | 600 and 800 DeskJets (except the DJs 85xC) in colour. */ |
561 | | }, |
562 | | basic_without_100[] = { |
563 | | { 75, 75 }, { 150, 150 }, { 300, 300 }, { 0, 0 } |
564 | | }, |
565 | | rel_hpdj1120c_black[] = { |
566 | | { 150, 150 }, { 300, 300 }, { 600, 600 }, { 0, 0 } |
567 | | }, |
568 | | rel_150_and_300[] = { |
569 | | { 150, 150 }, { 300, 300 }, { 0, 0 } |
570 | | }; |
571 | | |
572 | | /* Lists of permitted numbers of intensity levels */ |
573 | | static const eprn_IntensityLevels |
574 | | two_levels[] = { {2, 2}, {0, 0} }, |
575 | | four_levels[] = { {4, 4}, {0, 0} }, |
576 | | two_to_four_levels[] = { {2, 4}, {0, 0} }, |
577 | | three_to_four_levels[] = { {3, 4}, {0, 0} }, |
578 | | any_levels[] = { {2, 65535}, {0, 0} }; |
579 | | /* More than 65535 levels cannot be represented in a Configure Raster Data |
580 | | command with format 2. */ |
581 | | |
582 | | /* Combinations of resolutions and intensity levels */ |
583 | | static const eprn_ResLev |
584 | | rl_basic[] = { |
585 | | {basic_resolutions, two_levels}, {NULL, NULL} |
586 | | }, |
587 | | rl_basic_without_100[] = { |
588 | | {basic_without_100, two_levels}, {NULL, NULL} |
589 | | }, |
590 | | rl_hpdj6xx_black[] = { |
591 | | {basic_resolutions, two_levels}, {six_by_three, two_levels}, |
592 | | {sixhundred, two_levels}, {NULL, NULL} |
593 | | }, |
594 | | rl_hpdj6xx_colour[] = { |
595 | | {basic_resolutions, two_levels}, {six_by_three, two_levels}, {NULL, NULL} |
596 | | }, |
597 | | rl_three[] = { |
598 | | {threehundred, two_levels}, {NULL, NULL} |
599 | | }, |
600 | | rl_six[] = { |
601 | | {sixhundred, two_levels}, {NULL, NULL} |
602 | | }, |
603 | | rl_hpdj85x_black[] = { |
604 | | {basic_without_100, two_levels}, {sixhundred, two_levels}, {NULL, NULL} |
605 | | }, |
606 | | rl_three_with_levels_2_4[] = { |
607 | | {threehundred, two_to_four_levels}, {NULL, NULL} |
608 | | }, |
609 | | rl_three_with_levels_3_4[] = { |
610 | | {threehundred, three_to_four_levels}, {NULL, NULL} |
611 | | }, |
612 | | rl_three_with_levels_4[] = { |
613 | | {threehundred, four_levels}, {NULL, NULL} |
614 | | }, |
615 | | rl_hpdj1120c_black[] = { |
616 | | {rel_hpdj1120c_black, two_levels}, |
617 | | {threehundred, four_levels}, |
618 | | {NULL, NULL} |
619 | | }, |
620 | | rl_150_and_300[] = { |
621 | | {rel_150_and_300, two_levels}, {NULL, NULL} |
622 | | }, |
623 | | rl_any_two_levels[] = { |
624 | | /* Any resolution, but only two intensity levels */ |
625 | | {NULL, two_levels}, {NULL, NULL} |
626 | | }, |
627 | | rl_any[] = { |
628 | | {NULL, any_levels}, {NULL, NULL} |
629 | | }; |
630 | | |
631 | | /*****************************************************************************/ |
632 | | |
633 | | /* Colour capability lists */ |
634 | | static const eprn_ColourInfo |
635 | | ci_old_mono[] = { /* DeskJet 5xx monochrome printers */ |
636 | | { eprn_DeviceGray, {rl_basic, NULL} }, |
637 | | { eprn_DeviceGray, {NULL, NULL} } |
638 | | }, |
639 | | ci_hpdj500c[] = { /* HP DeskJet 500C: black or CMY cartridge */ |
640 | | { eprn_DeviceGray, {rl_basic, NULL} }, |
641 | | { eprn_DeviceCMY, {rl_basic, NULL} }, |
642 | | { eprn_DeviceGray, {NULL, NULL} } |
643 | | }, |
644 | | ci_hpdj540[] = { /* HP DeskJet 540: black or CMY cartridge */ |
645 | | { eprn_DeviceGray, {rl_basic_without_100, NULL} }, |
646 | | { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, |
647 | | { eprn_DeviceGray, {NULL, NULL} } |
648 | | }, |
649 | | ci_hpdj5xx_cmyk[] = { |
650 | | /* HP DeskJet 550C or 560C: black and CMY cartridges, but the inks should |
651 | | not mix. */ |
652 | | { eprn_DeviceGray, {rl_basic, NULL} }, |
653 | | { eprn_DeviceCMY, {rl_basic, NULL} }, |
654 | | { eprn_DeviceCMY_plus_K, {rl_basic, NULL} }, |
655 | | { eprn_DeviceGray, {NULL, NULL} } |
656 | | }, |
657 | | ci_hpdj600[] = { |
658 | | /* HP DeskJet 600: black or CMY cartridge */ |
659 | | { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} }, |
660 | | { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} }, |
661 | | { eprn_DeviceGray, {NULL, NULL} } |
662 | | }, |
663 | | ci_hpdj6xx[] = { |
664 | | /* Series-600 CMYK printers */ |
665 | | { eprn_DeviceGray, {rl_hpdj6xx_black, NULL} }, |
666 | | { eprn_DeviceCMY, {rl_hpdj6xx_colour, NULL} }, |
667 | | { eprn_DeviceCMYK, {rl_hpdj6xx_colour, NULL} }, |
668 | | { eprn_DeviceCMYK, {rl_six, rl_three} }, |
669 | | { eprn_DeviceGray, {NULL, NULL} } |
670 | | }, |
671 | | ci_hpdj85x[] = { |
672 | | { eprn_DeviceGray, {rl_hpdj85x_black, NULL} }, |
673 | | { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, |
674 | | { eprn_DeviceCMYK, {rl_basic_without_100, NULL} }, |
675 | | /* The following I have determined experimentally on a DJ 850C: */ |
676 | | { eprn_DeviceGray, {rl_three_with_levels_4, NULL} }, |
677 | | { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_2_4} }, |
678 | | { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} }, |
679 | | { eprn_DeviceGray, {NULL, NULL} } |
680 | | }, |
681 | | ci_hpdj1120c[] = { |
682 | | /* DJ1120C p. 48 */ |
683 | | { eprn_DeviceGray, {rl_hpdj1120c_black, NULL} }, |
684 | | { eprn_DeviceCMYK, {rl_six, rl_three_with_levels_4} }, |
685 | | { eprn_DeviceCMYK, {rl_six, rl_three} }, |
686 | | { eprn_DeviceCMYK, {rl_three_with_levels_4, rl_three_with_levels_3_4} }, |
687 | | { eprn_DeviceCMYK, {rl_150_and_300, NULL} }, |
688 | | /* The following are combined from DJ1120C pp. 36 and 52. */ |
689 | | { eprn_DeviceGray, {rl_hpdj85x_black, NULL} }, |
690 | | { eprn_DeviceCMY, {rl_basic_without_100, NULL} }, |
691 | | { eprn_DeviceCMYK, {rl_basic_without_100, NULL} }, |
692 | | { eprn_DeviceGray, {NULL, NULL} } |
693 | | }, |
694 | | ci_any[] = { |
695 | | { eprn_DeviceGray, {rl_any, NULL} }, |
696 | | { eprn_DeviceRGB, {rl_any_two_levels, NULL} }, |
697 | | { eprn_DeviceCMY, {rl_any, NULL} }, |
698 | | { eprn_DeviceCMYK, {rl_any, rl_any} }, |
699 | | { eprn_DeviceGray, {NULL, NULL} } |
700 | | }; |
701 | | |
702 | | /*****************************************************************************/ |
703 | | |
704 | | /* Descriptions of known PCL printers */ |
705 | | |
706 | | const pcl_PrinterDescription pcl3_printers[] = { |
707 | | /* For the HP DeskJet and the HP DeskJet Plus I am guessing that they can |
708 | | be treated like the DJ 500. This seems reasonable because several HP |
709 | | documents group the HP DeskJet, the HP DeskJet Plus and the 500 and |
710 | | 500C DeskJets together. */ |
711 | | { HPDeskJet, pcl_level_3plus_DJ500, |
712 | | { "HP DeskJet", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, |
713 | | { HPDeskJetPlus, pcl_level_3plus_DJ500, |
714 | | { "HP DeskJet Plus", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, |
715 | | { HPDJPortable, pcl_level_3plus_S5, |
716 | | { "HP DeskJet Portable", hpdj3xx_sizes, NULL, 0.0, ci_old_mono } }, |
717 | | /* DJ3/4 p. 2: This printer behaves as the 550C without the colour |
718 | | cartridge. */ |
719 | | { HPDJ310, pcl_level_3plus_S5, |
720 | | { "HP DeskJet 310", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, |
721 | | /* DJ3/4 p. 3: The 3xx DeskJets with the black cartridge installed behave |
722 | | identically to the DJ Portable, with the colour cartridge they can be |
723 | | treated as the DJ 500C. */ |
724 | | { HPDJ320, pcl_level_3plus_S5, |
725 | | { "HP DeskJet 320", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, |
726 | | { HPDJ340, pcl_level_3plus_S5, |
727 | | { "HP DeskJet 340", hpdj3xx_sizes, NULL, 50*BP_PER_DOT, ci_hpdj500c } }, |
728 | | { HPDJ400, pcl_level_3plus_S5, |
729 | | { "HP DeskJet 400", hpdj400_sizes, NULL, 0.0, ci_hpdj500c } }, |
730 | | /* DJ3/4 p. 3 and p. 6. */ |
731 | | { HPDJ500, pcl_level_3plus_DJ500, |
732 | | {"HP DeskJet 500", hpdj500_sizes, NULL, 0.0, ci_old_mono } }, |
733 | | { HPDJ500C, pcl_level_3plus_S5, |
734 | | { "HP DeskJet 500C", hpdj500c_sizes, NULL, 0.17f*BP_PER_IN, ci_hpdj500c } }, |
735 | | { HPDJ510, pcl_level_3plus_S5, |
736 | | { "HP DeskJet 510", common_sizes, NULL, 0.0, ci_old_mono } }, |
737 | | { HPDJ520, pcl_level_3plus_S5, |
738 | | { "HP DeskJet 520", common_sizes, NULL, 0.0, ci_old_mono } }, |
739 | | { HPDJ540, pcl_level_3plus_S68, |
740 | | { "HP DeskJet 540", hpdj540_sizes, hpdj540_custom_sizes, |
741 | | 0.13f*BP_PER_IN, ci_hpdj540 } }, |
742 | | { HPDJ550C, pcl_level_3plus_S5, |
743 | | { "HP DeskJet 550C", common_sizes, NULL, 0.13f*BP_PER_IN, ci_hpdj5xx_cmyk }}, |
744 | | { HPDJ560C, pcl_level_3plus_S5, |
745 | | { "HP DeskJet 560C", common_sizes, NULL, 0.13f*BP_PER_IN, ci_hpdj5xx_cmyk }}, |
746 | | { pcl3_generic_old, pcl_level_3plus_ERG_both, |
747 | | { "unspecified PCL-3+ printer (old)", common_sizes, NULL, 0.0, ci_any } }, |
748 | | { HPDJ600, pcl_level_3plus_S68, |
749 | | { "HP DeskJet 600", hpdj6xx_and_8xx_sizes, hpdj_6xx_and_8xx_custom_sizes, |
750 | | 0.13f*BP_PER_IN, ci_hpdj600 } }, |
751 | | { HPDJ660C, pcl_level_3plus_S68, |
752 | | { "HP DeskJet 660C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes, |
753 | | 0.13f*BP_PER_IN, ci_hpdj6xx } }, |
754 | | { HPDJ670C, pcl_level_3plus_S68, |
755 | | { "HP DeskJet 670C", hpdj660c_sizes, hpdj_6xx_and_8xx_custom_sizes, |
756 | | 0.13f*BP_PER_IN, ci_hpdj6xx } }, |
757 | | /* This printer can be treated as the DJ 660C (DJ6/8 p. 2). */ |
758 | | { HPDJ680C, pcl_level_3plus_S68, |
759 | | { "HP DeskJet 680C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes, |
760 | | 0.13f*BP_PER_IN, ci_hpdj6xx } }, |
761 | | { HPDJ690C, pcl_level_3plus_S68, |
762 | | { "HP DeskJet 690C", hpdj680c_sizes, hpdj_6xx_and_8xx_custom_sizes, |
763 | | 0.13f*BP_PER_IN, ci_hpdj6xx } }, |
764 | | { HPDJ850C, pcl_level_3plus_S68, |
765 | | { "HP DeskJet 850C", hpdj850c_sizes, hpdj850c_custom_sizes, |
766 | | 0.0, ci_hpdj85x } }, |
767 | | { HPDJ855C, pcl_level_3plus_S68, |
768 | | { "HP DeskJet 855C", hpdj850c_sizes, hpdj850c_custom_sizes, |
769 | | 0.0, ci_hpdj85x } }, |
770 | | /* I'm treating the 870C and the 890C just as the 85xCs. */ |
771 | | { HPDJ870C, pcl_level_3plus_S68, |
772 | | { "HP DeskJet 870C", hpdj850c_sizes, hpdj850c_custom_sizes, |
773 | | 0.0, ci_hpdj85x } }, |
774 | | { HPDJ890C, pcl_level_3plus_S68, |
775 | | { "HP DeskJet 890C", hpdj850c_sizes, hpdj850c_custom_sizes, |
776 | | 0.0, ci_hpdj85x } }, |
777 | | { HPDJ1120C, pcl_level_3plus_S68, |
778 | | { "HP DeskJet 1120C", hpdj1120c_sizes, hpdj1120c_custom_sizes, |
779 | | 0.0, ci_hpdj1120c } }, |
780 | | { pcl3_generic_new, pcl_level_3plus_S68, |
781 | | {"unspecified PCL-3+ printer", |
782 | | hpdj850c_sizes, any_custom_sizes, 0.0, ci_any }} |
783 | | }; |
784 | | |
785 | | /*****************************************************************************/ |
786 | | #undef CHECK_CONSTRAINTS |
787 | | |
788 | | #ifdef CHECK_CONSTRAINTS |
789 | | static int checked = 0; |
790 | | |
791 | | static void check(void) |
792 | | { |
793 | | int j; |
794 | | |
795 | | /* Check that 'pcl3_printers[]' is indexed by printer code */ |
796 | | for (j = 0; j < array_size(pcl3_printers); j++) |
797 | | assert(pcl3_printers[j].id == j); |
798 | | |
799 | | checked = 1; |
800 | | |
801 | | return; |
802 | | } |
803 | | #endif |
804 | | |
805 | | /****************************************************************************** |
806 | | |
807 | | Function: pcl3_fill_defaults |
808 | | |
809 | | This function overwrites all fields in '*data' irrespective of their old |
810 | | contents and replaces them with default values acceptable for the printer. |
811 | | In particular, everything which is printer-specific and cannot be chosen by |
812 | | the user will be set in accordance with 'printer'. |
813 | | |
814 | | ******************************************************************************/ |
815 | | |
816 | | void pcl3_fill_defaults(pcl_Printer printer, pcl_FileData *data) |
817 | 0 | { |
818 | | #ifdef CHECK_CONSTRAINTS |
819 | | if (!checked) check(); |
820 | | #endif |
821 | | |
822 | | /* Set everything to zero */ |
823 | 0 | memset(data, 0, sizeof(pcl_FileData)); |
824 | | |
825 | | /* Data which must not be zero */ |
826 | | /* At present, every printer listed here supports 300 ppi monochrome data |
827 | | with two intensity levels. Hence we need not look at the printer |
828 | | description. */ |
829 | 0 | data->number_of_colorants = 1; |
830 | 0 | data->colorant_array[0].hres = data->colorant_array[0].vres = 300; |
831 | 0 | data->colorant_array[0].levels = 2; |
832 | | |
833 | | /* Data which are fixed by the printer model */ |
834 | 0 | data->level = pcl3_printers[printer].level; |
835 | | |
836 | | /* Data for which zero is acceptable but not sensible */ |
837 | 0 | data->duplex = -1; /* no simplex/duplex requests */ |
838 | 0 | data->dry_time = -1; /* request no dry time */ |
839 | 0 | switch (printer) { |
840 | 0 | case HPDeskJet: |
841 | | /*FALLTHROUGH*/ |
842 | 0 | case HPDeskJetPlus: |
843 | | /*FALLTHROUGH*/ |
844 | 0 | case HPDJ500: |
845 | | /* The DJ 500 does not support method 9 but it does support method 3 |
846 | | (TRG500). I am guessing that the same is true for the HP DeskJet and |
847 | | the HP DeskJet Plus. */ |
848 | 0 | data->compression = pcl_cm_delta; |
849 | 0 | break; |
850 | 0 | case pcl3_generic_old: |
851 | | /*FALLTHROUGH*/ |
852 | 0 | case pcl3_generic_new: |
853 | | /* All HP drivers I have seen use method 2 when writing a PCL file to |
854 | | disk. Presumably, this is the most portable compression method. */ |
855 | 0 | data->compression = pcl_cm_tiff; |
856 | 0 | break; |
857 | 0 | default: |
858 | | /* The best compression method, but not always supported. */ |
859 | 0 | data->compression = pcl_cm_crdr; |
860 | 0 | } |
861 | | |
862 | | /* Derived data */ |
863 | 0 | pcl3_set_oldquality(data); |
864 | |
|
865 | 0 | return; |
866 | 0 | } |