]>
Commit | Line | Data |
---|---|---|
9b63babf MK |
1 | diff -uNr pbm2ppa-0.8.6/CALIBRATION pbm2ppa-20000205/CALIBRATION |
2 | --- pbm2ppa-0.8.6/CALIBRATION Sat Aug 22 09:44:07 1998 | |
3 | +++ pbm2ppa-20000205/CALIBRATION Sun Feb 6 01:32:25 2000 | |
4 | @@ -10,9 +10,22 @@ | |
5 | The 'pbmtpg' program generates a full-page (8.5"x11") test pattern in | |
6 | pbmraw (P4) format on stdout. The output may be fed directly into pbm2ppa | |
7 | in order to print a calibration pattern on your printer with commands such as: | |
8 | +Assuming you printer is on /dev/lp0 | |
9 | ||
10 | - pbmtpg | pbm2ppa > /dev/lp1 | |
11 | + pbmtpg | pbm2ppa > /dev/lp0 | |
12 | ( as root ) | |
13 | +(Note: /dev/lp0 is the default device for the primary parallel port on systems | |
14 | +with 2.2.x or later Linux kernels; it is /dev/lp1 on systems with | |
15 | +older Linux 2.0.x kernels) | |
16 | + | |
17 | +For other papersizes, the command must specify a valid size, for both | |
18 | +pbmtpg and pbm2ppa: | |
19 | + | |
20 | + pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp0 | |
21 | + pbmtpg -legal | pbm2ppa -s legal > /dev/lp0 | |
22 | + pbmtpg -letter | pbm2ppa -s letter > /dev/lp0 | |
23 | + | |
24 | +For A4, US Legal of US Letter (default). | |
25 | ||
26 | - or - | |
27 | ||
28 | @@ -33,3 +46,7 @@ | |
29 | causing the printer to choke with 'blinking lights syndrome'. | |
30 | ||
31 | [TODO: Add shearing adjustments to pbm2ppa and explain here] | |
32 | + | |
33 | + | |
34 | + | |
35 | + | |
36 | diff -uNr pbm2ppa-0.8.6/INSTALL pbm2ppa-20000205/INSTALL | |
37 | --- pbm2ppa-0.8.6/INSTALL Sun Oct 18 21:27:16 1998 | |
38 | +++ pbm2ppa-20000205/INSTALL Sat Feb 5 14:14:54 2000 | |
39 | @@ -1,6 +1,6 @@ | |
40 | Overview | |
41 | -------- | |
42 | -This file contains some quick notes on installation in general. For a | |
43 | + This file contains some quick notes on installation in general. For a | |
44 | complete step-by-step instruction on how to install pbm2ppa for your | |
45 | printer, please see INSTALL-MORE. (It was written for the 820, but it | |
46 | should work for all supported models) Thanks to Michael Buehlmann for | |
47 | @@ -9,14 +9,19 @@ | |
48 | Compilation | |
49 | ----------- | |
50 | To compile, you should simply run 'make' with the series of your | |
51 | -printer. The following options are supported: | |
52 | +printer. This will set the default printer to the HP720 series. | |
53 | +To specify a different default printyer, the following options are supported: | |
54 | ||
55 | make 720 # for 720 series - e.g. 722C | |
56 | make 820 # for 820 series - e.g. 820Cse | |
57 | make 1000 # for 1000 series | |
58 | ||
59 | -If you choose to recompile for a different printer series, you must 'make | |
60 | -clean' first. | |
61 | + If you choose to recompile for a different default printer series, | |
62 | +you must 'make clean' first. However, the default printer choice | |
63 | +selected at compilation time can be overridden with e.g., the | |
64 | +"pbm2pppa -v 820 ..." command line option, or specified by e.g., | |
65 | +a "version 820" entry in the /etc/pbm2ppa.conf file. | |
66 | +Type "pbm2ppa -h" to see the list of options. | |
67 | ||
68 | Installation | |
69 | ------------ | |
70 | @@ -26,17 +31,23 @@ | |
71 | ||
72 | The other binary created, pbm2ppa, is a converter from a PBM | |
73 | image to a stream of PPA data that can be sent directly to the printer. | |
74 | -The PBM image is expected to be 600 dpi, 8.5"x11". These files can be | |
75 | +The PBM image is expected to be 600 dpi, and the paper size | |
76 | +can be 8.5"x11" (US Letter), 8.5"x14" (US Legal) or A4. These files can be | |
77 | generated with ghostscript. Both the pbm and pbmraw devices are supported. | |
78 | pbmraw is MUCH faster, so use it if you have it available! | |
79 | +IMPORTANT: the PAPERSIZE option passed to ghostscript must match | |
80 | +the paper size specified for pbm2ppa. | |
81 | +Valid papersizes are: "letter" = "us" , "legal" , and "a4" . | |
82 | ||
83 | Use | |
84 | --- | |
85 | - To print a postscript file with this program, I use a simple | |
86 | -shell script: | |
87 | + To print a postscript file with this program, on US Letter | |
88 | +paper and a HP 710/720 series printer, I use a simple shell script: | |
89 | ||
90 | -cat $1 | gs -sDEVICE=pbm -q -dNOPAUSE -r600 -sOutputFile=- - | \ | |
91 | -pbm2ppa - - | lpr | |
92 | +cat $1 | gs -sDEVICE=pbm -q -dNOPAUSE -r600 -sPAPERSIZE=letter -sOutputFile=- - | \ | |
93 | +pbm2ppa -s letter -v 720 - - | lpr -l | |
94 | + | |
95 | +Valid printer versions are "720", "820" and "1000". | |
96 | ||
97 | You can also set up a printer filter. See the documentation for | |
98 | your print spooler for information on how to do that, or look in | |
99 | diff -uNr pbm2ppa-0.8.6/INSTALL-MORE pbm2ppa-20000205/INSTALL-MORE | |
100 | --- pbm2ppa-0.8.6/INSTALL-MORE Sun Oct 18 21:27:17 1998 | |
101 | +++ pbm2ppa-20000205/INSTALL-MORE Sat Feb 5 04:34:45 2000 | |
102 | @@ -36,14 +36,21 @@ | |
103 | file). | |
104 | ||
105 | ||
106 | -2. To adjust the paper size to DIN A4, use the -s a4 option to pbm2ppa or | |
107 | +2. To adjust the paper size to US Legal (8.5"x14"), use the -s legal option | |
108 | +to pbm2ppa or change your pbm2ppa.conf file to read "papersize legal" | |
109 | +To adjust the paper size to DIN A4, use the -s a4 option to pbm2ppa or | |
110 | change your pbm2ppa.conf file to read "papersize a4" (see step 5). | |
111 | - | |
112 | +For US Letter (8.5"x11") paper is the default; "-s us", "-s letter", | |
113 | +"papersize us" and "papersize letter" also specif this size. | |
114 | ||
115 | 3. You can now calibrate the printer with | |
116 | ||
117 | -For US size paper: | |
118 | +For US Letter size paper: | |
119 | # pbmtpg | pbm2ppa > /dev/lp1 ( as root ) | |
120 | +or | |
121 | +# pbmtpg -letter | pbm2ppa > /dev/lp1 ( as root ) | |
122 | +For US Legal size paper: | |
123 | +# pbmtpg -legal | pbm2ppa -s a4 > /dev/lp1 ( as root ) | |
124 | For A4 size paper: | |
125 | # pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp1 ( as root ) | |
126 | ||
127 | diff -uNr pbm2ppa-0.8.6/Makefile pbm2ppa-20000205/Makefile | |
128 | --- pbm2ppa-0.8.6/Makefile Sun Oct 11 11:17:16 1998 | |
129 | +++ pbm2ppa-20000205/Makefile Sat Feb 5 04:34:45 2000 | |
130 | @@ -1,36 +1,23 @@ | |
131 | CC=gcc | |
132 | -CFLAGS=-Wall -O2 | |
133 | +CFLAGS=-Wall -O2 | |
134 | LDFLAGS= | |
135 | +PRINTER=HP720 | |
136 | ||
137 | -default: | |
138 | - @echo Please specify the type of printer you wish to compile this | |
139 | - @echo software for. Supported options are: | |
140 | - @echo | |
141 | - @echo make 720 | |
142 | - @echo make 820 | |
143 | - @echo make 1000 | |
144 | - @echo | |
145 | - @exit | |
146 | +default: all | |
147 | ||
148 | -720.h: | |
149 | - cp defaults.720.h defaults.h | |
150 | +720: PRINTER=HP720 | |
151 | +720: all | |
152 | ||
153 | -820.h: | |
154 | - cp defaults.820.h defaults.h | |
155 | +820: PRINTER=HP820 | |
156 | +820: all | |
157 | ||
158 | -1000.h: | |
159 | - cp defaults.1000.h defaults.h | |
160 | +1000: PRINTER=HP1000 | |
161 | +1000: all | |
162 | ||
163 | -720: 720.h all | |
164 | - | |
165 | -820: 820.h all | |
166 | - | |
167 | -1000: 1000.h all | |
168 | - | |
169 | -all: defaults.h pbm2ppa pbmtpg | |
170 | +all: pbm2ppa pbmtpg | |
171 | ||
172 | clean: | |
173 | - rm -f *.o *~ pbmtpg pbm2ppa defaults.h | |
174 | + rm -f *.o *~ pbmtpg pbm2ppa | |
175 | ||
176 | pbm2ppa: pbm2ppa.o ppa.o pbm.o cutswath.o | |
177 | $(CC) $(LDFLAGS) -o pbm2ppa pbm2ppa.o ppa.o pbm.o cutswath.o | |
178 | @@ -39,4 +26,11 @@ | |
179 | $(CC) $(CFLAGS) -o pbmtpg pbmtpg.o -lm | |
180 | ||
181 | .c.o: $*.c ppa.h pbm.h | |
182 | - $(CC) $(CFLAGS) -c $*.c | |
183 | + $(CC) $(CFLAGS) -DDEFAULT_PRINTER=$(PRINTER) -c $*.c | |
184 | + | |
185 | + | |
186 | + | |
187 | + | |
188 | + | |
189 | + | |
190 | + | |
191 | diff -uNr pbm2ppa-0.8.6/README.REDHAT pbm2ppa-20000205/README.REDHAT | |
192 | --- pbm2ppa-0.8.6/README.REDHAT Sat Aug 22 09:48:40 1998 | |
193 | +++ pbm2ppa-20000205/README.REDHAT Sun Feb 6 00:53:29 2000 | |
194 | @@ -1,12 +1,28 @@ | |
195 | -RedHat users may find the following tip from Panayotis Vryonis <vrypan@hol.gr> | |
196 | -helpful! | |
197 | +The best way to integrate support for the HP PPA Printers into RedHat's | |
198 | +Linux Print System Manager (printtool) is to replace e.g., the | |
199 | +rhs-printfilters-1.57-3 RPM package that comes with Red Hat 6.1, | |
200 | +with a PPA-aware version from the pnm2ppa project whic h has a | |
201 | +homepage at http://www.sourceforge.net/projects/?group_id=1322 | |
202 | ||
203 | -Here is a tip to intergrate HP720C support in RedHat's printtool: | |
204 | +At the time of writing, the latest release is | |
205 | + rhs-printfilters-1.57-4ppa1 | |
206 | +This package includes support for both pbm2ppa and the new | |
207 | +color driver pnm2ppa. | |
208 | ||
209 | -Install pbm2ppa. Copy pbm2ppa to /usr/bin. | |
210 | -Edit "printerdb" (in my system it is found in | |
211 | -/usr/lib/rhs/rhs-printfilters ) | |
212 | -and append the following lines: | |
213 | + ------------------------------------- | |
214 | + | |
215 | +If for some reason, they cannot use this PPA-aware version of | |
216 | +rhs-printfilters, RedHat users may still find the following tip from | |
217 | +Panayotis Vryonis <vrypan@hol.gr> helpful! | |
218 | +It will work with the standard rhs-printfilters that comes with the | |
219 | +Red Hat release: | |
220 | + | |
221 | + Here is a tip to integrate HP720C support in RedHat's printtool: | |
222 | + | |
223 | + Install pbm2ppa. Copy pbm2ppa to /usr/bin. | |
224 | + Edit "printerdb" (in my system it is found in | |
225 | + /usr/lib/rhs/rhs-printfilters ) | |
226 | + and append the following lines: | |
227 | ----------------------Cut here | |
228 | ------------------------------------------- | |
229 | StartEntry: DeskJet720C | |
230 | @@ -23,7 +39,11 @@ | |
231 | EndEntry | |
232 | -------------------------------------------------------------------------- | |
233 | ||
234 | -Now you can add an HP720C printer just like any other, using printtool. | |
235 | + Now you can add an HP720C printer just like any other, using printtool. | |
236 | + | |
237 | + [Author's (P. Vryonis) Note: The same should work for the 820 and | |
238 | + 1000, but it hasn't been tested. Also, use the pbmraw GSDriver if | |
239 | + you have it; it's faster. ] | |
240 | + | |
241 | + | |
242 | ||
243 | -[Author's Note: The same should work for the 820 and 1000, but it hasn't | |
244 | -been tested. Also, use the pbmraw GSDriver if you have it; it's faster. ] | |
245 | diff -uNr pbm2ppa-0.8.6/defaults.1000.h pbm2ppa-20000205/defaults.1000.h | |
246 | --- pbm2ppa-0.8.6/defaults.1000.h Sat Aug 22 09:44:12 1998 | |
247 | +++ pbm2ppa-20000205/defaults.1000.h Wed Dec 31 19:00:00 1969 | |
248 | @@ -1,19 +0,0 @@ | |
249 | -/* defaults.h | |
250 | - * Default printer values. Edit these and recompile if so desired. | |
251 | - * [Note: a /etc/pbm2ppa.conf file will override these] | |
252 | - */ | |
253 | -#ifndef _DEFAULTS_H | |
254 | -#define _DEFAULTS_H | |
255 | - | |
256 | -#define DEFAULT_PRINTER ( HP1000 ) | |
257 | - | |
258 | -/* Refer to CALIBRATION file about these settings */ | |
259 | -#define DEFAULT_X_OFFSET ( 100 ) | |
260 | -#define DEFAULT_Y_OFFSET ( -650 ) | |
261 | - | |
262 | -#define DEFAULT_TOP_MARGIN ( 150 ) | |
263 | -#define DEFAULT_LEFT_MARGIN ( 150 ) | |
264 | -#define DEFAULT_RIGHT_MARGIN ( 150 ) | |
265 | -#define DEFAULT_BOTTOM_MARGIN ( 150 ) | |
266 | - | |
267 | -#endif | |
268 | diff -uNr pbm2ppa-0.8.6/defaults.720.h pbm2ppa-20000205/defaults.720.h | |
269 | --- pbm2ppa-0.8.6/defaults.720.h Sat Aug 22 09:44:12 1998 | |
270 | +++ pbm2ppa-20000205/defaults.720.h Wed Dec 31 19:00:00 1969 | |
271 | @@ -1,19 +0,0 @@ | |
272 | -/* defaults.h | |
273 | - * Default printer values. Edit these and recompile if so desired. | |
274 | - * [Note: a /etc/pbm2ppa.conf file will override these] | |
275 | - */ | |
276 | -#ifndef _DEFAULTS_H | |
277 | -#define _DEFAULTS_H | |
278 | - | |
279 | -#define DEFAULT_PRINTER ( HP720 ) | |
280 | - | |
281 | -/* Refer to CALIBRATION file about these settings */ | |
282 | -#define DEFAULT_X_OFFSET ( 169 ) | |
283 | -#define DEFAULT_Y_OFFSET ( -569 ) | |
284 | - | |
285 | -#define DEFAULT_TOP_MARGIN ( 150 ) | |
286 | -#define DEFAULT_LEFT_MARGIN ( 150 ) | |
287 | -#define DEFAULT_RIGHT_MARGIN ( 150 ) | |
288 | -#define DEFAULT_BOTTOM_MARGIN ( 150 ) | |
289 | - | |
290 | -#endif | |
291 | diff -uNr pbm2ppa-0.8.6/defaults.820.h pbm2ppa-20000205/defaults.820.h | |
292 | --- pbm2ppa-0.8.6/defaults.820.h Sat Aug 22 09:44:12 1998 | |
293 | +++ pbm2ppa-20000205/defaults.820.h Wed Dec 31 19:00:00 1969 | |
294 | @@ -1,19 +0,0 @@ | |
295 | -/* defaults.h | |
296 | - * Default printer values. Edit these and recompile if so desired. | |
297 | - * [Note: a /etc/pbm2ppa.conf file will override these] | |
298 | - */ | |
299 | -#ifndef _DEFAULTS_H | |
300 | -#define _DEFAULTS_H | |
301 | - | |
302 | -#define DEFAULT_PRINTER ( HP820 ) | |
303 | - | |
304 | -/* Refer to CALIBRATION file about these settings */ | |
305 | -#define DEFAULT_X_OFFSET ( 75 ) | |
306 | -#define DEFAULT_Y_OFFSET ( -500 ) | |
307 | - | |
308 | -#define DEFAULT_TOP_MARGIN ( 80 ) | |
309 | -#define DEFAULT_LEFT_MARGIN ( 80 ) | |
310 | -#define DEFAULT_RIGHT_MARGIN ( 80 ) | |
311 | -#define DEFAULT_BOTTOM_MARGIN ( 150 ) | |
312 | - | |
313 | -#endif | |
314 | diff -uNr pbm2ppa-0.8.6/defaults.h pbm2ppa-20000205/defaults.h | |
315 | --- pbm2ppa-0.8.6/defaults.h Wed Dec 31 19:00:00 1969 | |
316 | +++ pbm2ppa-20000205/defaults.h Sat Feb 5 04:34:45 2000 | |
317 | @@ -0,0 +1,53 @@ | |
318 | +/* defaults.h | |
319 | + * Default printer values. Edit these and recompile if so desired. | |
320 | + * [Note: a /etc/pbm2ppa.conf file will override these] | |
321 | + */ | |
322 | + | |
323 | +#ifndef _DEFAULTS_H | |
324 | +#define _DEFAULTS_H | |
325 | + | |
326 | +#ifndef DEFAULT_PRINTER | |
327 | +#define DEFAULT_PRINTER ( HP720 ) | |
328 | +#endif | |
329 | + | |
330 | +/* for HP720 series */ | |
331 | +/* Refer to CALIBRATION file about these settings */ | |
332 | +#define HP720_X_OFFSET ( 169 ) | |
333 | +#define HP720_Y_OFFSET ( -569 ) | |
334 | + | |
335 | +#define HP720_TOP_MARGIN ( 150 ) | |
336 | +#define HP720_LEFT_MARGIN ( 150 ) | |
337 | +#define HP720_RIGHT_MARGIN ( 150 ) | |
338 | +#define HP720_BOTTOM_MARGIN ( 150 ) | |
339 | + | |
340 | +/* for HP820 series */ | |
341 | +/* Refer to CALIBRATION file about these settings */ | |
342 | +#define HP820_X_OFFSET ( 75 ) | |
343 | +#define HP820_Y_OFFSET ( -500 ) | |
344 | + | |
345 | +#define HP820_TOP_MARGIN ( 80 ) | |
346 | +#define HP820_LEFT_MARGIN ( 80 ) | |
347 | +#define HP820_RIGHT_MARGIN ( 80 ) | |
348 | +#define HP820_BOTTOM_MARGIN ( 150 ) | |
349 | + | |
350 | +/* for HP1000 series */ | |
351 | +/* Refer to CALIBRATION file about these settings */ | |
352 | +#define HP1000_X_OFFSET ( 100 ) | |
353 | +#define HP1000_Y_OFFSET ( -650 ) | |
354 | + | |
355 | +#define HP1000_TOP_MARGIN ( 150 ) | |
356 | +#define HP1000_LEFT_MARGIN ( 150 ) | |
357 | +#define HP1000_RIGHT_MARGIN ( 150 ) | |
358 | +#define HP1000_BOTTOM_MARGIN ( 150 ) | |
359 | + | |
360 | +#endif | |
361 | + | |
362 | + | |
363 | + | |
364 | + | |
365 | + | |
366 | + | |
367 | + | |
368 | + | |
369 | + | |
370 | + | |
371 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.1 pbm2ppa-20000205/pbm2ppa.1 | |
372 | --- pbm2ppa-0.8.6/pbm2ppa.1 Wed Dec 31 19:00:00 1969 | |
373 | +++ pbm2ppa-20000205/pbm2ppa.1 Sun Feb 6 00:11:42 2000 | |
374 | @@ -0,0 +1,135 @@ | |
375 | +.TH pnm2ppa "5 Feb 2000" | |
376 | +.SH NAME | |
377 | +pbm2ppa - convert portable bitmap (PBM) to HP's Printing Performance Architecture (PPA) file format | |
378 | +.SH SYNOPSIS | |
379 | +pbm2ppa [options] [ <\fIinfile\fR] > [ <\fIoutfile\fR]> ] ] | |
380 | + | |
381 | +.SH DESCRIPTION | |
382 | +Reads portable bitmap (PBM) format as input. Outputs a stream suitable for | |
383 | +processing by Hewlett-Packard's range of Printing Performance Architecture | |
384 | +(PPA) printers. | |
385 | +pnm2ppa supports the HP 710c, 712c, 720c, 722c, 820c, and 1000c | |
386 | +series printers. | |
387 | +.PP | |
388 | +(Portable bitmap (PBM) format output can be produced from PostScript(tm) input | |
389 | +by the GhostScript driver "pbmraw".) | |
390 | +.PP | |
391 | + | |
392 | + | |
393 | +.SH OPTIONS | |
394 | +.\"{{{ infile | |
395 | +.IP "\fB\\fIinfile\fR \fP" | |
396 | +Input file \fIinfile\fR is either a path to a file or device, or '-' to indicate stdin (defaults to stdin) | |
397 | +.\"}}} | |
398 | + | |
399 | + | |
400 | +.\"{{{ outfile | |
401 | +.IP "\fB\\fIoutfile\fR \fP" | |
402 | +Output file \fIoutfile\fR is either a path to a file or device, or '-' to indicate stdout (defaults to stdout) | |
403 | +.\"}}} | |
404 | + | |
405 | + | |
406 | +.\"{{{ -b bottommargin | |
407 | +.IP "\fB\-b \fIbottommargin\fR\fP" | |
408 | +Sets the bottom margin \fIbottommargin\fR in units of 1/600 inches (e.g., -b 150 = 0.25") | |
409 | +.\"}}} | |
410 | + | |
411 | + | |
412 | +.\"{{{ -d | |
413 | +.IP "\fB\-d\fP" | |
414 | +Displays the current configuration | |
415 | +.\"}}} | |
416 | + | |
417 | + | |
418 | +.\"{{{ -f configfile | |
419 | +.IP "\fB\-f \fIconfigfile\fR\fP" | |
420 | +Overrides reading the configuration from /etc/pnm2ppa.conf, and uses | |
421 | +\fIconfigfile\fR instead. | |
422 | +.\"}}} | |
423 | + | |
424 | + | |
425 | +.\"{{{ -h | |
426 | +.IP "\fB\-h\fP" | |
427 | +Displays program usage | |
428 | +.\"}}} | |
429 | + | |
430 | + | |
431 | + | |
432 | +.\"{{{ -l leftmargin | |
433 | +.IP "\fB\-l \fIleftmargin\fR\fP" | |
434 | +Sets the left margin \fIleftmargin\fR in units of 1/600 inches (e.g., -l 150 = 0.25") | |
435 | +.\"}}} | |
436 | + | |
437 | + | |
438 | +.\"{{{ -r rightmargin | |
439 | +.IP "\fB\-r \fIrightmargin\fR\fP" | |
440 | +Sets the right margin \fIrightmargin\fR in units of 1/600 inches (e.g., -r 150 = 0.25") | |
441 | +.\"}}} | |
442 | + | |
443 | +.\"{{{ -s papersize | |
444 | +.IP "\fB\-s \fIpapersize\fR\fP" | |
445 | +Sets the paper size. Possible values for \fIpapersize\fR are \fBa4\fP (A4), | |
446 | +\fBletter\fP or \fBus\fP (US Letter, 8.5"x11"), and \fBlegal\fR (US Legal, | |
447 | +8.5"x14"). | |
448 | +The default is US Letter. | |
449 | +.\"}}} | |
450 | + | |
451 | +.\"{{{ -t topmargin | |
452 | +.IP "\fB\-t \fItopmargin\fR\fP" | |
453 | +Sets the top margin \fItopmargin\fR in units of 1/600 inches (ie -t 150 = 0.25") | |
454 | +.\"}}} | |
455 | + | |
456 | +.\"{{{ -v printertype | |
457 | +.IP "\fB\-v \fIprintertype\fP" | |
458 | +Selects the printer model. Possible values of \fIprintertype\fR are: | |
459 | +\fB710\fP, \fB712\fP, \fB720\fP, \fB722\fP, \fB820\fP and \fB1000\fP. | |
460 | +The default is the HP DeskJet 7X0 Series (710, 712, 720, 722). | |
461 | +.\"}}} | |
462 | + | |
463 | + | |
464 | +.\"{{{ -x xoffset | |
465 | +.IP "\fB\-x \fIxoffset\fR\fP" | |
466 | +Sets the x-offset \fBxoffset\fR from the left of the page. Units are 1/600 inches | |
467 | +.\"}}} | |
468 | + | |
469 | +.\"{{{ -y yoffset | |
470 | +.IP "\fB\-y \fIyoffset\fR\fP" | |
471 | +Sets the y-offset \fByoffset\fR from the top of the page. Units are 1/600 inches | |
472 | +.\"}}} | |
473 | + | |
474 | + | |
475 | +.SH NOTES | |
476 | +The configuration file is read in first. Command line arguments then modify the resulting definitions. | |
477 | +.PP | |
478 | +The -x and -y options accumulate. The -v option resets all definitions back to | |
479 | +an inbuilt default for that printer and should be used before subsequent -b -l -r, -t, -x, and -y arguments. | |
480 | +.SH "SEE ALSO" | |
481 | +pbm(5) | |
482 | + | |
483 | +.SH FILES | |
484 | + | |
485 | +.\"{{{ /etc/pbm2ppa.conf | |
486 | +.IP "\fB\fI/etc/pbm2ppa.conf\fR\fP" | |
487 | +Default configuration file | |
488 | +.\"}}} | |
489 | + | |
490 | + | |
491 | +.SH AUTHOR | |
492 | +This code is licensed under the GNU Public License version 2. See | |
493 | +LICENSE for details. | |
494 | +.PP | |
495 | +(c) 1998 Tim Norman | |
496 | +.PP | |
497 | +.SH HISTORY | |
498 | +This program was written by Tim Norman. It originally | |
499 | +supported black and white output on the 820 series. This program is | |
500 | +almost obsolete; its successor pnm2ppa will support color printing. | |
501 | +.SH BUGS | |
502 | +This is a stable driver, but does not support color printing. | |
503 | + | |
504 | + | |
505 | + | |
506 | + | |
507 | + | |
508 | + | |
509 | + | |
510 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.c pbm2ppa-20000205/pbm2ppa.c | |
511 | --- pbm2ppa-0.8.6/pbm2ppa.c Tue Sep 15 20:00:27 1998 | |
512 | +++ pbm2ppa-20000205/pbm2ppa.c Sat Feb 5 17:27:58 2000 | |
513 | @@ -17,10 +17,15 @@ | |
514 | ||
515 | /* Paper sizes in 600ths of an inch. */ | |
516 | ||
517 | -/* US is 8.5 in by 11 in */ | |
518 | +/* US Letter is 8.5 in by 11 in */ | |
519 | ||
520 | -#define USWIDTH (5100) | |
521 | -#define USHEIGHT (6600) | |
522 | +#define LETTERWIDTH (5100) | |
523 | +#define LETTERHEIGHT (6600) | |
524 | + | |
525 | +/* US Legal is 8.5 in by 14 in */ | |
526 | + | |
527 | +#define LEGALWIDTH (5100) | |
528 | +#define LEGALHEIGHT (8400) | |
529 | ||
530 | /* A4 is 210 mm by 297 mm == 8.27 in by 11.69 in */ | |
531 | ||
532 | @@ -121,16 +126,35 @@ | |
533 | ||
534 | void set_printer_specific_defaults() | |
535 | { | |
536 | - printer.x_offset=DEFAULT_X_OFFSET; | |
537 | - printer.y_offset=DEFAULT_Y_OFFSET; | |
538 | switch(printer.version) | |
539 | { | |
540 | case HP720: | |
541 | + printer.x_offset=HP720_X_OFFSET; | |
542 | + printer.y_offset=HP720_Y_OFFSET; | |
543 | + printer.top_margin=HP720_TOP_MARGIN; | |
544 | + printer.left_margin=HP720_LEFT_MARGIN; | |
545 | + printer.right_margin=HP720_RIGHT_MARGIN; | |
546 | + printer.bottom_margin=HP720_BOTTOM_MARGIN; | |
547 | printer.marg_diff=2; | |
548 | printer.bufsize = 200*1024; | |
549 | break; | |
550 | case HP820: | |
551 | + printer.x_offset=HP820_X_OFFSET; | |
552 | + printer.y_offset=HP820_Y_OFFSET; | |
553 | + printer.top_margin=HP820_TOP_MARGIN; | |
554 | + printer.left_margin=HP820_LEFT_MARGIN; | |
555 | + printer.right_margin=HP820_RIGHT_MARGIN; | |
556 | + printer.bottom_margin=HP820_BOTTOM_MARGIN; | |
557 | + printer.marg_diff=0x62; | |
558 | + printer.bufsize = 100*1024; | |
559 | + break; | |
560 | case HP1000: | |
561 | + printer.x_offset=HP1000_X_OFFSET; | |
562 | + printer.y_offset=HP1000_Y_OFFSET; | |
563 | + printer.top_margin=HP1000_TOP_MARGIN; | |
564 | + printer.left_margin=HP1000_LEFT_MARGIN; | |
565 | + printer.right_margin=HP1000_RIGHT_MARGIN; | |
566 | + printer.bottom_margin=HP1000_BOTTOM_MARGIN; | |
567 | printer.marg_diff=0x62; | |
568 | printer.bufsize = 100*1024; | |
569 | break; | |
570 | @@ -144,15 +168,17 @@ | |
571 | { | |
572 | printf("usage: %s [ options ] [ <infile> [ <outfile> ] ]\n\n",prog); | |
573 | printf(" Prints a pbm- or pbmraw-format <infile> to HP720/820/1000-format <outfile>.\n\n"); | |
574 | - printf(" -v <version> printer version (720, 820, or 1000)\n"); | |
575 | - printf(" -x <xoff> vertical offset adjustment in 1\"/600\n"); | |
576 | - printf(" -y <yoff> horizontal offset adjustment in 1\"/600\n"); | |
577 | - printf(" -t <topmarg> top margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
578 | - printf(" -l <leftmarg> left margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
579 | - printf(" -r <rightmarg> right margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
580 | - printf(" -b <botmarg> bottom margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
581 | - printf(" -s <paper> paper size (us, a4, default: us)\n"); | |
582 | + printf(" -b <margin> bottom margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
583 | + printf(" -d dumps the configuration to stdout"); | |
584 | printf(" -f <cfgfile> read <cfgfile> as parameters\n\n"); | |
585 | + printf(" -h displays this help text"); | |
586 | + printf(" -l <margin> left margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
587 | + printf(" -r <margin> right margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
588 | + printf(" -s <paper> paper size (us,letter,legal,a4, default: us)\n"); | |
589 | + printf(" -t <margin> top margin in 1\"/600 (default: 150 = 0.25\")\n"); | |
590 | + printf(" -v <model> printer model (710, 712, 720, 722, 820, or 1000)\n"); | |
591 | + printf(" -x <offset> vertical offset adjustment in 1\"/600\n"); | |
592 | + printf(" -y <offset> horizontal offset adjustment in 1\"/600\n"); | |
593 | printf(" The -x and -y options accumulate. The -v option resets the horizontal and\n"); | |
594 | printf(" vertical adjustments to an internal default. <infile> and <outfile> default\n"); | |
595 | printf(" to stdin and stdout. '-' is a synonym for stdin and stdout.\n\n"); | |
596 | @@ -173,7 +199,13 @@ | |
597 | ||
598 | void parm_version(char* arg) | |
599 | { | |
600 | - if(!strcasecmp(arg,"hp720") || !strcmp(arg,"720")) | |
601 | + if(!strcasecmp(arg,"hp710") || !strcmp(arg,"710")) | |
602 | + printer.version=HP720; | |
603 | + else if(!strcasecmp(arg,"hp712") || !strcmp(arg,"712")) | |
604 | + printer.version=HP720; | |
605 | + else if(!strcasecmp(arg,"hp720") || !strcmp(arg,"720")) | |
606 | + printer.version=HP720; | |
607 | + else if(!strcasecmp(arg,"hp722") || !strcmp(arg,"722")) | |
608 | printer.version=HP720; | |
609 | else if(!strcasecmp(arg,"hp820") || !strcmp(arg,"820")) | |
610 | printer.version=HP820; | |
611 | @@ -191,7 +223,10 @@ | |
612 | { | |
613 | switch(arg) | |
614 | { | |
615 | + case 710: | |
616 | + case 712: | |
617 | case 720: | |
618 | + case 722: | |
619 | printer.version=HP720; | |
620 | break; | |
621 | case 820: | |
622 | @@ -262,10 +297,15 @@ | |
623 | printer.bottom_margin=value; | |
624 | else if(!strncmp(key,"papersize",len)) | |
625 | { | |
626 | - if(!strcmp(buf,"us")) | |
627 | + if(!strcmp(buf,"us") || !strcmp(buf,"letter")) | |
628 | + { | |
629 | + Width = LETTERWIDTH; | |
630 | + Height = LETTERHEIGHT; | |
631 | + } | |
632 | + else if(!strcmp(buf,"legal")) | |
633 | { | |
634 | - Width = USWIDTH; | |
635 | - Height = USHEIGHT; | |
636 | + Width = LEGALWIDTH; | |
637 | + Height = LEGALHEIGHT; | |
638 | } | |
639 | else if(!strcmp(buf,"a4")) | |
640 | { | |
641 | @@ -313,15 +353,9 @@ | |
642 | FILE *in=stdin, *out=stdout; | |
643 | struct stat tmpstat; | |
644 | ||
645 | - printer.version = DEFAULT_PRINTER; | |
646 | - printer.x_offset = DEFAULT_X_OFFSET; | |
647 | - printer.y_offset = DEFAULT_Y_OFFSET; | |
648 | - printer.top_margin = DEFAULT_TOP_MARGIN; | |
649 | - printer.left_margin = DEFAULT_LEFT_MARGIN; | |
650 | - printer.right_margin = DEFAULT_RIGHT_MARGIN; | |
651 | - printer.bottom_margin = DEFAULT_BOTTOM_MARGIN; | |
652 | - Width = USWIDTH; | |
653 | - Height = USHEIGHT; | |
654 | + printer.version = DEFAULT_PRINTER; | |
655 | + Width = LETTERWIDTH; | |
656 | + Height = LETTERHEIGHT; | |
657 | set_printer_specific_defaults(); | |
658 | ||
659 | if(!stat(defaultcfgfile,&tmpstat)) | |
660 | @@ -356,10 +390,15 @@ | |
661 | else if(!strcmp(argv[argn],"-s")) | |
662 | { | |
663 | argn++; | |
664 | - if(!strcmp(argv[argn],"us")) | |
665 | + if(!strcmp(argv[argn],"us") || !strcmp(argv[argn],"letter")) | |
666 | { | |
667 | - Width = USWIDTH; | |
668 | - Height = USHEIGHT; | |
669 | + Width = LETTERWIDTH; | |
670 | + Height = LETTERHEIGHT; | |
671 | + } | |
672 | + else if(!strcmp(argv[argn],"legal")) | |
673 | + { | |
674 | + Width = LEGALWIDTH; | |
675 | + Height = LEGALHEIGHT; | |
676 | } | |
677 | else if(!strcmp(argv[argn],"a4")) | |
678 | { | |
679 | @@ -413,4 +452,5 @@ | |
680 | ||
681 | return print_pbm (in); | |
682 | } | |
683 | + | |
684 | ||
685 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.conf pbm2ppa-20000205/pbm2ppa.conf | |
686 | --- pbm2ppa-0.8.6/pbm2ppa.conf Wed Dec 31 19:00:00 1969 | |
687 | +++ pbm2ppa-20000205/pbm2ppa.conf Sat Feb 5 17:27:58 2000 | |
688 | @@ -0,0 +1,58 @@ | |
689 | +# Sample configuration file for the HP720/HP820/HP1000 PPA Printers | |
690 | +# | |
691 | +# This file will be automatically read upon startup if it's placed in | |
692 | +# /etc/pbm2ppa.conf | |
693 | +# | |
694 | + | |
695 | +# uncomment options (remove "#" at beginning of line) to activate them | |
696 | + | |
697 | +#valid printer versions are 710, 712, 720, 722. 820, 100 | |
698 | +# 710 = 712 = 720 = 722: HP DeskJet 710C, 712C, 720C, 722C (default) | |
699 | +# 820: HP DeskJet 820Cse, 820Cxi | |
700 | +# 1000: HP DeskJet 1000Cse, 1000Cxi | |
701 | +#version 720 | |
702 | +#version 820 | |
703 | +#version 1000 | |
704 | +# | |
705 | + | |
706 | +# valid papersizes are us, letter, legal, a4 | |
707 | +# US Letter (8.5"x11"): us, letter (default) | |
708 | +# US Legal (8.5"x14"): legal | |
709 | +# A4 : a4 | |
710 | +#papersize letter | |
711 | +#papersize legal | |
712 | +#papersize a4 | |
713 | + | |
714 | + | |
715 | +#Defaults for 720 series: | |
716 | +# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE) | |
717 | +#xoff 169 | |
718 | +#yoff -569 | |
719 | +# 1/4 inch margins all around (at 600 DPI) | |
720 | +#top 150 | |
721 | +#bottom 150 | |
722 | +#left 150 | |
723 | +#right 150 | |
724 | + | |
725 | +#Defaults for 820 series: | |
726 | +# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE) | |
727 | +#xoff 75 | |
728 | +#yoff -500 | |
729 | +# 1/4 inch margins all around (at 600 DPI) | |
730 | +#top 80 | |
731 | +#bottom 150 | |
732 | +#left 80 | |
733 | +#right 80 | |
734 | + | |
735 | +#Defaults for 820 series: | |
736 | +# X-offset, Y-Offset: (Adjust these for your printer, see CALIBRATE) | |
737 | +#xoff 100 | |
738 | +#yoff -650 | |
739 | +# 1/4 inch margins all around (at 600 DPI) | |
740 | +#top 150 | |
741 | +#bottom 150 | |
742 | +#left 150 | |
743 | +#right 150 | |
744 | + | |
745 | + | |
746 | + | |
747 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.conf.hp1000 pbm2ppa-20000205/pbm2ppa.conf.hp1000 | |
748 | --- pbm2ppa-0.8.6/pbm2ppa.conf.hp1000 Sun Oct 18 21:27:19 1998 | |
749 | +++ pbm2ppa-20000205/pbm2ppa.conf.hp1000 Wed Dec 31 19:00:00 1969 | |
750 | @@ -1,18 +0,0 @@ | |
751 | -# Sample configuration file for the HP720 | |
752 | -# | |
753 | -# This file will be automatically read upon startup if it's placed in | |
754 | -# /etc/pbm2ppa.conf | |
755 | -# | |
756 | - | |
757 | -version 1000 | |
758 | - | |
759 | -papersize us | |
760 | - | |
761 | -xoff 100 # \ Adjust these for your printer. | |
762 | -yoff -650 # / (see CALIBRATE) | |
763 | - | |
764 | -# 1/4 inch margins all around (at 600 DPI) | |
765 | -top 150 | |
766 | -bottom 150 | |
767 | -left 150 | |
768 | -right 150 | |
769 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.conf.hp720 pbm2ppa-20000205/pbm2ppa.conf.hp720 | |
770 | --- pbm2ppa-0.8.6/pbm2ppa.conf.hp720 Sun Oct 18 21:27:20 1998 | |
771 | +++ pbm2ppa-20000205/pbm2ppa.conf.hp720 Wed Dec 31 19:00:00 1969 | |
772 | @@ -1,18 +0,0 @@ | |
773 | -# Sample configuration file for the HP720 | |
774 | -# | |
775 | -# This file will be automatically read upon startup if it's placed in | |
776 | -# /etc/pbm2ppa.conf | |
777 | -# | |
778 | - | |
779 | -version 720 | |
780 | - | |
781 | -papersize us | |
782 | - | |
783 | -xoff 169 # \ Adjust these for your printer. | |
784 | -yoff -569 # / (see CALIBRATE) | |
785 | - | |
786 | -# 1/4 inch margins all around (at 600 DPI) | |
787 | -top 150 | |
788 | -bottom 150 | |
789 | -left 150 | |
790 | -right 150 | |
791 | diff -uNr pbm2ppa-0.8.6/pbm2ppa.conf.hp820 pbm2ppa-20000205/pbm2ppa.conf.hp820 | |
792 | --- pbm2ppa-0.8.6/pbm2ppa.conf.hp820 Sun Oct 18 21:27:21 1998 | |
793 | +++ pbm2ppa-20000205/pbm2ppa.conf.hp820 Wed Dec 31 19:00:00 1969 | |
794 | @@ -1,18 +0,0 @@ | |
795 | -# Sample configuration file for the HP820 | |
796 | -# | |
797 | -# This file will be automatically read upon startup if it's placed in | |
798 | -# /etc/pbm2ppa.conf | |
799 | -# | |
800 | - | |
801 | -version 820 | |
802 | - | |
803 | -papersize us | |
804 | - | |
805 | -xoff 75 # \ Adjust these for your printer. | |
806 | -yoff -500 # / (see CALIBRATE) | |
807 | - | |
808 | -# 1/4 inch margins all around (at 600 DPI) | |
809 | -top 80 | |
810 | -bottom 150 | |
811 | -left 80 | |
812 | -right 80 | |
813 | diff -uNr pbm2ppa-0.8.6/pbmtpg.c pbm2ppa-20000205/pbmtpg.c | |
814 | --- pbm2ppa-0.8.6/pbmtpg.c Tue Sep 15 20:00:28 1998 | |
815 | +++ pbm2ppa-20000205/pbmtpg.c Sat Feb 5 04:34:45 2000 | |
816 | @@ -2,12 +2,17 @@ | |
817 | #include <stdio.h> | |
818 | #include <stdlib.h> | |
819 | ||
820 | -/* Support both US and A4. */ | |
821 | +/* Support US Letter, Legal, and A4. */ | |
822 | ||
823 | -/* US is 8.5 in by 11 in */ | |
824 | +/* US Letter is 8.5 in by 11 in */ | |
825 | ||
826 | -#define USWIDTH (5100) | |
827 | -#define USHEIGHT (6600) | |
828 | +#define LETTERWIDTH (5100) | |
829 | +#define LETTERHEIGHT (6600) | |
830 | + | |
831 | +/* US Legal is 8.5 in by 14 in */ | |
832 | + | |
833 | +#define LEGALWIDTH (5100) | |
834 | +#define LEGALHEIGHT (8400) | |
835 | ||
836 | /* A4 is 210 mm by 297 mm == 8.27 in by 11.69 in */ | |
837 | ||
838 | @@ -137,8 +142,24 @@ | |
839 | char buf[128]; | |
840 | char *progname = *argv; | |
841 | ||
842 | - Width = USWIDTH; | |
843 | - Height = USHEIGHT; | |
844 | + Width = LETTERWIDTH; | |
845 | + Height = LETTERHEIGHT; | |
846 | + if(argc>1 && strcmp(argv[1], "-letter")==0) | |
847 | + { | |
848 | + Width = LETTERWIDTH; | |
849 | + Height = LETTERHEIGHT; | |
850 | + argc--; | |
851 | + argv++; | |
852 | + } | |
853 | + | |
854 | + if(argc>1 && strcmp(argv[1], "-legal")==0) | |
855 | + { | |
856 | + Width = LEGALWIDTH; | |
857 | + Height = LEGALHEIGHT; | |
858 | + argc--; | |
859 | + argv++; | |
860 | + } | |
861 | + | |
862 | if(argc>1 && strcmp(argv[1], "-a4")==0) | |
863 | { | |
864 | Width = A4WIDTH; | |
865 | @@ -146,6 +167,9 @@ | |
866 | argc--; | |
867 | argv++; | |
868 | } | |
869 | + | |
870 | + | |
871 | + | |
872 | Pwidth = (Width+7)/8; | |
873 | bitmap = (char *)malloc(Pwidth*Height); | |
874 | ||
875 | @@ -192,6 +216,7 @@ | |
876 | return 1; | |
877 | } | |
878 | ||
879 | + Width = 8*Pwidth ; /* here need 8*Pwidth as the Width ! */ | |
880 | printf("P4\n%d %d\n",Width,Height); | |
881 | ||
882 | for(x=0; x<Pwidth*Height; x++) | |
883 | @@ -199,3 +224,10 @@ | |
884 | ||
885 | return 0; | |
886 | } | |
887 | + | |
888 | + | |
889 | + | |
890 | + | |
891 | + | |
892 | + | |
893 | + |