summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDidier Raboud <odyx@debian.org>2011-05-25 17:02:37 +0200
committerDidier Raboud <odyx@debian.org>2011-05-25 17:02:37 +0200
commit2e900dd3d659445e757812075da460c8dca7ec54 (patch)
treea16dd75be5cbf8c20da12e52710b2a1a9f122713
parent08722d808ce99ae3c965a20ec9a2fff8510b165f (diff)
Imported Upstream version 20090301dfsg
-rwxr-xr-xCOPYING6
-rw-r--r--ChangeLog360
-rw-r--r--INSTALL555
-rw-r--r--INSTALL.in529
-rw-r--r--INSTALL.osx119
-rw-r--r--Makefile747
-rw-r--r--PPD/Generic-OAKT_Printer.ppd80
-rw-r--r--PPD/Generic-ZjStream_Printer.ppd134
-rw-r--r--PPD/HP-Color_LaserJet_1500.ppd60
-rw-r--r--PPD/HP-Color_LaserJet_1600.ppd85
-rw-r--r--PPD/HP-Color_LaserJet_2600n.ppd85
-rw-r--r--PPD/HP-Color_LaserJet_CP1215.ppd488
-rw-r--r--PPD/HP-LaserJet_1000.ppd50
-rw-r--r--PPD/HP-LaserJet_1005.ppd50
-rw-r--r--PPD/HP-LaserJet_1018.ppd64
-rw-r--r--PPD/HP-LaserJet_1020.ppd64
-rw-r--r--PPD/HP-LaserJet_1022.ppd64
-rw-r--r--PPD/HP-LaserJet_M1005_MFP.ppd52
-rw-r--r--PPD/HP-LaserJet_M1120_MFP.ppd441
-rw-r--r--PPD/HP-LaserJet_M1319_MFP.ppd415
-rw-r--r--PPD/HP-LaserJet_P1005.ppd441
-rw-r--r--PPD/HP-LaserJet_P1006.ppd441
-rw-r--r--PPD/HP-LaserJet_P1007.ppd441
-rw-r--r--PPD/HP-LaserJet_P1008.ppd441
-rw-r--r--PPD/HP-LaserJet_P1505.ppd441
-rw-r--r--PPD/HP-LaserJet_P2014.ppd441
-rw-r--r--PPD/HP-LaserJet_P2035.ppd415
-rw-r--r--PPD/KONICA_MINOLTA-magicolor_2480_MF.ppd (renamed from PPD/KonicaMinolta-magicolor_2480_MF.ppd)130
-rw-r--r--PPD/KONICA_MINOLTA-magicolor_2490_MF.ppd (renamed from PPD/KonicaMinolta-magicolor_2490_MF.ppd)130
-rw-r--r--PPD/KONICA_MINOLTA-magicolor_2530_DL.ppd (renamed from PPD/KonicaMinolta-magicolor_2530_DL.ppd)130
-rw-r--r--PPD/Kyocera-KM-1635.ppd286
-rw-r--r--PPD/Kyocera-KM-2035.ppd286
-rw-r--r--PPD/Lexmark-C500.ppd426
-rw-r--r--PPD/Minolta-Color_PageWorks_Pro_L.ppd92
-rw-r--r--PPD/Minolta-magicolor_2200_DL.ppd87
-rw-r--r--PPD/Minolta-magicolor_2300_DL.ppd100
-rw-r--r--PPD/Minolta-magicolor_2430_DL.ppd100
-rw-r--r--PPD/Oki-C3100.ppd475
-rw-r--r--PPD/Oki-C3200.ppd475
-rw-r--r--PPD/Oki-C3300.ppd475
-rw-r--r--PPD/Oki-C3400.ppd475
-rw-r--r--PPD/Oki-C3530_MFP.ppd475
-rw-r--r--PPD/Oki-C5100.ppd475
-rw-r--r--PPD/Oki-C5200.ppd475
-rw-r--r--PPD/Oki-C5500.ppd475
-rw-r--r--PPD/Oki-C5600.ppd475
-rw-r--r--PPD/Oki-C5800.ppd475
-rw-r--r--PPD/Samsung-CLP-300.ppd93
-rw-r--r--PPD/Samsung-CLP-315.ppd493
-rw-r--r--PPD/Samsung-CLP-600.ppd93
-rw-r--r--PPD/Samsung-CLP-610.ppd493
-rw-r--r--PPD/Samsung-CLX-2160.ppd493
-rw-r--r--PPD/Samsung-CLX-3160.ppd93
-rw-r--r--PPD/Samsung-CLX-3175.ppd493
-rw-r--r--PPD/Xerox-Phaser_6110.ppd (renamed from PPD/Xerox-Phaser-6110.ppd)97
-rw-r--r--PPD/Xerox-Phaser_6115MFP.ppd (renamed from PPD/Xerox-Phaser-6115MFP.ppd)118
-rw-r--r--README72
-rw-r--r--README.in72
-rw-r--r--arm2hpdl.1in44
-rw-r--r--foo2hiperc-wrapper.1in211
-rwxr-xr-xfoo2hiperc-wrapper.in668
-rw-r--r--foo2hiperc.1in179
-rw-r--r--foo2hiperc.c1695
-rw-r--r--foo2hp.1in177
-rw-r--r--foo2hp.c16
-rw-r--r--foo2hp2600-wrapper.1in180
-rwxr-xr-xfoo2hp2600-wrapper.in117
-rw-r--r--foo2lava-wrapper.1in179
-rwxr-xr-xfoo2lava-wrapper.in164
-rw-r--r--foo2lava.1in177
-rw-r--r--foo2lava.c111
-rw-r--r--foo2oak-wrapper.1in227
-rw-r--r--foo2oak-wrapper.in428
-rw-r--r--foo2oak.1in226
-rw-r--r--foo2oak.c1889
-rw-r--r--foo2qpdl-wrapper.1in191
-rwxr-xr-xfoo2qpdl-wrapper.in112
-rw-r--r--foo2qpdl.1in182
-rw-r--r--foo2qpdl.c580
-rw-r--r--foo2slx-wrapper.1in196
-rwxr-xr-xfoo2slx-wrapper.in694
-rw-r--r--foo2slx.1in163
-rw-r--r--foo2slx.c1546
-rw-r--r--foo2xqx-wrapper.1in178
-rwxr-xr-xfoo2xqx-wrapper.in75
-rw-r--r--foo2xqx.1in178
-rw-r--r--foo2xqx.c8
-rw-r--r--foo2zjs-pstops.1in51
-rwxr-xr-xfoo2zjs-pstops.sh110
-rw-r--r--foo2zjs-wrapper.1in178
-rwxr-xr-xfoo2zjs-wrapper.in133
-rw-r--r--foo2zjs.1in177
-rw-r--r--foo2zjs.c10
-rw-r--r--foomatic-db/driver/foo2hiperc.xml29
-rw-r--r--foomatic-db/driver/foo2hp.xml1
-rw-r--r--foomatic-db/driver/foo2lava.xml8
-rw-r--r--foomatic-db/driver/foo2oak-z1.xml20
-rw-r--r--foomatic-db/driver/foo2qpdl.xml11
-rw-r--r--foomatic-db/driver/foo2slx.xml19
-rw-r--r--foomatic-db/driver/foo2xqx.xml7
-rw-r--r--foomatic-db/driver/foo2zjs.xml2
-rw-r--r--foomatic-db/opt/foo2hiperc-ColorMode.xml38
-rw-r--r--foomatic-db/opt/foo2hiperc-Compression.xml32
-rw-r--r--foomatic-db/opt/foo2hiperc-Duplex.xml37
-rw-r--r--foomatic-db/opt/foo2hiperc-ICM.xml90
-rw-r--r--foomatic-db/opt/foo2hiperc-InputSlot.xml54
-rw-r--r--foomatic-db/opt/foo2hiperc-MediaType.xml37
-rw-r--r--foomatic-db/opt/foo2hiperc-PageSize.xml97
-rw-r--r--foomatic-db/opt/foo2hiperc-Resolution.xml43
-rw-r--r--foomatic-db/opt/foo2hp-ICM.xml32
-rw-r--r--foomatic-db/opt/foo2hp-PrinterType.xml62
-rw-r--r--foomatic-db/opt/foo2hp-Quality.xml32
-rw-r--r--foomatic-db/opt/foo2lava-ICM.xml45
-rw-r--r--foomatic-db/opt/foo2lava-PrinterType.xml6
-rw-r--r--foomatic-db/opt/foo2lava-Quality.xml32
-rw-r--r--foomatic-db/opt/foo2oak-ICM.xml29
-rw-r--r--foomatic-db/opt/foo2oak-z1-InputSlot.xml37
-rw-r--r--foomatic-db/opt/foo2oak-z1-MediaType.xml102
-rw-r--r--foomatic-db/opt/foo2oak-z1-PageSize.xml143
-rw-r--r--foomatic-db/opt/foo2qpdl-Duplex.xml42
-rw-r--r--foomatic-db/opt/foo2qpdl-ICM.xml63
-rw-r--r--foomatic-db/opt/foo2qpdl-InputSlot.xml7
-rw-r--r--foomatic-db/opt/foo2qpdl-PrinterType.xml122
-rw-r--r--foomatic-db/opt/foo2qpdl-Quality.xml32
-rw-r--r--foomatic-db/opt/foo2slx-ColorMode.xml38
-rw-r--r--foomatic-db/opt/foo2slx-ICM.xml65
-rw-r--r--foomatic-db/opt/foo2slx-InputSlot.xml32
-rw-r--r--foomatic-db/opt/foo2slx-MediaType.xml72
-rw-r--r--foomatic-db/opt/foo2slx-PageSize.xml67
-rw-r--r--foomatic-db/opt/foo2slx-Resolution.xml36
-rw-r--r--foomatic-db/opt/foo2xqx-Quality.xml32
-rw-r--r--foomatic-db/opt/foo2xxx-Copies.xml (renamed from foomatic-db/opt/foo2zjs-Copies.xml)10
-rw-r--r--foomatic-db/opt/foo2xxx-Nup.xml (renamed from foomatic-db/opt/foo2zjs-Nup.xml)46
-rw-r--r--foomatic-db/opt/foo2xxx-NupOrient.xml (renamed from foomatic-db/opt/foo2zjs-NupOrient.xml)28
-rw-r--r--foomatic-db/opt/foo2xxx-Quality.xml63
-rw-r--r--foomatic-db/opt/foo2zjs-ColorMode.xml30
-rw-r--r--foomatic-db/opt/foo2zjs-Duplex.xml6
-rw-r--r--foomatic-db/opt/foo2zjs-ICM.xml62
-rw-r--r--foomatic-db/opt/foo2zjs-Intent.xml6
-rw-r--r--foomatic-db/opt/foo2zjs-PrinterType.xml22
-rw-r--r--foomatic-db/opt/foo2zjs-Quality.xml32
-rw-r--r--foomatic-db/opt/foo2zjs-Resolution.xml30
-rw-r--r--foomatic-db/printer/HP-Color_LaserJet_CP1215.xml58
-rw-r--r--foomatic-db/printer/HP-LaserJet_M1120_MFP.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_M1319_MFP.xml55
-rw-r--r--foomatic-db/printer/HP-LaserJet_P1005.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P1006.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P1007.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P1008.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P1505.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P2014.xml50
-rw-r--r--foomatic-db/printer/HP-LaserJet_P2035.xml55
-rw-r--r--foomatic-db/printer/KONICA_MINOLTA-magicolor_2480_MF.xml (renamed from foomatic-db/printer/KonicaMinolta-magicolor_2480_MF.xml)4
-rw-r--r--foomatic-db/printer/KONICA_MINOLTA-magicolor_2490_MF.xml (renamed from foomatic-db/printer/KonicaMinolta-magicolor_2490_MF.xml)4
-rw-r--r--foomatic-db/printer/KONICA_MINOLTA-magicolor_2530_DL.xml (renamed from foomatic-db/printer/KonicaMinolta-magicolor_2530_DL.xml)4
-rw-r--r--foomatic-db/printer/Kyocera-KM-1635.xml53
-rw-r--r--foomatic-db/printer/Kyocera-KM-2035.xml53
-rw-r--r--foomatic-db/printer/Lexmark-C500.xml54
-rw-r--r--foomatic-db/printer/Oki-C3100.xml53
-rw-r--r--foomatic-db/printer/Oki-C3200.xml53
-rw-r--r--foomatic-db/printer/Oki-C3300.xml53
-rw-r--r--foomatic-db/printer/Oki-C3400.xml53
-rw-r--r--foomatic-db/printer/Oki-C3530_MFP.xml55
-rw-r--r--foomatic-db/printer/Oki-C5100.xml53
-rw-r--r--foomatic-db/printer/Oki-C5200.xml53
-rw-r--r--foomatic-db/printer/Oki-C5500.xml53
-rw-r--r--foomatic-db/printer/Oki-C5600.xml53
-rw-r--r--foomatic-db/printer/Oki-C5800.xml53
-rw-r--r--foomatic-db/printer/Samsung-CLP-315.xml57
-rw-r--r--foomatic-db/printer/Samsung-CLP-610.xml54
-rw-r--r--foomatic-db/printer/Samsung-CLX-2160.xml59
-rw-r--r--foomatic-db/printer/Samsung-CLX-3175.xml59
-rw-r--r--foomatic-db/printer/Xerox-Phaser_6110.xml (renamed from foomatic-db/printer/Xerox-Phaser-6110.xml)5
-rw-r--r--foomatic-db/printer/Xerox-Phaser_6115MFP.xml (renamed from foomatic-db/printer/Xerox-Phaser-6115MFP.xml)2
-rwxr-xr-xgetweb.in216
-rw-r--r--gipddecode.c843
-rw-r--r--hiperc.h171
-rw-r--r--hipercdecode.1in168
-rw-r--r--hipercdecode.c (renamed from okidecode.c)83
-rwxr-xr-xhplj100067
-rw-r--r--hplj1020.desktop12
-rw-r--r--hplj1020_icon.gifbin0 -> 1796 bytes
-rw-r--r--hplj1020_icon.pngbin0 -> 2587 bytes
-rw-r--r--hplj10xx.rules36
-rwxr-xr-xhplj10xx_gui.tcl87
-rwxr-xr-x[-rw-r--r--]icc2ps/COPYING4
-rw-r--r--icc2ps/Makefile17
-rwxr-xr-x[-rw-r--r--]icc2ps/README8
-rw-r--r--icc2ps/README.foo2zjs6
-rwxr-xr-x[-rw-r--r--]icc2ps/cmscam02.c22
-rwxr-xr-x[-rw-r--r--]icc2ps/cmscam97.c8
-rw-r--r--icc2ps/cmscgats.c833
-rwxr-xr-x[-rw-r--r--]icc2ps/cmscnvrt.c4
-rwxr-xr-x[-rw-r--r--]icc2ps/cmserr.c22
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsgamma.c63
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsgmt.c107
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsintrp.c52
-rw-r--r--icc2ps/cmsio0.c122
-rwxr-xr-xicc2ps/cmsio1.c1029
-rwxr-xr-x[-rw-r--r--]icc2ps/cmslut.c254
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsmatsh.c18
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsmtrx.c44
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsnamed.c14
-rwxr-xr-x[-rw-r--r--]icc2ps/cmspack.c136
-rwxr-xr-x[-rw-r--r--]icc2ps/cmspcs.c62
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsps2.c188
-rwxr-xr-x[-rw-r--r--]icc2ps/cmssamp.c154
-rw-r--r--icc2ps/cmsvirt.c206
-rwxr-xr-x[-rw-r--r--]icc2ps/cmswtpnt.c58
-rwxr-xr-x[-rw-r--r--]icc2ps/cmsxform.c252
-rwxr-xr-x[-rw-r--r--]icc2ps/icc2ps.c64
-rwxr-xr-x[-rw-r--r--]icc2ps/icc34.h38
-rwxr-xr-x[-rw-r--r--]icc2ps/lcms.h470
-rwxr-xr-xincluder-man131
-rw-r--r--jbig.c1115
-rw-r--r--jbig.h120
-rw-r--r--jbig_ar.c426
-rw-r--r--jbig_ar.h55
-rw-r--r--jbig_tab.c429
-rw-r--r--lavadecode.1in251
-rw-r--r--lavadecode.c35
-rw-r--r--macros.man172
-rw-r--r--oak.h197
-rw-r--r--oakdecode.1in175
-rw-r--r--oakdecode.c673
-rw-r--r--oki.h58
-rw-r--r--opldecode.1in195
-rw-r--r--opldecode.c39
-rwxr-xr-xppd-adjust3
-rw-r--r--qpdldecode.1in179
-rw-r--r--qpdldecode.c144
-rw-r--r--regress.txt55
-rw-r--r--slx.h254
-rw-r--r--slxdecode.1in109
-rw-r--r--slxdecode.c598
-rw-r--r--usb_printerid.1in50
-rw-r--r--usb_printerid.c2
-rw-r--r--xqxdecode.1in175
-rw-r--r--xqxdecode.c48
-rw-r--r--zjs.h8
-rw-r--r--zjsdecode.1in178
-rw-r--r--zjsdecode.c79
242 files changed, 35217 insertions, 8206 deletions
diff --git a/COPYING b/COPYING
index e39f749..21fcce2 100755
--- a/COPYING
+++ b/COPYING
@@ -22,11 +22,17 @@ Copyright Konica Minolta...
Copyright Rick Richardson. All Rights Reserved.
hpclj2600n-1.icm (2006)
samclp300-0.icm (2007)
+ km2530-jconner-d50.icm (2007)
+ hp1215-argyll-0.icm (2008)
+ samclp315-argyll-0.icm (2008)
Copyright Samsung...
CLP-300*cms* (2006)
CLP-600*cms* (2006)
+Copyright Lexmark...
+ lexRPCA200.icm (2006)
+
PATENTS
It is possible that certain products which can be built using the jbig
software module might form inventions protected by patent rights in
diff --git a/ChangeLog b/ChangeLog
index 521e26b..c17f145 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,362 @@
+2009-03-01 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2zjs-icc2ps to "Little CMS" (lcms), v1.18 beta 1.
+ $ make regress
+ little cms PostScript converter - v1.5+v1.18beta1+foo2zjs
+ ca8227261a3b18e10ee7fa720dd90ccb C3400-L1-BIN-ICC_0603150.icm.ps
+ 91625a11ef859a4c3662379db1ffafd2 C3400-L2-BIN-ICC_0604110.icm.ps
+ 6dd402051dd3747e40b1a7b1e2e82196 hp1215-argyll-0.icm.ps
+ 9f104c51f07705599ce874f83c6f8783 hpclj2600n-0.icm.ps
+ 6f324397fad3c195250ec7a159d293f9 hpclj2600n-1.icm.ps
+ 96454f21ba7c1ccad1953524670f5f72 km2430_0.icm.ps
+ 862ca1d836f097ea403ba9f630a5258f km2430_1.icm.ps
+ 35f478bf58d43db5cc0853caec9a5868 km2430_2.icm.ps
+ f75cb27671de78d63a81d7be3bff310f km2530_0.icm.ps
+ a1c0cccd4b898319fc37887a7106466b km2530_1.icm.ps
+ ab78bcd38fad306ddeda108a43c31c96 km2530_2.icm.ps
+ 44d45f189f3986eef5b7565159da167e km2530-jconner-d50.icm.ps
+ 312e49d3deaed093c8b3834487bc7620 lexRPCA2000.icm.ps
+ e72e37a4f8cb14e36dfe8337b6988aee OK3200L1.icm.ps
+ 9bab8e1f5a3a78c5e47316941bb4c915 OK3200L2.icm.ps
+ 1d63e82bae789fc2c5101dbc4077e67c OK5600L1.icm.ps
+ bd6a812ce413387288d23e4773b80c8b OK5600L2.icm.ps
+ 8d0d23d861137faf90ab567e2f20afbd OK5600L3.icm.ps
+ f9d96dc460f49e718ce3a9963e7d7595 samclp300-0.icm.ps
+ 7014e454afff845627779cda3b28e0c5 samclp315-argyll-0.icm.ps
+
+2009-02-19 Rick Richardson <rick.richardson@comcast.net>
+ * foo2hp: Fix segv when -b2 and -d2 are given.
+ * foo2hp: Fix PageNum when -b2 is given.
+
+2009-01-22 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: HP LaserJet M1319 MFP. Printer only!!
+
+2009-01-22 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: HP LaserJet P2035
+
+2009-01-22 Rick Richardson <rick.richardson@comcast.net>
+ * zjsdecode: add -p option for HP LaserJet P2035
+
+2009-01-11 Rick Richardson <rick.richardson@comcast.net>
+ * foo2oak-wrapper bug fix
+
+2008-12-31 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: Samsung CLX-3175
+
+2008-12-29 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: Oki C3100
+
+2008-12-07 Rick Richardson <rick.richardson@comcast.net>
+ * Samsung CLP-315:
+ - Now use Argyll (samclp-315-argyll-0.icm) for color correction
+ - make; ./getweb 315; make install
+ - Delete and recreate Samsung CLP-315
+
+2008-12-06 Rick Richardson <rick.richardson@comcast.net>
+ * HP CLJ CP1215:
+ - Now use Argyll (hp1215-argyll-0.icm) for color correction
+ - make; ./getweb 1215; make install
+ - Delete and recreate HP Color LaserJet CP1215
+ - foo2hp2600-wrapper: implement -z <model>; 0=1600/2600, 1=1215
+
+2008-12-04 Rick Richardson <rick.richardson@comcast.net>
+ * foo2zjs-pstops: Fix bug with -w
+
+2008-10-07 Rick Richardson <rick.richardson@comcast.net>
+ * foo2qpdl: bug fix: -z2 (clp-315. clp-610): stripe starts
+ with 0, not 1.
+
+2008-09-23 Rick Richardson <rick.richardson@comcast.net>
+ * foo2qpdl: bug fix: LONGEDGE does not need to be flipped on CLP-610.
+ * zjsdecode, gipddecode, slxdecode: fix bug with argc[1]
+
+2008-09-22 Rick Richardson <rick.richardson@comcast.net>
+ * foo2qpdl: Do auto duplex on clp-610
+ Delete CLP-610 printer then re-install them (PPD changed)
+
+2008-09-18 Rick Richardson <rick.richardson@comcast.net>
+ * foo2qpdl: Change unknown value (margin?) based on page size.
+
+2008-09-05 Rick Richardson <rick.richardson@comcast.net>
+ * Upgrade to JBIGKIT 2.0
+
+2008-07-30 Rick Richardson <rick.richardson@comcast.net>
+ * Makefile: rm gipddecode.o on a "make clean".
+
+2008-07-22 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: Samsung CLP-315
+
+2008-06-05 Rick Richardson <rick.richardson@comcast.net>
+ * New printers: HP LJ P1007 and P1008
+
+2008-06-03 Rick Richardson <rick.richardson@comcast.net>
+ * Upgrade P1005, P1006, P1505 firmware to 04/15/2008
+
+2008-05-23 Rick Richardson <rick.richardson@comcast.net>
+ * foomatic-db and PPDs: update ieee string for CP1215
+
+2008-05-21 Rick Richardson <rick.richardson@comcast.net>
+ * foomatic-db and PPDs: New HP Color LaserJet CP1215 using foo2hp
+ ALPHA QUALITY, imperfect color correction.
+
+2008-05-15 Rick Richardson <rick.richardson@comcast.net>
+ * foomatic-db and PPDs: New Oki C3530 MFP
+
+2008-05-01 Rick Richardson <rick.richardson@comcast.net>
+ * New Printers: Kyocera Mita KM-1635, KM-2035.
+ * foomatic-db and PPDs: Kyocera Mita KM-1635, KM-2035.
+ - PageSize, InputSlot, MediaType
+
+2008-04-30 Rick Richardson <rick.richardson@comcast.net>
+ * foo2oak, foo2oak-wrapper, foo2zjs-pstops:
+ Implement rotate 90 for Kyocera Mita KM-1635, KM-2035.
+ * foo2hiperc: fix 600x1200 resolution.
+
+2008-04-26 Rick Richardson <rick.richardson@comcast.net>
+ * foo2lava.c: implement copies.
+
+2008-04-24 Rick Richardson <rick.richardson@comcast.net>
+ * foo2hiperc-wrapper, et al:
+ Change Input Slot to
+ auto, tray1, tray2, multi, manual
+
+2008-04-18 Rick Richardson <rick.richardson@comcast.net>
+ * foo2qpdl-wrapper: set clipping to 150x100 for Custom page size.
+
+2008-04-01 Rick Richardson <rick.richardson@comcast.net>
+ * New Printer: Samsung CLP-610 added to foo2qpdl et al.
+
+2008-03-30 Rick Richardson <rick.richardson@comcast.net>
+ * qpdldecode: add new compression mode 0x15 for CLP-610.
+
+2008-03-24 Rick Richardson <rick.richardson@comcast.net>
+ * New printer: HP LaserJet 2014 using foo2xqx.
+
+2008-03-23 Rick Richardson <rick.richardson@comcast.net>
+ * Add: gipddecode.for Granite Image Printer Driver. Used
+ by Granite Systems, inc. a.k.a Monotype Imaging, e.g.
+ Dell 1125 MFP, Lexmark X500
+
+2008-02-16 Rick Richardson <rick.richardson@comcast.net>
+ * Add: manual pages for arm2hpdl, usb_printerid
+ * Modify: foo2xqx-wrapper to put in WTS.
+
+2008-02-15 Rick Richardson <rick.richardson@comcast.net>
+ * Add: Copies, Nup, NupOrient, Quality to foo2hiperc, foo2slx
+ foomatic-db and PPD files
+
+2008-02-07 Rick Richardson <rick.richardson@comcast.net>
+ * Add: HP-LaserJet_M1120_MFP using the foo2xqx driver
+ * Modify: Oki foomatic and PPD entries for C5500/C5600/C5800
+ Color Correction
+
+2008-02-06 Rick Richardson <rick.richardson@comcast.net>
+ * Add: C5200
+ * Modify: Oki foomatic and PPD entries for C3200/C5100/C5200
+ Color Correction
+ * Modify: Oki foomatic and PPD entries for C3300/C3400
+ Color Correction
+
+2008-02-05 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2hiperc. Put out the correct end_doc
+ * Modify: foo2hiperc. Pad to 256 lines.
+
+2008-02-02 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2hiperc color mode
+ * Modify: foo2hiperc compessed mode.
+
+2008-02-01 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2hiperc et al.
+
+2008-01-31 Rick Richardson <rick.richardson@comcast.net>
+ * Add: man pages for foo2hiperc.
+ * Modify: foo2hiperc et al.
+
+2008-01-30 Rick Richardson <rick.richardson@comcast.net>
+ * Add: foo2hiperc et al. Another set of printers added:
+ Oki C3200n/C3300n/C3400n/C5100n/C5500n
+ Note: alpha quality, no color correction at all!!!
+
+2008-01-28 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: getweb 2300
+
+2008-01-22 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: icc2ps to "Little CMS" (lcms), v1.17.
+ Bugs fixed in icc2ps/cmsio1.c.
+
+2008-01-22 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: icc2ps/cmsio1.c to malloc space for wchar_t right.
+
+2007-12-27 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2*-wrapper to only put in WTS stuff when in COLOR (-c)
+ Otherwise, gs 8.60/8.61 core dumps with -r1200x600
+
+2007-12-19 Rick Richardson <rick.richardson@comcast.net>
+ * Modify manual pages for Solaris
+ * Modify foo2zjs-pstops: remove sed -e "$a"
+ * Modify foo2oak.c, oakdecode.c for OpenBSD
+
+2007-12-15 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2qpdl-InputSlot.xml: Add lower paper tray 2.
+
+2007-12-13 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2slx.c: Do manual duplex.
+
+2007-12-10 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2slx.c: produce colors in the right order.
+
+2007-12-10 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2slx.c: Set ExtraPad to 0.
+ * Modify foo2slx.c: Use item_int32_write_pad for 0x03, 0x04
+
+2007-12-09 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2*.c:
+ If called by CUPS, print page accounting stuff to stderr.
+ Change DEVICE_URL to DEVICE_URI for IsCUPS
+ This is a misfeature of CUPS only.
+ * Modify foo2slx.c: Add pad to SLI_0x03.
+ * Modify foo2slx-wrapper: GAMMAFILE=default for color
+
+2007-12-08 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2slx.c:
+ SLI_COUNT, 1 (0x1)
+ SLI_0x0e, 0 (0x0) (was SLI_DMCOLLATE)
+
+2007-12-07 Rick Richardson <rick.richardson@comcast.net>
+ * Modify foo2*-wrapper: change CustomPageSize for Acrobat 8.1.1 rpm.
+ * Modify foo2*-wrapper: change ghostscript for Acrobat 8.1.1:
+ "gs ... -" to "gs ... -_"
+
+2007-11-26 Rick Richardson <rick.richardson@comcast.net>
+ * Modify Makefile:
+ OpenSolaris, Solaris Express Developer Edition 9/07, Solaris 11 (beta)
+ Make networking (2530 dl, Samsung 300, etc.) printers work.
+
+2007-11-25 Rick Richardson <rick.richardson@comcast.net>
+ * Add printers HP LaserJet P1005/P1006/P1505 to foo2xqx driver.
+
+2007-11-21 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: Makefile install usb_printerid /bin
+
+2007-11-17 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: Makefile uninstall
+
+2007-11-15 Rick Richardson <rick.richardson@comcast.net>
+ * Put in comments RE: /bin/ into hp1000 and Makefile
+
+2007-11-14 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: hplj10xx_gui.tcl to use /sys/...
+
+2007-11-13 Rick Richardson <rick.richardson@comcast.net>
+ * Add: hplj10xx_gui.tcl
+ Usage: $ wish /usr/share/foo2zjs/hplj10xx_gui.tcl
+
+2007-11-12 Rick Richardson <rick.richardson@comcast.net>
+ * Add: GNOME desktop file: hplj1020.desktop
+ Applications -> System Tools -> HPLJ 10xx Replaced Paper
+ invokes: usb_printerid /dev/usb/lp0
+
+2007-11-10 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: hplj10xx.rules to put -%n in the symlink field
+
+2007-11-06 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: *.1in: Only use specialps with -Tps
+ * Modify: *.1in: get rid of:
+ grotty:./foo2lava.1:4269: character above first line discarded
+
+2007-11-05 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2*.c bug with -l, -u
+ * Modify: opldecode.c,.1 change ro to opl.
+
+2007-11-01 Rick Richardson <rick.richardson@comcast.net>
+ * Add: foo2slx et al. Another printer added: Lexmark C500n
+ Note: alpha quality!!!
+
+2007-10-30 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2zjs-pstops take out CIEColor
+ * Modify: zjsdecode, qpdldecode
+ * Modify: foo2qpdl-wrapper: Add default for -G
+
+2007-10-26 Rick Richardson <rick.richardson@comcast.net>
+ * Put version info in getweb and foo2zjs-pstops
+ * foo2*-wrapper: Make PREFILTER=tee if -D9
+
+2007-10-25 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2zjs-pstops put it before "%%Page: 1 1"
+
+2007-10-24 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: foo2zjs-pstops so that CIE + WTS are in the right order.
+
+2007-10-23 Rick Richardson <rick.richardson@comcast.net>
+ * foo2lava ICM: km2530-jconner-d50.icm is the default
+ Do:
+ $ ./getweb 2530
+ $ sudo make install
+ again.
+
+2007-10-22 Rick Richardson <rick.richardson@comcast.net>
+ * Add: foo2zjs-pstops: Add PS code for foo2*-wrapper
+ * Modify foo2*-wrapper: Use WTS with Firefox, et al.
+
+2007-10-20 Rick Richardson <rick.richardson@comcast.net>
+ * foomatic-db/opts/*ICM*, PPD/*: improved
+
+2007-10-19 Rick Richardson <rick.richardson@comcast.net>
+ * Replace sihp1020.img with sihp1020-20050309.img. Was 20041129.
+ $ ./getweb 1020
+ # make install
+ * Resurrect foo2oak
+
+2007-10-18 Rick Richardson <rick.richardson@comcast.net>
+ * foo2zjs-wrapper: Implement WTS when -C10.
+ * foo2hp2600-wrapper: Segfault on 64-bit and gs 8.14/8.15.
+
+2007-10-15 Rick Richardson <rick.richardson@comcast.net>
+ * foo2*-wrapper: WTS works with this workaround:
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
+ So WTS works on 8.54-8.57 AND 8.60-8.61.
+ * INSTALL:
+ * Well Tempered Screening (WTS) works with ghostscript 8.54-8.60+.
+ So if you want BEST COLORS, you'll have to install gs 8.54 or
+ better if you don't have it.
+
+ $ gs --version
+ 8.15.2
+
+ $ wget "http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz"
+ $ tar zxf ghostscript-8.60.tar.gz
+ $ cd ghostscript-8.60
+ $ ./autogen.sh
+ $ make
+ $ su OR $ sudo cp bin/gs /usr/bin/gs.foo
+ # cp bin/gs /usr/bin/gs.foo
+
+2007-10-12 Rick Richardson <rick.richardson@comcast.net>
+ * 11-hplj10xx.rules: Cleanup
+
+2007-10-11 Rick Richardson <rick.richardson@comcast.net>
+ * foo2lava-wrapper, foo2hp2600-wrapper, foo2qpdl-wrapper:
+ Avoid WTS if gs is 8.60/8.61.
+
+2007-10-10 Rick Richardson <rick.richardson@comcast.net>
+ * Add: Well Tempered Screening (WTS) to foo2lava-wrapper
+ # CUPS also does grief by adding its own PS code to the input file.
+ # We take care of that with the sed command. Thus, Well Tempered
+ # Screening (WTS) now works!
+
+2007-09-19 Rick Richardson <rick.richardson@comcast.net>
+ * foo2lava: If 2480MF then switch CYAN/YELLOW.
+ * foo2lava: If 2530DL, output DOTS
+
+2007-09-18 Rick Richardson <rick.richardson@comcast.net>
+ * Modify: Changes to Makefile to get it to build on OpenBSD.
+ * foo2lava: If 2480MF then don't output DOTS.
+
+2007-09-01 Rick Richardson <rick.richardson@comcast.net>
+ * foomatic: Eliminate 600x600 from 2200 DL.
+
+2007-08-22 Rick Richardson <rick.richardson@comcast.net>
+ * Add: foo2qpdl et al for Samsung CLX-2160.
+
2007-07-18 Rick Richardson <rick.richardson@comcast.net>
* foo2lava: Puts DOTS/WHITEDOTS immediately after JBIG, for 2490.
@@ -128,6 +487,7 @@
* Add: foo2qpdl et al for Samsung CLP-300, CLP-600, CLX-3160.
Only JBIG (type 0x13) compression is implemented.
Alpha quality.
+
2007-02-04 Rick Richardson <rick.richardson@comcast.net>
* foo2lava.c: Set \033*r-1004U for color.
diff --git a/INSTALL b/INSTALL
index ac28d2b..80b680a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,3 +1,29 @@
+TOPICS
+------
+ * INSTALLATION
+ * GHOSTSCRIPT BUGS
+ * UBUNTU NOTES
+ * DEBIAN NOTES
+ * OPENSUSE 10.3 NOTES
+ * ACER ASPIRE ONE NOTES
+ * ASUS EEE PC NOTES
+ * MAC OS X NOTES
+ * FREEBSD NOTES
+ * OPENBSD NOTES
+ * OPENSOLARIS, SOLARIS EXPRESS DEVELOPER EDITION 9/07, Solaris 11+ NOTES
+ * MINOLTA-QMS 2200/2300 DL NOTES
+ * USB NOTES
+ * HP LASERJET 1000/1005/1018/1020, P1005/P1006/P1007/P1008/P1505 NOTES
+ * PSUTILS AND 2/4-UP CAPABILITY
+ * CUSTOM PAGE SIZE
+ * SET DEFAULT MEDIA WITH CUPS
+ * UPDATE
+ * UNINSTALLING
+ * BUG REPORTS
+ * DEVELOPER AND DEBUGGING TIPS
+ * CUSTOM ICC/ICM COLOR PRINTER PROFILE (BUY)
+ * CUSTOM ICC/ICM COLOR PRINTER PROFILE (ARGYLL)
+
INSTALLATION
------------
Unpack:
@@ -16,6 +42,8 @@ Get extra files from the web, such as .ICM profiles (for color correction)
and firmware. Select the model number for your printer:
$ ./getweb 2600n # Get HP Color LaserJet 2600n .ICM files
$ ./getweb 1600 # Get HP Color LaserJet 1600 .ICM files
+ $ ./getweb 1500 # Get HP Color LaserJet 1500 .ICM files
+ $ ./getweb 1215 # Get HP Color LaserJet CP1215 .ICM files
$ ./getweb 2530 # Get Konica Minolta magicolor 2530 DL .ICM files
$ ./getweb 2490 # Get Konica Minolta magicolor 2490 MF .ICM files
@@ -28,56 +56,68 @@ and firmware. Select the model number for your printer:
$ ./getweb cpwl # Get Minolta Color PageWorks/Pro L .ICM files
$ ./getweb 300 # Get Samsung CLP-300 .ICM files
+ $ ./getweb 315 # Get Samsung CLP-315 .ICM files
$ ./getweb 600 # Get Samsung CLP-600 .ICM files
+ $ ./getweb 610 # Get Samsung CLP-610 .ICM files
+ $ ./getweb 2160 # Get Samsung CLX-2160 .ICM files
$ ./getweb 3160 # Get Samsung CLX-3160 .ICM files
$ ./getweb 6110 # Get Xerox Phaser 6110 and 6110MFP .ICM files
+ $ ./getweb 500 # Get Lexmark C500 .ICM files
+
+ $ ./getweb 3200 # Get Oki C3200 .ICM files
+ $ ./getweb 3300 # Get Oki C3300 .ICM files
+ $ ./getweb 3400 # Get Oki C3400 .ICM files
+ $ ./getweb 3530 # Get Oki C3530 MFP .ICM files
+ $ ./getweb 5100 # Get Oki C5100 .ICM files
+ $ ./getweb 5200 # Get Oki C5200 .ICM files
+ $ ./getweb 5500 # Get Oki C5500 .ICM files
+ $ ./getweb 5600 # Get Oki C5600 .ICM files
+ $ ./getweb 5800 # Get Oki C5800 .ICM files
+
$ ./getweb 1020 # Get HP LaserJet 1020 firmware file
$ ./getweb 1018 # Get HP LaserJet 1018 firmware file
$ ./getweb 1005 # Get HP LaserJet 1005 firmware file
$ ./getweb 1000 # Get HP LaserJet 1000 firmware file
+ $ ./getweb P1505 # Get HP LaserJet P1505 firmware file
+ $ ./getweb P1008 # Get HP LaserJet P1008 firmware file
+ $ ./getweb P1007 # Get HP LaserJet P1007 firmware file
+ $ ./getweb P1006 # Get HP LaserJet P1006 firmware file
+ $ ./getweb P1005 # Get HP LaserJet P1005 firmware file
+
Install driver, foomatic XML files, PPD files, and extra files:
$ su OR $ sudo make install
# make install
-(Optional) Install hotplug (for HP LJ 1000/1005/1018/1020):
+(Optional) Install hotplug (for HP LJ 1000/1005/1018/1020/P1005/P1006/P1505):
$ su OR $ sudo make install-hotplug
# make install-hotplug
+ Unplug and re-plug the USB printer
+
If you use CUPS to manage your printers, you must restart cupsd:
# make cups OR $ sudo make cups
Test operation of programs. Skip this if you don't have the exact same
-version of Ghostscript that I have (ghostscript-7.05-24.7), because it
-will not pass since different versions of Ghostscript generate different
+version of Ghostscript that I have, ghostscript 8.60 (2007-08-01), because
+it will not pass since different versions of Ghostscript generate different
raster images:
# make test
+Create printers (Fedora 6/7/8/9/10 and Ubuntu 7.10/8.x):
+ # system-config-printer
+
Create printers (Redhat 7.2/7.3/8.0/9.0, Fedora Core 1-5):
# printconf-gui
- Create at least one queue for monochrome, and another queue
- for color printing. Create the queues, then edit them and
- set the "device options" as desired.
-
- For a networked Minolta/QMS 2300 DL, I used a "Queue Type"
- of "Unix Printer (LPD)", and set the "Server" to the IP address
- of the printer, and the "Queue" to "lp".
-
- For a networked HP Color Laserjet 2600n, I used a "Queue Type"
- of "Networked JetDirect", and set the "Printer" to the IP address
- of the printer, and the "Port" to "9100".
-
-For Fedora Core 6 and Fedora 7 users:
- # system-config-printer
Create printers (Mandrake/Manrivia)
# printerdrake
-Create printers (Suse 10.0)
+Create printers (openSUSE 10.x/11.x)
# yast2 printer
-Create printers (Ubuntu)
+Create printers (Ubuntu 5.10/6.06/6.10/7.04)
$ sudo gnome-cups-manager
$ sudo make cups # Ubuntu has a bug in gnome-cups-manager
@@ -91,6 +131,51 @@ Create printers (Debian)
Then edit "Manage Printers->Configure Printer" to suit you,
such as "Page Size" or "Color Mode".
+Create printers (Solaris 11+)
+ # printmgr
+
+Create at least one queue for monochrome, and another queue
+for color printing. Create the queues, then edit them and
+set the "device options" as desired.
+
+For a networked Minolta/QMS 2300 DL, I used a "Queue Type"
+of "Unix Printer (LPD)", and set the "Server" to the IP address
+of the printer, and the "Queue" to "lp".
+
+For a networked HP Color Laserjet 2600n, I used a "Queue Type"
+of "Networked JetDirect", and set the "Printer" to the IP address
+of the printer, and the "Port" to "9100".
+
+GHOSTSCRIPT BUGS
+----------------
+ * ghostscript 8.64 is broken w.r.t. color. Don't use!
+
+ * Well Tempered Screening (WTS) works with ghostscript 8.54 thru 8.62+.
+ So if you want BEST COLORS, you'll have to install gs 8.54 or better
+ if you don't have it.
+
+ $ gs --version
+ 8.15.2
+
+ $ wget "http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs862/ghostscript-8.62.tar.gz"
+ $ tar zxf ghostscript-8.62.tar.gz
+ $ cd ghostscript-8.62
+ $ ./autogen.sh
+ $ make
+ $ su OR $ sudo cp bin/gs /usr/bin/gs.foo
+ # cp bin/gs /usr/bin/gs.foo
+
+ (Optional)
+ # make install OR $ sudo make install
+
+ $ gs.foo --version
+ 8.62
+
+
+ * Ghostscript before 8.55 has a problem with ICM files and 64-bit gcc.
+ It causes a segfault with km2430_2.icm. So don't select that one.
+
+
UBUNTU NOTES
------------
Install build-essential FIRST:
@@ -104,12 +189,24 @@ UBUNTU NOTES
OR other printer
$ sudo make install install-hotplug cups
- $ sudo gnome-cups-manager
- [configure ColorMode = Color if a color printer]
- $ sudo make cups
+ For 7.10 and later users:
+ $ sudo system-config-printer
+
+ For 5.10/6.06/6.10/7.04 users:
+ $ sudo gnome-cups-manager
+ [configure ColorMode = Color if a color printer]
+ $ sudo make cups
+
+ Ubuntu has a bug in gnome-cups-manager with Color, so you must
+ restart cups. No other distro has this bug.
+
+ If that doesn't work, then fire up:
+ $ firefox http://localhost:631
- Ubuntu has a bug in gnome-cups-manager with Color, so you must
- restart cups. No other distro has this bug.
+ And click on:
+ Printers -> Set Printer Options -> Color Mode -> Color
+ Then click on:
+ Set Printer Options
DEBIAN NOTES
------------
@@ -128,6 +225,177 @@ DEBIAN NOTES
$ su
# make install install-hotplug cups
+ $ firefox http://localhost:631
+
+OPENSUSE 10.3 NOTES
+-------------------
+ Do this:
+
+ # zypper install make gcc
+
+ # zypper service-add \
+ http://download.opensuse.org/repositories/Printing/openSUSE_10.3/ \
+ Printing
+ # zypper up -r Printing -t package
+
+ Then install using the above instructions.
+
+ACER ASPIRE ONE NOTES
+---------------------
+
+ Ref: http://the.taoofmac.com/media/Acer/Aspire One/AA1notes.htm
+
+ It is a version of Fedora.
+
+ Get a shell by typing Alt+F2 then Return.
+
+ $ su
+ # yum install make gcc
+ <ctrl-d>
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+ $ make
+ $ ./getweb 1020
+ OR other printer, e.g. 2600n
+ $ su
+ # make install install-hotplug cups
+
+
+ASUS EEE PC NOTES
+-----------------
+
+ It is a version of Xandros. First:
+
+ Get a shell by typing ctrl-alt-T
+ $ sudo su -
+ # vi or kwrite /etc/apt/sources.list
+ add the following line:
+ deb ftp://ftp.us.debian.org/debian stable main contrib non-free
+ # apt-get -f install
+ # apt-get install wget
+ # apt-get install build-essential
+ <ctrl-d>
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+ $ make
+ $ ./getweb 1020
+ OR other printer, e.g. 2600n
+ $ sudo make install install-hotplug cups
+
+ Then use the "Add Printer" GUI.
+
+MAC OS X NOTES
+---------------
+ Please read the detailed installation instructions by Clint Morgan
+ and Rick Richardson in the file INSTALL.osx.
+
+FREEBSD NOTES
+-------------
+ You need the following packages before you start the "make":
+ # pkg_add -r wget
+ # pkg_add -r gmake
+ # pkg_add -r ghostscript-gnu
+ # pkg_add -r cups
+ # pkg_add -r foomatic-filters
+
+ Use "gmake" instead of "make". E.G. gmake; ./getweb XXX; gmake install
+
+ USB NOTES FOR FREEBSD
+ - Build the kernel without the ulpt driver.
+ e.g.
+ # vi /usr/src/sys/i386/conf/GENERIC
+ comment out 'device ulpt'
+ # cd /usr/src/
+ # make buildkernel KERNCONF=GENERIC
+ # make installkernel KERNCONF=GENERIC
+ reboot
+
+ - Do one of these lines each time the printer is powered up:
+ # cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/ugen0.1
+ # cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/ugen0.1
+
+ More information:
+ http://www.webmiscreants.com/index.php?page=howto_P1006
+
+OPENBSD NOTES
+-------------
+ You need the following packages before you start the "make":
+ # pkg_add wget
+ # pkg_add gmake
+ # pkg_add -i ghostscript
+ # pkg_add cups
+ # pkg_add unzip
+
+ Use "gmake" instead of "make". E.G. gmake; ./getweb XXX; gmake install
+
+ USB NOTES FOR OPENBSD
+ - Build the kernel without the ulpt driver.
+ e.g.
+ # vi /usr/src/sys/i386/conf/GENERIC
+ comment out 'device ulpt'
+ # cd /usr/src/
+ # make buildkernel KERNCONF=GENERIC
+ # make installkernel KERNCONF=GENERIC
+ reboot
+
+ - Do one of these lines each time the printer is powered up:
+ # cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/ugen0.1
+ # cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/ugen0.1
+
+OPENSOLARIS, SOLARIS EXPRESS DEVELOPER EDITION 9/07, Solaris 11+ NOTES
+----------------------------------------------------------------------
+ Use "bash" for your shell. Only network printers are supported.
+
+ $ export PATH=$PATH:/sbin:/usr/sbin:/usr/sfw/bin:/opt/sfw/bin
+
+ Do this:
+
+ [ Load CD Solaris_Software_Companion]
+ $ cd /media/S10_807_SOFTWARE_COMPANION/Solaris_Software_Companion/Solaris_i386/Packages
+ $ su root -c "/usr/bin/bash"
+ # pkgadd -d `pwd` SFWgroff
+ # pkgadd -d `pwd` SFWgawk
+
+ OR
+ Browse to:
+ http://pkg.opensolaris.org/release/en/index.shtml
+ and Search or Browse Packages and download:
+
+ SUNWscp
+ SUNWgawk
+ SUNWgroff
+
+ Then:
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+
+ $ gmake
+ $ ./getweb 2530
+ OR other printer
+
+ $ su root -c "/usr/bin/bash"
+ # gmake install
+ # printmgr
+
+ To see a screen to the GUI:
+ http://foo2lava.rkkda.com/solaris/
+
+ NOTE: you cannot see the printer options (Paper Source, Paper Type,
+ Paper Media, Color Mode, ICM, etc.). There is NO GUI to do it!!!
+ Sorry.
+
MINOLTA-QMS 2200/2300 DL NOTES
------------------------------
Use the network interface if you can. These printers understand Unix
@@ -149,8 +417,30 @@ MINOLTA-QMS 2200/2300 DL NOTES
get the v2.55 firmware upgrade, try:
./getweb 2300dl_fw
-HP LASERJET 1000/1005/1018/1020 NOTES
--------------------------------------
+USB NOTES
+---------
+ If you are using the USB port, then the URI should be:
+ usb://Samsung/CLP-310%20Series
+ usb://Samsung/CLP-310%20Series
+ usb://HP/Color%20LaserJet%20CP1215
+ usb://HP/Color%20LaserJet%202600n
+ usb://HP/LaserJet%201000
+ usb://HP/LaserJet%201005
+ usb://HP/LaserJet%201018
+ usb://HP/LaserJet%201020
+ usb://HP/LaserJet%20P1005
+ usb://HP/LaserJet%20P1006
+ usb://HP/LaserJet%20P1505
+ OR
+ usb:/dev/usb/lp0
+ usb:/dev/usb/lp1
+
+ Don't use hp://<whatever> because that is for hplib (a closed source
+ driver).
+
+
+HP LASERJET 1000/1005/1018/1020, P1005/P1006/P1007/P1008/P1505 NOTES
+--------------------------------------------------------------------
These printers need their firmware downloaded to them every time they
are powered up.
@@ -161,19 +451,21 @@ HP LASERJET 1000/1005/1018/1020 NOTES
# make install-hotplug
+ Unplug and re-plug the USB printer.
+
On another OS or with a parallel port connected printer:
You must send a firmware file to the printer each time you power it
up. If you downloaded the extra files for the HP above, a typical
- command line to load the firmware would be:
+ command line to load the firmware would be ONE of these:
cat /usr/share/foo2zjs/firmware/sihp1000.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1005.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/usb/lp0
On Mac OS X:
@@ -183,6 +475,21 @@ HP LASERJET 1000/1005/1018/1020 NOTES
lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1005.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1006.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1505.dl
+
+ Firmware Not Downloaded:
+ # usb_printerid /dev/usb/lp0
+ GET_DEVICE_ID string:
+ MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS: PRINTER;\
+ DES:HP LaserJet 1020;
+
+ Firmware Downloaded:
+ # usb_printerid /dev/usb/lp0
+ GET_DEVICE_ID string:
+ MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS: PRINTER;\
+ DES:HP LaserJet 1020;FWVER:20050309;
NOTE: The original HP files are named '*.img'. Sometimes HP supplies
these files ready-to-download to the printer, sometimes they are raw
@@ -191,30 +498,19 @@ HP LASERJET 1000/1005/1018/1020 NOTES
"arm2hpdl" program to automatically detect which kind of file they are
and convert them (if needed) to the downloadable '*.dl' format.
- These printers do not have a "button" when you run out of paper. But you
- can simulate this by reloading the paper and doing:
+ These printers do not have a "button" when you run out of paper.
+ But, there is a GNOME gui in:
- $ usb_printerid /dev/usb/lp0
+ Applications -> System Tools -> HPLJ 10xx Replaced Paper
-MAC OS X NOTES
----------------
- Please read the detailed installation instructions by Clint Morgan
- and Rick Richardson in the file INSTALL.osx.
+ It requires tcl, tk, and tix. Fedora 5 and later:
+ # yum install tcl tk tix
-FREEBSD NOTES
--------------
- You need the following packages before you start the "make install":
- # pkg_add -r gmake
- # pkg_add -r ghostscript-gnu
- # pkg_add -r cups
- # pkg_add -r foomatic-filters
+ or, you can simulate this by reloading the paper and doing:
- Use "gmake" instead of "make".
+ $ usb_printerid /dev/usb/lp0
-64-bit GHOSTSCRIPT
-------------------
-Ghostscript before 8.55 has a problem with ICM files and 64-bit gcc.
-It causes a segfault with km2430_2.icm. So don't select that one.
+ or, you can open the print cartridge door and then close it.
PSUTILS AND 2/4-UP CAPABILITY
-----------------------------
@@ -240,6 +536,13 @@ CUSTOM PAGE SIZE
Or, use a GUI that allows the custom size parameters, e.g.
"evince" - PostScript and PDF File Viewer.
+SET DEFAULT MEDIA WITH CUPS
+---------------------------
+ $ sudo
+ # lpoptions -o media=A4
+ -OR-
+ # lpoptions -o media=Letter
+
UPDATE
------
Here are handy lines you can click on to get the latest version:
@@ -256,13 +559,6 @@ UNINSTALLING
$ su
# make uninstall
-SET DEFAULT MEDIA WITH CUPS
----------------------------
- $ sudo
- # lpoptions -o media=A4
- -OR-
- # lpoptions -o media=Letter
-
BUG REPORTS
-----------
PLEASE use the forums at:
@@ -278,6 +574,8 @@ DEVELOPER AND DEBUGGING TIPS
----------------------------
If you want to work on this program, I recommend creating a "raw"
printer queue directed at the printer, with no protocol conversions.
+ OR, simple copy the file to /dev/usb/lp0 (USB) or nc (netcat) the
+ file (network).
Then, you can use the "foo2zjs-wrapper" program to convert Postscript
test programs to ZjS format, and inspect them with "zjsdecode" before
@@ -290,45 +588,166 @@ DEVELOPER AND DEBUGGING TIPS
zjsdecode < testpage.zc
lpr -Praw testpage.zm
-
-CUSTOM ICC/ICM COLOR PRINTER PROFILE
-------------------------------------
+ OR
+ cp testpage.zm /dev/usb/lp0
+ OR
+ nc 192.168.1.NNN 9100 < testpage.zm
+
+ Same thing for the other drivers, e.g. ...
+
+ foo2hiperc-wrapper testpage.ps > testpage.hc
+ hipercdecode < testpage.hc
+ nc 192.168.1.NNN 9100 < testpage.hc
+
+ If the printer is an HP LaserJet 10xx or P1xxx and needs to have the
+ firmware downloaded, this will tell you (P1006):
+ Before:
+ usb_printerid /dev/usb/lp0
+ MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
+ DES:HP LaserJet P1006;
+
+ After:
+ usb_printerid /dev/usb/lp0
+ MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
+ DES:HP LaserJet P1006;FWVER:20080415;
+
+CUSTOM ICC/ICM COLOR PRINTER PROFILE (BUY)
+------------------------------------------
+
+ I need:
+ Samsung CLP-315 default resolution
+ Samsung CLP-600 default resolution
+ Samsung CLP-610 default resolution
+ HP Color LaserJet 1500 default resolution
+ HP Color LaserJet CP1215 default resolution, 1-bit and 2-bit
+ HP Color LaserJet 2600n 2-bit, default resolution
0) Pick a vendor, e.g.
- http://stores.ebay.ie/The-Graphics-Depot
"Custom ICC ICM colour printer profile RGB or CMYK"
+ Seller: personalised101
+ http://stores.ebay.ie/The-Graphics-Depot
+ Cost: 10 pounds
- 1) Convert the vendor sheet(s) from *.tif to *.ps (OPTIONAL)
+ "We Create a Custom ICC Profile for Your Printer-"
+ Seller: fotojimbo
+ http://search.ebay.com/_W0QQsassZfotojimbo
+ Cost: 10 dollars
+
+
+ 1) Convert the vendor sheet(s) from *.tif to page*.ps (OPTIONAL)
$ gimp
OR
+ Preferred, using ImageMagick's "convert"
$ convert Color\ Patch\ RGB\ \(Page\ 1\).tif page1.ps
$ convert Color\ Patch\ RGB\ \(Page\ 2\).tif page2.ps
+ OR
+
+ From *.jpg to *.ps
+ $ convert a300DPI_i1-RGB-1.5.jpg -rotate 90 -density 300x300 \
+ -quality 100 page1.ps
+
2) Print the Postscript vendor sheet(s) with NO color correction:
- $ foo2hp2600-wrapper -c -C10 -Gnone.icm \
- test_sheets_from_icc_vendor.ps > test.prn
+ $ foo2hp2600-wrapper -c -C10 -Gnone.icm page1.ps > test1.prn
- $ nc 192.168.1.xxxxxxx 9100 < test.prn
+ $ nc 192.168.1.xxxxxxx 9100 < test1.prn
OR
- $ cp test.prn /dev/usb/lp0
+ $ cp test1.prn /dev/usb/lp0
+
+ repeat for page2.ps (if necessary).
3) Send them to the vendor by POSTAL MAIL
4) Get back *.icc/*.icm profile by EMAIL or WEB
- 5) Put it in /usr/share/foo2hp/icm/test.icm
+ 5) Put it in /usr/share/foo2hp/icm/testing.icm
6) Print a test picture:
- $ foo2hp2600-wrapper -c -C10 -Gtest.icm \
+ $ foo2hp2600-wrapper -c -C10 -Gtesting.icm \
picture.ps > picture.prn
- 7) If it is OK, send "test.icm" to rick.richardson@comcast.net
+ $ nc 192.168.1.xxxxxxx 9100 < picture.prn
+ OR
+ $ cp picture.prn /dev/usb/lp0
+
+ 7) If it is OK, send "testing.icm" to rick.richardson@comcast.net
for inclusion in foo2zjs.
Other printers: use foo2qpdl-wrapper and /usr/share/foo2qpdl/icm/
Other printers: use foo2lava-wrapper and /usr/share/foo2lava/icm/
+
+CUSTOM ICC/ICM COLOR PRINTER PROFILE (ARGYLL)
+---------------------------------------------
+ Reference:
+ http://www.argyllcms.com/
+
+ DON'T DO THIS ON A 32-BIT (i386) PROCESSOR!
+ Ghostscript (8.63) has problems. Weird color profile data.
+
+ ONLY DO THIS ON A 64-BIT (x86_64)PROCESSOR.
+ But, you can use the color profile on i386 and x86_64.
+
+ YOU HAVE BEEN WARNED!!!
+
+ Free!
+
+ Sample: Samsung CLP-315
+ -----------------------
+
+ On dual:
+ $ targen -v -d4 -l200 -f962 clp315
+ OR
+ $ targen -v -d4 -l200 -f1924 clp315
+ ^--- Green tint to black otherwise
+
+ $ printtarg -v -s -iSS -pLetter clp315
+ $ gs clp315.ps
+
+ print it...
+
+ $ scp clp315.ps amd:
+ $ root chmod 666 /dev/usb/*
+
+ On amd: (64-bit because ghostscript has a problem with 32-bit):
+ $ foo2qpdl-wrapper -z2 -c -C10 -Gnone.icm clp315.ps |
+ ssh dual "cat >/dev/usb/lp1"
+
+ scanned on a Canon LIDE 70 at 300 DPI, color, no auto-clip ...
+
+ On mac:
+ $ scp clp315.TIF dual:clp315.tif
+ OR
+ $ scp clp315-1.TIF dual:clp315-1.tif
+ $ scp clp315-2.TIF dual:clp315-2.tif
+
+ On dual:
+ $ mv ~/clp315*.tif .
+ $ convert -resize 50% clp315.tif xxx.tif
+ OR
+ $ convert -resize 50% clp315-1.tif xxx-1.tif
+ $ convert -resize 50% clp315-2.tif xxx-2.tif
+
+ $ scanin -dipn -v -c xxx.tif clp315.cht ../scanner/scanner.icc clp315
+ OR
+ $ scanin -dipn -v -c xxx-1.tif clp315_01.cht ../scanner/scanner.icc clp315
+ $ scanin -dipn -v -ca xxx-2.tif clp315_02.cht ../scanner/scanner.icc clp315
+
+ $ xv diag.tif
+ Look for a01, a02, etc.
+
+ $ colprof -v -D"clp315" -qm -cmt -dpp -kr clp315
+ [snip]
+ profile check complete, peak err = 5.914383, avg err = 1.314669
+
+ ICC is clp315.icc
+
+ Print test page with clp315.icc
+ $ foo2qpdl-wrapper -z2 -c -C10 -G clp315.icc testpage-cups.ps > /dev/usb/lp1
+
+ If it is OK, send "clp315.icc" to rick.richardson@comcast.net
+ for inclusion in foo2zjs.
diff --git a/INSTALL.in b/INSTALL.in
index 8c7803b..bc5e73f 100644
--- a/INSTALL.in
+++ b/INSTALL.in
@@ -16,6 +16,8 @@ Get extra files from the web, such as .ICM profiles (for color correction)
and firmware. Select the model number for your printer:
$ ./getweb 2600n # Get HP Color LaserJet 2600n .ICM files
$ ./getweb 1600 # Get HP Color LaserJet 1600 .ICM files
+ $ ./getweb 1500 # Get HP Color LaserJet 1500 .ICM files
+ $ ./getweb 1215 # Get HP Color LaserJet CP1215 .ICM files
$ ./getweb 2530 # Get Konica Minolta magicolor 2530 DL .ICM files
$ ./getweb 2490 # Get Konica Minolta magicolor 2490 MF .ICM files
@@ -28,56 +30,68 @@ and firmware. Select the model number for your printer:
$ ./getweb cpwl # Get Minolta Color PageWorks/Pro L .ICM files
$ ./getweb 300 # Get Samsung CLP-300 .ICM files
+ $ ./getweb 315 # Get Samsung CLP-315 .ICM files
$ ./getweb 600 # Get Samsung CLP-600 .ICM files
+ $ ./getweb 610 # Get Samsung CLP-610 .ICM files
+ $ ./getweb 2160 # Get Samsung CLX-2160 .ICM files
$ ./getweb 3160 # Get Samsung CLX-3160 .ICM files
$ ./getweb 6110 # Get Xerox Phaser 6110 and 6110MFP .ICM files
+ $ ./getweb 500 # Get Lexmark C500 .ICM files
+
+ $ ./getweb 3200 # Get Oki C3200 .ICM files
+ $ ./getweb 3300 # Get Oki C3300 .ICM files
+ $ ./getweb 3400 # Get Oki C3400 .ICM files
+ $ ./getweb 3530 # Get Oki C3530 MFP .ICM files
+ $ ./getweb 5100 # Get Oki C5100 .ICM files
+ $ ./getweb 5200 # Get Oki C5200 .ICM files
+ $ ./getweb 5500 # Get Oki C5500 .ICM files
+ $ ./getweb 5600 # Get Oki C5600 .ICM files
+ $ ./getweb 5800 # Get Oki C5800 .ICM files
+
$ ./getweb 1020 # Get HP LaserJet 1020 firmware file
$ ./getweb 1018 # Get HP LaserJet 1018 firmware file
$ ./getweb 1005 # Get HP LaserJet 1005 firmware file
$ ./getweb 1000 # Get HP LaserJet 1000 firmware file
+ $ ./getweb P1505 # Get HP LaserJet P1505 firmware file
+ $ ./getweb P1008 # Get HP LaserJet P1008 firmware file
+ $ ./getweb P1007 # Get HP LaserJet P1007 firmware file
+ $ ./getweb P1006 # Get HP LaserJet P1006 firmware file
+ $ ./getweb P1005 # Get HP LaserJet P1005 firmware file
+
Install driver, foomatic XML files, PPD files, and extra files:
$ su OR $ sudo make install
# make install
-(Optional) Install hotplug (for HP LJ 1000/1005/1018/1020):
+(Optional) Install hotplug (for HP LJ 1000/1005/1018/1020/P1005/P1006/P1505):
$ su OR $ sudo make install-hotplug
# make install-hotplug
+ Unplug and re-plug the USB printer
+
If you use CUPS to manage your printers, you must restart cupsd:
# make cups OR $ sudo make cups
Test operation of programs. Skip this if you don't have the exact same
-version of Ghostscript that I have (ghostscript-7.05-24.7), because it
-will not pass since different versions of Ghostscript generate different
+version of Ghostscript that I have, ghostscript 8.60 (2007-08-01), because
+it will not pass since different versions of Ghostscript generate different
raster images:
# make test
+Create printers (Fedora 6/7/8/9/10 and Ubuntu 7.10/8.x):
+ # system-config-printer
+
Create printers (Redhat 7.2/7.3/8.0/9.0, Fedora Core 1-5):
# printconf-gui
- Create at least one queue for monochrome, and another queue
- for color printing. Create the queues, then edit them and
- set the "device options" as desired.
-
- For a networked Minolta/QMS 2300 DL, I used a "Queue Type"
- of "Unix Printer (LPD)", and set the "Server" to the IP address
- of the printer, and the "Queue" to "lp".
-
- For a networked HP Color Laserjet 2600n, I used a "Queue Type"
- of "Networked JetDirect", and set the "Printer" to the IP address
- of the printer, and the "Port" to "9100".
-
-For Fedora Core 6 and Fedora 7 users:
- # system-config-printer
Create printers (Mandrake/Manrivia)
# printerdrake
-Create printers (Suse 10.0)
+Create printers (openSUSE 10.x/11.x)
# yast2 printer
-Create printers (Ubuntu)
+Create printers (Ubuntu 5.10/6.06/6.10/7.04)
$ sudo gnome-cups-manager
$ sudo make cups # Ubuntu has a bug in gnome-cups-manager
@@ -91,6 +105,51 @@ Create printers (Debian)
Then edit "Manage Printers->Configure Printer" to suit you,
such as "Page Size" or "Color Mode".
+Create printers (Solaris 11+)
+ # printmgr
+
+Create at least one queue for monochrome, and another queue
+for color printing. Create the queues, then edit them and
+set the "device options" as desired.
+
+For a networked Minolta/QMS 2300 DL, I used a "Queue Type"
+of "Unix Printer (LPD)", and set the "Server" to the IP address
+of the printer, and the "Queue" to "lp".
+
+For a networked HP Color Laserjet 2600n, I used a "Queue Type"
+of "Networked JetDirect", and set the "Printer" to the IP address
+of the printer, and the "Port" to "9100".
+
+GHOSTSCRIPT BUGS
+----------------
+ * ghostscript 8.64 is broken w.r.t. color. Don't use!
+
+ * Well Tempered Screening (WTS) works with ghostscript 8.54 thru 8.62+.
+ So if you want BEST COLORS, you'll have to install gs 8.54 or better
+ if you don't have it.
+
+ $ gs --version
+ 8.15.2
+
+ $ wget "http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs862/ghostscript-8.62.tar.gz"
+ $ tar zxf ghostscript-8.62.tar.gz
+ $ cd ghostscript-8.62
+ $ ./autogen.sh
+ $ make
+ $ su OR $ sudo cp bin/gs /usr/bin/gs.foo
+ # cp bin/gs /usr/bin/gs.foo
+
+ (Optional)
+ # make install OR $ sudo make install
+
+ $ gs.foo --version
+ 8.62
+
+
+ * Ghostscript before 8.55 has a problem with ICM files and 64-bit gcc.
+ It causes a segfault with km2430_2.icm. So don't select that one.
+
+
UBUNTU NOTES
------------
Install build-essential FIRST:
@@ -104,12 +163,24 @@ UBUNTU NOTES
OR other printer
$ sudo make install install-hotplug cups
- $ sudo gnome-cups-manager
- [configure ColorMode = Color if a color printer]
- $ sudo make cups
+ For 7.10 and later users:
+ $ sudo system-config-printer
- Ubuntu has a bug in gnome-cups-manager with Color, so you must
- restart cups. No other distro has this bug.
+ For 5.10/6.06/6.10/7.04 users:
+ $ sudo gnome-cups-manager
+ [configure ColorMode = Color if a color printer]
+ $ sudo make cups
+
+ Ubuntu has a bug in gnome-cups-manager with Color, so you must
+ restart cups. No other distro has this bug.
+
+ If that doesn't work, then fire up:
+ $ firefox http://localhost:631
+
+ And click on:
+ Printers -> Set Printer Options -> Color Mode -> Color
+ Then click on:
+ Set Printer Options
DEBIAN NOTES
------------
@@ -128,6 +199,177 @@ DEBIAN NOTES
$ su
# make install install-hotplug cups
+ $ firefox http://localhost:631
+
+OPENSUSE 10.3 NOTES
+-------------------
+ Do this:
+
+ # zypper install make gcc
+
+ # zypper service-add \
+ http://download.opensuse.org/repositories/Printing/openSUSE_10.3/ \
+ Printing
+ # zypper up -r Printing -t package
+
+ Then install using the above instructions.
+
+ACER ASPIRE ONE NOTES
+---------------------
+
+ Ref: http://the.taoofmac.com/media/Acer/Aspire One/AA1notes.htm
+
+ It is a version of Fedora.
+
+ Get a shell by typing Alt+F2 then Return.
+
+ $ su
+ # yum install make gcc
+ <ctrl-d>
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+ $ make
+ $ ./getweb 1020
+ OR other printer, e.g. 2600n
+ $ su
+ # make install install-hotplug cups
+
+
+ASUS EEE PC NOTES
+-----------------
+
+ It is a version of Xandros. First:
+
+ Get a shell by typing ctrl-alt-T
+ $ sudo su -
+ # vi or kwrite /etc/apt/sources.list
+ add the following line:
+ deb ftp://ftp.us.debian.org/debian stable main contrib non-free
+ # apt-get -f install
+ # apt-get install wget
+ # apt-get install build-essential
+ <ctrl-d>
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+ $ make
+ $ ./getweb 1020
+ OR other printer, e.g. 2600n
+ $ sudo make install install-hotplug cups
+
+ Then use the "Add Printer" GUI.
+
+MAC OS X NOTES
+---------------
+ Please read the detailed installation instructions by Clint Morgan
+ and Rick Richardson in the file INSTALL.osx.
+
+FREEBSD NOTES
+-------------
+ You need the following packages before you start the "make":
+ # pkg_add -r wget
+ # pkg_add -r gmake
+ # pkg_add -r ghostscript-gnu
+ # pkg_add -r cups
+ # pkg_add -r foomatic-filters
+
+ Use "gmake" instead of "make". E.G. gmake; ./getweb XXX; gmake install
+
+ USB NOTES FOR FREEBSD
+ - Build the kernel without the ulpt driver.
+ e.g.
+ # vi /usr/src/sys/i386/conf/GENERIC
+ comment out 'device ulpt'
+ # cd /usr/src/
+ # make buildkernel KERNCONF=GENERIC
+ # make installkernel KERNCONF=GENERIC
+ reboot
+
+ - Do one of these lines each time the printer is powered up:
+ # cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/ugen0.1
+ # cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/ugen0.1
+
+ More information:
+ http://www.webmiscreants.com/index.php?page=howto_P1006
+
+OPENBSD NOTES
+-------------
+ You need the following packages before you start the "make":
+ # pkg_add wget
+ # pkg_add gmake
+ # pkg_add -i ghostscript
+ # pkg_add cups
+ # pkg_add unzip
+
+ Use "gmake" instead of "make". E.G. gmake; ./getweb XXX; gmake install
+
+ USB NOTES FOR OPENBSD
+ - Build the kernel without the ulpt driver.
+ e.g.
+ # vi /usr/src/sys/i386/conf/GENERIC
+ comment out 'device ulpt'
+ # cd /usr/src/
+ # make buildkernel KERNCONF=GENERIC
+ # make installkernel KERNCONF=GENERIC
+ reboot
+
+ - Do one of these lines each time the printer is powered up:
+ # cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/ugen0.1
+ # cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/ugen0.1
+ # cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/ugen0.1
+
+OPENSOLARIS, SOLARIS EXPRESS DEVELOPER EDITION 9/07, Solaris 11+ NOTES
+----------------------------------------------------------------------
+ Use "bash" for your shell. Only network printers are supported.
+
+ $ export PATH=$PATH:/sbin:/usr/sbin:/usr/sfw/bin:/opt/sfw/bin
+
+ Do this:
+
+ [ Load CD Solaris_Software_Companion]
+ $ cd /media/S10_807_SOFTWARE_COMPANION/Solaris_Software_Companion/Solaris_i386/Packages
+ $ su root -c "/usr/bin/bash"
+ # pkgadd -d `pwd` SFWgroff
+ # pkgadd -d `pwd` SFWgawk
+
+ OR
+ Browse to:
+ http://pkg.opensolaris.org/release/en/index.shtml
+ and Search or Browse Packages and download:
+
+ SUNWscp
+ SUNWgawk
+ SUNWgroff
+
+ Then:
+
+ $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
+ $ tar zxf foo2zjs.tar.gz
+ $ cd foo2zjs
+
+ $ gmake
+ $ ./getweb 2530
+ OR other printer
+
+ $ su root -c "/usr/bin/bash"
+ # gmake install
+ # printmgr
+
+ To see a screen to the GUI:
+ http://foo2lava.rkkda.com/solaris/
+
+ NOTE: you cannot see the printer options (Paper Source, Paper Type,
+ Paper Media, Color Mode, ICM, etc.). There is NO GUI to do it!!!
+ Sorry.
+
MINOLTA-QMS 2200/2300 DL NOTES
------------------------------
Use the network interface if you can. These printers understand Unix
@@ -149,8 +391,30 @@ MINOLTA-QMS 2200/2300 DL NOTES
get the v2.55 firmware upgrade, try:
./getweb 2300dl_fw
-HP LASERJET 1000/1005/1018/1020 NOTES
--------------------------------------
+USB NOTES
+---------
+ If you are using the USB port, then the URI should be:
+ usb://Samsung/CLP-310%20Series
+ usb://Samsung/CLP-310%20Series
+ usb://HP/Color%20LaserJet%20CP1215
+ usb://HP/Color%20LaserJet%202600n
+ usb://HP/LaserJet%201000
+ usb://HP/LaserJet%201005
+ usb://HP/LaserJet%201018
+ usb://HP/LaserJet%201020
+ usb://HP/LaserJet%20P1005
+ usb://HP/LaserJet%20P1006
+ usb://HP/LaserJet%20P1505
+ OR
+ usb:/dev/usb/lp0
+ usb:/dev/usb/lp1
+
+ Don't use hp://<whatever> because that is for hplib (a closed source
+ driver).
+
+
+HP LASERJET 1000/1005/1018/1020, P1005/P1006/P1007/P1008/P1505 NOTES
+--------------------------------------------------------------------
These printers need their firmware downloaded to them every time they
are powered up.
@@ -161,19 +425,21 @@ HP LASERJET 1000/1005/1018/1020 NOTES
# make install-hotplug
+ Unplug and re-plug the USB printer.
+
On another OS or with a parallel port connected printer:
You must send a firmware file to the printer each time you power it
up. If you downloaded the extra files for the HP above, a typical
- command line to load the firmware would be:
+ command line to load the firmware would be ONE of these:
cat /usr/share/foo2zjs/firmware/sihp1000.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1005.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0
- or:
cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/usb/lp0
+ cat /usr/share/foo2xqx/firmware/sihpP1505.dl > /dev/usb/lp0
On Mac OS X:
@@ -183,6 +449,21 @@ HP LASERJET 1000/1005/1018/1020 NOTES
lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1005.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1006.dl
+ lp -oraw /usr/share/foo2xqx/firmware/sihpP1505.dl
+
+ Firmware Not Downloaded:
+ # usb_printerid /dev/usb/lp0
+ GET_DEVICE_ID string:
+ MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS: PRINTER;\
+ DES:HP LaserJet 1020;
+
+ Firmware Downloaded:
+ # usb_printerid /dev/usb/lp0
+ GET_DEVICE_ID string:
+ MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS: PRINTER;\
+ DES:HP LaserJet 1020;FWVER:20050309;
NOTE: The original HP files are named '*.img'. Sometimes HP supplies
these files ready-to-download to the printer, sometimes they are raw
@@ -191,30 +472,19 @@ HP LASERJET 1000/1005/1018/1020 NOTES
"arm2hpdl" program to automatically detect which kind of file they are
and convert them (if needed) to the downloadable '*.dl' format.
- These printers do not have a "button" when you run out of paper. But you
- can simulate this by reloading the paper and doing:
+ These printers do not have a "button" when you run out of paper.
+ But, there is a GNOME gui in:
- $ usb_printerid /dev/usb/lp0
+ Applications -> System Tools -> HPLJ 10xx Replaced Paper
-MAC OS X NOTES
----------------
- Please read the detailed installation instructions by Clint Morgan
- and Rick Richardson in the file INSTALL.osx.
+ It requires tcl, tk, and tix. Fedora 5 and later:
+ # yum install tcl tk tix
-FREEBSD NOTES
--------------
- You need the following packages before you start the "make install":
- # pkg_add -r gmake
- # pkg_add -r ghostscript-gnu
- # pkg_add -r cups
- # pkg_add -r foomatic-filters
+ or, you can simulate this by reloading the paper and doing:
- Use "gmake" instead of "make".
+ $ usb_printerid /dev/usb/lp0
-64-bit GHOSTSCRIPT
-------------------
-Ghostscript before 8.55 has a problem with ICM files and 64-bit gcc.
-It causes a segfault with km2430_2.icm. So don't select that one.
+ or, you can open the print cartridge door and then close it.
PSUTILS AND 2/4-UP CAPABILITY
-----------------------------
@@ -240,6 +510,13 @@ CUSTOM PAGE SIZE
Or, use a GUI that allows the custom size parameters, e.g.
"evince" - PostScript and PDF File Viewer.
+SET DEFAULT MEDIA WITH CUPS
+---------------------------
+ $ sudo
+ # lpoptions -o media=A4
+ -OR-
+ # lpoptions -o media=Letter
+
UPDATE
------
Here are handy lines you can click on to get the latest version:
@@ -256,13 +533,6 @@ UNINSTALLING
$ su
# make uninstall
-SET DEFAULT MEDIA WITH CUPS
----------------------------
- $ sudo
- # lpoptions -o media=A4
- -OR-
- # lpoptions -o media=Letter
-
BUG REPORTS
-----------
PLEASE use the forums at:
@@ -278,6 +548,8 @@ DEVELOPER AND DEBUGGING TIPS
----------------------------
If you want to work on this program, I recommend creating a "raw"
printer queue directed at the printer, with no protocol conversions.
+ OR, simple copy the file to /dev/usb/lp0 (USB) or nc (netcat) the
+ file (network).
Then, you can use the "foo2zjs-wrapper" program to convert Postscript
test programs to ZjS format, and inspect them with "zjsdecode" before
@@ -290,45 +562,166 @@ DEVELOPER AND DEBUGGING TIPS
zjsdecode < testpage.zc
lpr -Praw testpage.zm
-
-CUSTOM ICC/ICM COLOR PRINTER PROFILE
-------------------------------------
+ OR
+ cp testpage.zm /dev/usb/lp0
+ OR
+ nc 192.168.1.NNN 9100 < testpage.zm
+
+ Same thing for the other drivers, e.g. ...
+
+ foo2hiperc-wrapper testpage.ps > testpage.hc
+ hipercdecode < testpage.hc
+ nc 192.168.1.NNN 9100 < testpage.hc
+
+ If the printer is an HP LaserJet 10xx or P1xxx and needs to have the
+ firmware downloaded, this will tell you (P1006):
+ Before:
+ usb_printerid /dev/usb/lp0
+ MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
+ DES:HP LaserJet P1006;
+
+ After:
+ usb_printerid /dev/usb/lp0
+ MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
+ DES:HP LaserJet P1006;FWVER:20080415;
+
+CUSTOM ICC/ICM COLOR PRINTER PROFILE (BUY)
+------------------------------------------
+
+ I need:
+ Samsung CLP-315 default resolution
+ Samsung CLP-600 default resolution
+ Samsung CLP-610 default resolution
+ HP Color LaserJet 1500 default resolution
+ HP Color LaserJet CP1215 default resolution, 1-bit and 2-bit
+ HP Color LaserJet 2600n 2-bit, default resolution
0) Pick a vendor, e.g.
- http://stores.ebay.ie/The-Graphics-Depot
"Custom ICC ICM colour printer profile RGB or CMYK"
+ Seller: personalised101
+ http://stores.ebay.ie/The-Graphics-Depot
+ Cost: 10 pounds
- 1) Convert the vendor sheet(s) from *.tif to *.ps (OPTIONAL)
+ "We Create a Custom ICC Profile for Your Printer-"
+ Seller: fotojimbo
+ http://search.ebay.com/_W0QQsassZfotojimbo
+ Cost: 10 dollars
+
+
+ 1) Convert the vendor sheet(s) from *.tif to page*.ps (OPTIONAL)
$ gimp
OR
+ Preferred, using ImageMagick's "convert"
$ convert Color\ Patch\ RGB\ \(Page\ 1\).tif page1.ps
$ convert Color\ Patch\ RGB\ \(Page\ 2\).tif page2.ps
+ OR
+
+ From *.jpg to *.ps
+ $ convert a300DPI_i1-RGB-1.5.jpg -rotate 90 -density 300x300 \
+ -quality 100 page1.ps
+
2) Print the Postscript vendor sheet(s) with NO color correction:
- $ foo2hp2600-wrapper -c -C10 -Gnone.icm \
- test_sheets_from_icc_vendor.ps > test.prn
+ $ foo2hp2600-wrapper -c -C10 -Gnone.icm page1.ps > test1.prn
- $ nc 192.168.1.xxxxxxx 9100 < test.prn
+ $ nc 192.168.1.xxxxxxx 9100 < test1.prn
OR
- $ cp test.prn /dev/usb/lp0
+ $ cp test1.prn /dev/usb/lp0
+
+ repeat for page2.ps (if necessary).
3) Send them to the vendor by POSTAL MAIL
4) Get back *.icc/*.icm profile by EMAIL or WEB
- 5) Put it in /usr/share/foo2hp/icm/test.icm
+ 5) Put it in /usr/share/foo2hp/icm/testing.icm
6) Print a test picture:
- $ foo2hp2600-wrapper -c -C10 -Gtest.icm \
+ $ foo2hp2600-wrapper -c -C10 -Gtesting.icm \
picture.ps > picture.prn
- 7) If it is OK, send "test.icm" to rick.richardson@comcast.net
+ $ nc 192.168.1.xxxxxxx 9100 < picture.prn
+ OR
+ $ cp picture.prn /dev/usb/lp0
+
+ 7) If it is OK, send "testing.icm" to rick.richardson@comcast.net
for inclusion in foo2zjs.
Other printers: use foo2qpdl-wrapper and /usr/share/foo2qpdl/icm/
Other printers: use foo2lava-wrapper and /usr/share/foo2lava/icm/
+
+CUSTOM ICC/ICM COLOR PRINTER PROFILE (ARGYLL)
+---------------------------------------------
+ Reference:
+ http://www.argyllcms.com/
+
+ DON'T DO THIS ON A 32-BIT (i386) PROCESSOR!
+ Ghostscript (8.63) has problems. Weird color profile data.
+
+ ONLY DO THIS ON A 64-BIT (x86_64)PROCESSOR.
+ But, you can use the color profile on i386 and x86_64.
+
+ YOU HAVE BEEN WARNED!!!
+
+ Free!
+
+ Sample: Samsung CLP-315
+ -----------------------
+
+ On dual:
+ $ targen -v -d4 -l200 -f962 clp315
+ OR
+ $ targen -v -d4 -l200 -f1924 clp315
+ ^--- Green tint to black otherwise
+
+ $ printtarg -v -s -iSS -pLetter clp315
+ $ gs clp315.ps
+
+ print it...
+
+ $ scp clp315.ps amd:
+ $ root chmod 666 /dev/usb/*
+
+ On amd: (64-bit because ghostscript has a problem with 32-bit):
+ $ foo2qpdl-wrapper -z2 -c -C10 -Gnone.icm clp315.ps |
+ ssh dual "cat >/dev/usb/lp1"
+
+ scanned on a Canon LIDE 70 at 300 DPI, color, no auto-clip ...
+
+ On mac:
+ $ scp clp315.TIF dual:clp315.tif
+ OR
+ $ scp clp315-1.TIF dual:clp315-1.tif
+ $ scp clp315-2.TIF dual:clp315-2.tif
+
+ On dual:
+ $ mv ~/clp315*.tif .
+ $ convert -resize 50% clp315.tif xxx.tif
+ OR
+ $ convert -resize 50% clp315-1.tif xxx-1.tif
+ $ convert -resize 50% clp315-2.tif xxx-2.tif
+
+ $ scanin -dipn -v -c xxx.tif clp315.cht ../scanner/scanner.icc clp315
+ OR
+ $ scanin -dipn -v -c xxx-1.tif clp315_01.cht ../scanner/scanner.icc clp315
+ $ scanin -dipn -v -ca xxx-2.tif clp315_02.cht ../scanner/scanner.icc clp315
+
+ $ xv diag.tif
+ Look for a01, a02, etc.
+
+ $ colprof -v -D"clp315" -qm -cmt -dpp -kr clp315
+ [snip]
+ profile check complete, peak err = 5.914383, avg err = 1.314669
+
+ ICC is clp315.icc
+
+ Print test page with clp315.icc
+ $ foo2qpdl-wrapper -z2 -c -C10 -G clp315.icc testpage-cups.ps > /dev/usb/lp1
+
+ If it is OK, send "clp315.icc" to rick.richardson@comcast.net
+ for inclusion in foo2zjs.
diff --git a/INSTALL.osx b/INSTALL.osx
index efbf583..fc15563 100644
--- a/INSTALL.osx
+++ b/INSTALL.osx
@@ -1,5 +1,80 @@
==============================================================================
-INSTALLATION NOTES - HP LaserJet 1018/1020
+MAC OSX INSTALLATION NOTES - HP LaserJet 1018/1020
+Using the "MacPorts" project
+==============================================================================
+by Rick Richardson 02/21/08
+
+1) Browse to:
+ http://developer.apple.com/tools/download/
+
+ Download and install "Xcode", the C compiler.
+
+2) Browse to:
+ http://www.macports.org/install.php/
+
+ Download and install the "Mac OS X Package (.pkg) Installer".
+
+3) Do:
+ $ export PATH=$PATH:/opt/local/bin
+ $ sudo port selfupdate
+ $ sudo port install coreutils
+ $ sudo port install wget
+ $ sudo port install ghostscript
+
+4) Browse to:
+ http://www.linuxprinting.org/download/foomatic/oldstuff/foomatic-filters-3.0.2.tar.gz
+
+ and install the Foomatic-RIP (foomatic-RIP and foomatic-gswrapper).
+
+ $ tar zxvf foomatic-filters-3.0.2.tar.gz
+ $ cd foomatic-filters-3.0.2
+ $ ./configure --prefix=/usr
+ $ make
+ $ sudo make install
+
+5) Now install foo2zjs. Browse to:
+ http://foo2zjs.rkkda.com/
+
+ and follow the instructions.
+
+6) Now configure the printer
+ Choose either 6a) OR 6b)
+
+6a) Mac OS Printer Setup Utility
+ Browse to:
+ http://foo2zjs.rkkda.com/macosx/
+
+6b) CUPS UNIX Printing System
+ Browse to:
+ http://foo2zjs.rkkda.com/cups/
+
+ Then surf to: http://localhost:631 and follow the CUPS instructions.
+
+ In particular, you can set up Color and other things.
+
+ Set Printer Options -> Color Mode -> Color
+
+
+7) If HP LaserJet 10xx, you must send a firmware file to the printer each time
+ you power it up:
+
+ $ lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
+ -OR-
+ $ lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl
+
+Sample Screenshots:
+
+ HP LaserJet 1020:
+ http://foo2zjs.rkkda.com/macosx/
+
+ HP Color LaserJet CP1215:
+ http://foo2hp.rkkda.com/macosx/
+
+
+
+==============================================================================
+MAC OSX INSTALLATION NOTES - HP LaserJet 1018/1020
+Using "fink" project
==============================================================================
by Rick Richardson 04/21/07
@@ -12,16 +87,27 @@ by Rick Richardson 04/21/07
http://www.finkproject.org/download/
Download and install "fink".
+ Double-click "Fink-0.8.1-XYZ-Installer.dmg"
+ (where XYZ is either PowerPC or Intel)
+ to mount the disk image, then double-click the
+ "Fink 0.8.1 XYZ Installer.pkg" package inside.
+ Follow the instructions on screen.
+ $ /sw/bin/pathsetup.sh
+ $ fink scanpackages
+ $ fink index
+ $ sudo apt-get update
+ $ sudo apt-get install fink
3) Do:
$ apt-get install ghostscript
4) Browse to:
- http://www.linux-foundation.org/en/OpenPrinting/MacOSX/foomatic
+ http://www.linuxprinting.org/download/foomatic/foomatic-filters-3.0-current.tar.gz
and install the Foomatic-RIP (foomatic-RIP and foomatic-gswrapper).
- If you are installing from source:
+ $ tar zxvf foomatic-filters-3.0-current.tar.gz
+ $ cd foomatic-filters-3.0-20070820
$ ./configure --prefix=/usr
$ make
$ sudo make install
@@ -31,24 +117,37 @@ by Rick Richardson 04/21/07
and follow the instructions.
-6) Now configure the printer. Browse to:
- http://foo2zjs.rkkda.com/macosx/
+6) Now configure the printer
+ Choose either 6a) OR 6b)
-7) You must send a firmware file to the printer each time you power it up:
+6a) Mac OS Printer Setup Utility
+ Browse to:
+ http://foo2zjs.rkkda.com/macosx/
- $ lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
- -OR-
- $ lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl
+6b) CUPS UNIX Printing System
+ Browse to:
+ http://foo2zjs.rkkda.com/cups/
+ Then surf to: http://localhost:631 and follow the CUPS instructions.
+ In particular, you can set up Color and other things.
+ Set Printer Options -> Color Mode -> Color
+
+
+7) If HP LaserJet 10xx, you must send a firmware file to the printer each time
+ you power it up:
+
+ $ lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
+ -OR-
+ $ lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl
===============================================================================
-INSTALLATION NOTES -- foo2zjs + magicolor 2200DL + OSX
+MAC OSX INSTALLATION NOTES -- foo2zjs + magicolor 2200DL + OSX
===============================================================================
by Clint Morgan <clint@morgantechnologies.com> - 12/29/2003
diff --git a/Makefile b/Makefile
index 05ab1c0..da8cf41 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,15 @@
UNAME := $(shell uname)
MACH := $(shell uname -m | sed 's/i.86/x86_32/')
-EUID := $(shell id -u)
+
+ifeq ($(UNAME),SunOS)
+ EUID := $(shell /usr/xpg4/bin/id -u)
+ SHELL=bash
+ CC=gcc
+ OLDGROFF=OLDGROFF
+else
+ EUID := $(shell id -u)
+endif
+
SYSNAME := $(shell uname -n)
# No version number yet...
@@ -9,6 +18,7 @@ VERSION=0.0
# Installation prefix...
PREFIX=/usr/local
PREFIX=/usr
+PREFIX=$(DESTDIR)/usr
# Pathnames for this package...
BIN=$(PREFIX)/bin
@@ -18,14 +28,17 @@ SHAREHP=$(PREFIX)/share/foo2hp
SHAREXQX=$(PREFIX)/share/foo2xqx
SHARELAVA=$(PREFIX)/share/foo2lava
SHAREQPDL=$(PREFIX)/share/foo2qpdl
+SHARESLX=$(PREFIX)/share/foo2slx
+SHAREHC=$(PREFIX)/share/foo2hiperc
MANDIR=$(PREFIX)/share/man
DOCDIR=$(PREFIX)/share/doc/foo2zjs/
+INSTALL=install
# Pathnames for referenced packages...
-FOODB=/usr/share/foomatic/db/source
+FOODB=$(DESTDIR)/usr/share/foomatic/db/source
# User ID's
-LPuid=-olp
+LPuid=-oroot
LPgid=-glp
ifeq ($(UNAME),Darwin)
LPuid=-oroot
@@ -35,6 +48,15 @@ ifeq ($(UNAME),FreeBSD)
LPuid=-oroot
LPgid=-gwheel
endif
+ifeq ($(UNAME),OpenBSD)
+ LPuid=-oroot
+ LPgid=-gwheel
+endif
+ifeq ($(UNAME),SunOS)
+ LPuid=-oroot
+ LPgid=-glp
+ INSTALL=/usr/ucb/install
+endif
# If we aren't root, don't try to set ownership
ifneq ($(EUID),0)
LPuid=
@@ -46,9 +68,15 @@ MODTIME= date -d "1/1/1970 utc + `stat -t $$1 | cut -f14 -d' '` seconds" "+%a %b
ifeq ($(UNAME),FreeBSD)
MODTIME= stat -f "%Sm" -t "%a %b %d %T %Y" $$1
endif
+ifeq ($(UNAME),OpenBSD)
+ MODTIME= stat -f "%Sm" -t "%a %b %d %T %Y" $$1
+endif
ifeq ($(UNAME),Darwin)
MODTIME= stat -f "%Sm" -t "%a %b %d %T %Y" $$1
endif
+ifeq ($(UNAME),SunOS)
+ MODTIME= `ls -e $$1 | cut -c42-61`
+endif
#
# Files for tarball
@@ -75,6 +103,12 @@ WEBFILES= \
2530.gif \
foo2qpdl.html.in \
archqplp.fig \
+ foo2slx.html.in \
+ archslx.fig \
+ c500n.png \
+ foo2hiperc.html.in \
+ archhiperc.fig \
+ c3400n.png \
$(NULL)
FILES = \
@@ -91,7 +125,8 @@ FILES = \
foo2zjs.1in \
jbig.c \
jbig.h \
- jbig_tab.c \
+ jbig_ar.c \
+ jbig_ar.h \
zjsdecode.c \
zjsdecode.1in \
zjs.h \
@@ -103,6 +138,10 @@ FILES = \
foo2lava.1in \
foo2qpdl.c \
foo2qpdl.1in \
+ foo2slx.c \
+ foo2slx.1in \
+ foo2hiperc.c \
+ foo2hiperc.1in \
cups.h \
xqx.h \
xqxdecode.c \
@@ -114,6 +153,10 @@ FILES = \
qpdldecode.1in \
opldecode.c \
opldecode.1in \
+ slx.h \
+ slxdecode.c \
+ slxdecode.1in \
+ gipddecode.c \
foo2zjs-wrapper.in \
foo2zjs-wrapper.1in \
foo2hp2600-wrapper.in \
@@ -124,6 +167,10 @@ FILES = \
foo2lava-wrapper.1in \
foo2qpdl-wrapper.in \
foo2qpdl-wrapper.1in \
+ foo2slx-wrapper.in \
+ foo2slx-wrapper.1in \
+ foo2hiperc-wrapper.in \
+ foo2hiperc-wrapper.1in \
gamma.ps \
gamma-lookup.ps \
align.ps \
@@ -137,62 +184,70 @@ FILES = \
icc2ps/COPYING \
icc2ps/README \
icc2ps/README.foo2zjs \
+ ppd-adjust \
PPD/*.ppd \
crd/zjs/*.crd \
crd/zjs/*.ps \
crd/qpdl/*cms* \
crd/qpdl/*.ps \
arm2hpdl.c \
+ arm2hpdl.1in \
usb_printerid.c \
+ usb_printerid.1in \
hplj1000 \
hplj10xx.rules \
msexpand \
+ oak.h \
+ foo2oak.c \
foo2oak.1in \
+ oakdecode.c \
+ oakdecode.1in \
foo2oak-wrapper.in \
foo2oak-wrapper.1in \
- oakdecode.1in \
- okidecode.c \
- oki.h \
+ hiperc.h \
+ hipercdecode.c \
+ hipercdecode.1in \
c5200mono.prn \
- $(NULL)
-
-FILESOAK= \
- foo2oak_x86_32.o \
- foo2oak_x86_64.o \
- oakdecode_x86_32.o \
- oakdecode_x86_64.o \
+ foo2zjs-pstops.sh \
+ foo2zjs-pstops.1in \
+ hplj1020.desktop \
+ hplj1020_icon.png \
+ hplj1020_icon.gif \
+ hplj10xx_gui.tcl \
+ includer-man \
+ macros.man \
+ regress.txt \
$(NULL)
# hpclj2600n-0.icm km2430_0.icm km2430_1.icm km2430_2.icm samclp300-0.icm
# sihp1000.img sihp1005.img sihp1020.img sihp1018.img
+# sihpP1005.img sihpP1006.img sihpP1505.img
# Programs and libraries
PROGS= foo2zjs zjsdecode arm2hpdl foo2hp foo2xqx xqxdecode
PROGS+= foo2lava lavadecode foo2qpdl qpdldecode opldecode
-ifeq ($(SYSNAME),amd.rkkda.org)
- PROGS+= okidecode
-endif
-PROGSOAK= okidecode
+PROGS+= foo2oak oakdecode
+PROGS+= foo2slx slxdecode
+PROGS+= foo2hiperc hipercdecode
+PROGS+= gipddecode
SHELLS= foo2zjs-wrapper foo2oak-wrapper foo2hp2600-wrapper \
- foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper
+ foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper \
+ foo2slx-wrapper foo2hiperc-wrapper
+SHELLS+= foo2zjs-pstops
MANPAGES= foo2zjs-wrapper.1 foo2zjs.1 zjsdecode.1
MANPAGES+= foo2oak-wrapper.1 foo2oak.1 oakdecode.1
MANPAGES+= foo2hp2600-wrapper.1 foo2hp.1
MANPAGES+= foo2xqx-wrapper.1 foo2xqx.1 xqxdecode.1
-MANPAGES+= foo2lava-wrapper.1 foo2lava.1 lavadecode.1
+MANPAGES+= foo2lava-wrapper.1 foo2lava.1 lavadecode.1 opldecode.1
MANPAGES+= foo2qpdl-wrapper.1 foo2qpdl.1 qpdldecode.1
-MANPAGES+= opldecode.1
-LIBJBG = jbig.o jbig_tab.o
+MANPAGES+= foo2slx-wrapper.1 foo2slx.1 slxdecode.1
+MANPAGES+= foo2hiperc-wrapper.1 foo2hiperc.1 hipercdecode.1
+MANPAGES+= foo2zjs-pstops.1 arm2hpdl.1 usb_printerid.1
+LIBJBG = jbig.o jbig_ar.o
BINPROGS=
ifeq ($(UNAME),Linux)
BINPROGS += usb_printerid
-# ifeq ($(MACH),x86_32)
-# PROGS += foo2oak oakdecode
-# endif
-# ifeq ($(MACH),x86_64)
-# PROGS += foo2oak oakdecode
-# endif
endif
# Compiler flags
@@ -210,12 +265,12 @@ GSOPTS= -q -dBATCH -dSAFER -dQUIET -dNOPAUSE -sPAPERSIZE=letter -r$(GXR)x$(GYR)
JBGOPTS=-m 16 -d 0 -p 92 # Equivalent options for pbmtojbg
.SUFFIXES: .ps .pbm .pgm .pgm2 .ppm .ppm2 .zjs .cmyk .pksm .zc .zm .jbg \
- .cups .cupm .1 .1in .fig .gif .xqx .lava .qpdl
+ .cups .cupm .1 .1in .fig .gif .xqx .lava .qpdl .slx .hc
.fig.gif:
fig2dev -L gif $*.fig | giftrans -t "#ffffff" -o $*.gif
# fig2dev -L ppm $*.fig | pnmquant -fs 256 \
- | ppmtogif -transparent rgb:ff/ff/ff >$*.gif
+ #| ppmtogif -transparent rgb:ff/ff/ff >$*.gif
.ps.cups:
gs $(GSOPTS) -r600x600 \
@@ -269,10 +324,17 @@ JBGOPTS=-m 16 -d 0 -p 92 # Equivalent options for pbmtojbg
.pbm.qpdl:
./foo2qpdl < $*.pbm > $*.qpdl
+.pbm.slx:
+ ./foo2slx < $*.pbm > $*.slx
+
+.pbm.hc:
+ ./foo2hiperc < $*.pbm > $*.hc
+
#
# The usual build rules
#
-all: all-test $(PROGS) $(BINPROGS) $(SHELLS) getweb all-icc2ps man doc
+all: all-test $(PROGS) $(BINPROGS) $(SHELLS) getweb all-icc2ps man doc \
+ all-done
all-test:
#
@@ -291,6 +353,7 @@ all-test:
echo " *** Error: /usr/include/stdio.h is not installed!"; \
echo " ***"; \
echo " *** Install Software Development (gcc) package"; \
+ echo " *** for Ubuntu: sudo apt-get install build-essential"; \
echo " ***"; \
exit 1; \
fi
@@ -305,6 +368,18 @@ all-test:
# ... OK!
#
+all-done:
+ @echo
+ @echo "It is possible that certain products which can be built using this"
+ @echo "software module might form inventions protected by patent rights in"
+ @echo "some countries (e.g., by patents about arithmetic coding algorithms"
+ @echo "owned by IBM and AT&T in the USA). Provision of this software by the"
+ @echo "author does NOT include any licences for any patents. In those"
+ @echo "countries where a patent licence is required for certain applications"
+ @echo "of this software module, you will have to obtain such a licence"
+ @echo "yourself."
+
+
foo2zjs: foo2zjs.o $(LIBJBG)
$(CC) $(CFLAGS) -o $@ foo2zjs.o $(LIBJBG)
@@ -321,8 +396,15 @@ foo2lava: foo2lava.o $(LIBJBG)
foo2qpdl: foo2qpdl.o $(LIBJBG)
$(CC) $(CFLAGS) -o $@ foo2qpdl.o $(LIBJBG)
-zjsdecode: zjsdecode.o $(LIBJBG)
- $(CC) $(CFLAGS) zjsdecode.o $(LIBJBG) -o $@
+foo2oak: foo2oak.o $(LIBJBG)
+ $(CC) $(CFLAGS) -o $@ foo2oak.o $(LIBJBG)
+
+foo2slx: foo2slx.o $(LIBJBG)
+ $(CC) $(CFLAGS) -o $@ foo2slx.o $(LIBJBG)
+
+foo2hiperc: foo2hiperc.o $(LIBJBG)
+ $(CC) $(CFLAGS) -o $@ foo2hiperc.o $(LIBJBG)
+
foo2zjs-wrapper: foo2zjs-wrapper.in Makefile
[ ! -f $@ ] || chmod +w $@
@@ -354,6 +436,25 @@ foo2qpdl-wrapper: foo2qpdl-wrapper.in Makefile
-e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
chmod 555 $@
+foo2oak-wrapper: foo2oak-wrapper.in Makefile
+ [ ! -f $@ ] || chmod +w $@
+ sed < $@.in > $@ \
+ -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
+ chmod 555 $@
+
+foo2slx-wrapper: foo2slx-wrapper.in Makefile
+ [ ! -f $@ ] || chmod +w $@
+ sed < $@.in > $@ \
+ -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
+ chmod 555 $@
+
+foo2hiperc-wrapper: foo2hiperc-wrapper.in Makefile
+ [ ! -f $@ ] || chmod +w $@
+ sed < $@.in > $@ \
+ -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
+ chmod 555 $@
+
+
getweb: getweb.in Makefile
[ ! -f $@ ] || chmod +w $@
sed < $@.in > $@ \
@@ -364,12 +465,15 @@ getweb: getweb.in Makefile
all-icc2ps:
cd icc2ps; $(MAKE) all
-okidecode: okidecode.o $(LIBJBG)
- $(CC) $(CFLAGS) okidecode.o $(LIBJBG) -o $@
-
ok: ok.o $(LIBJBG)
$(CC) $(CFLAGS) ok.o $(LIBJBG) -o $@
+zjsdecode: zjsdecode.o $(LIBJBG)
+ $(CC) $(CFLAGS) zjsdecode.o $(LIBJBG) -o $@
+
+hipercdecode: hipercdecode.o $(LIBJBG)
+ $(CC) $(CFLAGS) hipercdecode.o $(LIBJBG) -o $@
+
splcdecode: splcdecode.o $(LIBJBG)
$(CC) $(CFLAGS) splcdecode.o $(LIBJBG) -lz -o $@
@@ -385,11 +489,22 @@ qpdldecode: qpdldecode.o $(LIBJBG)
opldecode: opldecode.o $(LIBJBG)
$(CC) $(CFLAGS) -g opldecode.o $(LIBJBG) -o $@
+oakdecode: oakdecode.o $(LIBJBG)
+ $(CC) $(CFLAGS) -g oakdecode.o $(LIBJBG) -o $@
+
+slxdecode: slxdecode.o $(LIBJBG)
+ $(CC) $(CFLAGS) slxdecode.o $(LIBJBG) -o $@
+
+gipddecode: gipddecode.o $(LIBJBG)
+ $(CC) $(CFLAGS) gipddecode.o $(LIBJBG) -o $@
+
#
# Installation rules
#
install: all install-test install-prog install-icc2ps install-extra \
- install-crd install-foo install-ppd install-man install-doc
+ install-crd install-foo install-ppd \
+ install-gui install-desktop \
+ install-man install-doc
#
# If you use CUPS, then restart the spooler:
# make cups
@@ -397,16 +512,23 @@ install: all install-test install-prog install-icc2ps install-extra \
# Now use your printer configuration GUI to create a new printer.
#
# On Redhat 7.2/7.3/8.0/9.0 and Fedora Core 1-5, run "printconf-gui".
- # On Fedora Core 6 and Fedora 7, run "system-config-printer".
+ # On Fedora Core 6 and Fedora 7/8/9, run "system-config-printer".
# On Mandrake, run "printerdrake"
- # On Suse 9.0, run "yast"
+ # On Suse 9.x/10.x/11.x, run "yast"
# On Ubuntu 5.10/6.06/6.10/7.04, run "gnome-cups-manager"
+ # On Ubuntu 7.10/8.x, run "system-config-printer".
install-test:
#
# Installation Dependencies...
#
- @if ! type foomatic-rip >/dev/null 2>&1; then \
+ @if [ -f /usr/local/libexec/cups/filter/foomatic-rip ]; then \
+ : ; \
+ elif [ -f /usr/lib/cups/filter/foomatic-rip ]; then \
+ : ; \
+ elif [ -f /usr/lib/lp/bin/foomatic-rip ]; then \
+ : ; \
+ elif ! type foomatic-rip >/dev/null 2>&1; then \
echo " ***"; \
echo " *** Error: foomatic-rip is not installed!"; \
echo " ***"; \
@@ -418,26 +540,31 @@ install-test:
#
+UDEVBIN=$(DESTDIR)/bin/
+
install-prog:
#
# Install driver, wrapper, and development tools
#
- install -c $(PROGS) $(SHELLS) $(BIN)/
+ $(INSTALL) -d $(BIN)
+ $(INSTALL) -c $(PROGS) $(SHELLS) $(BIN)/
if [ "$(BINPROGS)" != "" ]; then \
- install -c $(BINPROGS) /bin/; \
+ $(INSTALL) -d $(UDEVBIN); \
+ $(INSTALL) -c $(BINPROGS) $(UDEVBIN); \
fi
#
# Install gamma correction files. These are just templates,
# and don't actually do anything right now. If anybody wants
# to tune them or point me at a process for doing that, please...
#
- install -d $(SHAREZJS)/
- install -c -m 644 gamma.ps $(SHAREZJS)/
- install -c -m 644 gamma-lookup.ps $(SHAREZJS)/
- install -d $(SHAREOAK)/
- install -d $(SHAREHP)/
- install -d $(SHAREXQX)/
- install -d $(SHARELAVA)/
+ $(INSTALL) -d $(SHAREZJS)/
+ $(INSTALL) -c -m 644 gamma.ps $(SHAREZJS)/
+ $(INSTALL) -c -m 644 gamma-lookup.ps $(SHAREZJS)/
+ $(INSTALL) -d $(SHAREOAK)/
+ $(INSTALL) -d $(SHAREHP)/
+ $(INSTALL) -d $(SHAREXQX)/
+ $(INSTALL) -d $(SHARELAVA)/
+ $(INSTALL) -d $(SHAREHC)/
install-foo:
#
@@ -447,13 +574,18 @@ install-foo:
rm -f $(FOODB)/opt/foo2zjs-PaperSize.xml
rm -f $(FOODB)/opt/foo2zjs-Source.xml
rm -f $(FOODB)/opt/foo2zjs-DitherPPI.xml
+ rm -f $(FOODB)/opt/foo2zjs-Copies.xml
+ rm -f $(FOODB)/opt/foo2zjs-Nup.xml
+ rm -f $(FOODB)/opt/foo2zjs-NupOrient.xml
+ rm -f $(FOODB)/opt/foo2*-Quality.xml
+ rm -f $(FOODB)/printer/KonicaMinolta*.xml
#
# Install current database files
#
@if [ -d $(FOODB) ]; then \
for dir in driver printer opt; do \
echo install -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
- install -c -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
+ $(INSTALL) -c -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
done \
else \
echo "***"; \
@@ -486,28 +618,28 @@ install-crd:
#
# Install prebuilt CRD files (from m2300w project)
#
- install -d $(SHAREZJS)/
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/crd/
+ $(INSTALL) -d $(SHAREZJS)/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/crd/
for i in crd/zjs/*.*; do \
- install -c -m 644 $$i $(SHAREZJS)/crd/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREZJS)/crd/; \
done
#
# Install prebuilt CRD files for CLP-300/CLP-600
#
- install -d $(SHAREQPDL)/
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREQPDL)/crd/
+ $(INSTALL) -d $(SHAREQPDL)/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREQPDL)/crd/
for i in crd/qpdl/*cms* crd/qpdl/*.ps; do \
- install -c -m 644 $$i $(SHAREQPDL)/crd/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREQPDL)/crd/; \
done
install-psfiles:
#
# Install prebuilt psfiles files (from m2300w project)
#
- install -d $(SHAREHP)/
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREHP)/psfiles/
+ $(INSTALL) -d $(SHAREHP)/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREHP)/psfiles/
for i in psfiles/*.*; do \
- install -c -m 644 $$i $(SHAREHP)/psfiles/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREHP)/psfiles/; \
done
install-extra:
@@ -517,60 +649,100 @@ install-extra:
# Get files from the printer manufacturer, i.e. www.minolta-qms.com,
# or use the "./getweb" convenience script.
#
- install -d $(SHAREZJS)/
+ $(INSTALL) -d $(SHAREZJS)/
# foo2zjs ICM files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/icm/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/icm/
for i in DL*.icm CP*.icm km2430*.icm; do \
if [ -f $$i ]; then \
- install -c -m 644 $$i $(SHAREZJS)/icm/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREZJS)/icm/; \
fi; \
done
# foo2zjs Firmware files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/firmware/
- for i in sihp*.img; do \
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/firmware/
+ for i in sihp1*.img; do \
if [ -f $$i ]; then \
base=`basename $$i .img`; \
./arm2hpdl $$i >$$base.dl; \
- install -c -m 644 $$base.dl $(SHAREZJS)/firmware/; \
+ $(INSTALL) -c -m 644 $$base.dl $(SHAREZJS)/firmware/; \
+ fi; \
+ done
+ # foo2xqx Firmware files (if any)
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREXQX)/firmware/
+ for i in sihpP*.img; do \
+ if [ -f $$i ]; then \
+ base=`basename $$i .img`; \
+ ./arm2hpdl $$i >$$base.dl; \
+ $(INSTALL) -c -m 644 $$base.dl $(SHAREXQX)/firmware/; \
fi; \
done
# foo2oak ICM files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREOAK)/icm/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREOAK)/icm/
+ for i in hpclj26*.icm; do \
+ if [ -f $$i ]; then \
+ $(INSTALL) -c -m 644 $$i $(SHAREOAK)/icm/; \
+ fi; \
+ done
# foo2hp ICM files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREHP)/icm/
- for i in hpclj26*.icm km2430*.icm; do \
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREHP)/icm/
+ for i in hpclj26*.icm km2430*.icm hp1215*.icm; do \
if [ -f $$i ]; then \
- install -c -m 644 $$i $(SHAREHP)/icm/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREHP)/icm/; \
fi; \
done
# foo2lava ICM files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHARELAVA)/icm/
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHARELAVA)/icm/
for i in km2530*.icm; do \
if [ -f $$i ]; then \
- install -c -m 644 $$i $(SHARELAVA)/icm/; \
+ $(INSTALL) -c -m 644 $$i $(SHARELAVA)/icm/; \
fi; \
done
# foo2qpdl ICM files (if any)
- install $(LPuid) $(LPgid) -m 775 -d $(SHAREQPDL)/icm/
- for i in samclp300*.icm; do \
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREQPDL)/icm/
+ for i in samclp*.icm; do \
+ if [ -f $$i ]; then \
+ $(INSTALL) -c -m 644 $$i $(SHAREQPDL)/icm/; \
+ fi; \
+ done
+ # foo2slx ICM files (if any)
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHARESLX)/icm/
+ for i in lex*.icm; do \
+ if [ -f $$i ]; then \
+ $(INSTALL) -c -m 644 $$i $(SHARESLX)/icm/; \
+ fi; \
+ done
+ # foo2hiperc ICM files (if any)
+ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREHC)/icm/
+ for i in OK*.icm C3400*.icm; do \
if [ -f $$i ]; then \
- install -c -m 644 $$i $(SHAREQPDL)/icm/; \
+ $(INSTALL) -c -m 644 $$i $(SHAREHC)/icm/; \
fi; \
done
-MODEL=/usr/share/cups/model
-LOCALMODEL=/usr/local/share/cups/model
-PPD=/usr/share/ppd
+MODEL=$(DESTDIR)/usr/share/cups/model
+LOCALMODEL=$(DESTDIR)/usr/local/share/cups/model
+PPD=$(DESTDIR)/usr/share/ppd
+VARPPD=/var/lp/ppd
install-ppd:
#
# Install PPD files for CUPS
#
- if [ -d $(PPD) ]; then \
- find $(PPD) -name '*foo2zjs*' | xargs rm -f; \
- find $(PPD) -name '*foo2hp*' | xargs rm -f; \
- find $(PPD) -name '*foo2xqx*' | xargs rm -f; \
- find $(PPD) -name '*foo2lava*' | xargs rm -f; \
- find $(PPD) -name '*foo2qpdl*' | xargs rm -f; \
+ if [ -x /usr/sbin/ppdmgr -a -s $(VARPPD)/ppdcache ]; then \
+ $(INSTALL) $(LPgid) -d $(VARPPD)/user; \
+ cd PPD; \
+ for ppd in *.ppd; do \
+ manuf=`echo "$$ppd" | sed 's/-.*//'`; \
+ $(INSTALL) $(LPgid) -d $(VARPPD)/user/$$manuf; \
+ gzip < $$ppd > $(VARPPD)/user/$$manuf/$$ppd.gz; \
+ done; \
+ ppdmgr -u; \
+ elif [ -d $(PPD) ]; then \
+ find $(PPD) -name '*foo2zjs*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2hp*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2xqx*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2lava*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2qpdl*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2slx*' | xargs rm -rf; \
+ find $(PPD) -name '*foo2hiperc*' | xargs rm -rf; \
[ -d $(PPD)/foo2zjs ] || mkdir $(PPD)/foo2zjs; \
cd PPD; \
for ppd in *.ppd; do \
@@ -578,17 +750,45 @@ install-ppd:
done; \
fi
if [ -d $(MODEL) ]; then \
+ rm -f $(MODEL)/KonicaMinolta*; \
cd PPD; \
for ppd in *.ppd; do \
gzip < $$ppd > $(MODEL)/$$ppd.gz; \
done; \
elif [ -d $(LOCALMODEL) ]; then \
+ rm -f $(LOCALMODEL)/KonicaMinolta*; \
cd PPD; \
for ppd in *.ppd; do \
gzip < $$ppd > $(LOCALMODEL)/$$ppd.gz; \
done; \
fi
+APPL=$(DESTDIR)/usr/share/applications
+OLDAPPL=$(DESTDIR)/usr/share/gnome/apps/System
+PIXMAPS=$(DESTDIR)/usr/share/pixmaps
+
+install-desktop:
+ #
+ # Install GNOME desktop
+ #
+ if [ -d $(APPL) ]; then \
+ $(INSTALL) -c -m 644 hplj1020.desktop $(APPL); \
+ fi
+ if [ -d $(OLDAPPL) ]; then \
+ $(INSTALL) -c -m 644 hplj1020.desktop $(OLDAPPL); \
+ fi
+ if [ -d $(PIXMAPS) ]; then \
+ $(INSTALL) -c -m 644 hplj1020_icon.png $(PIXMAPS); \
+ fi
+
+install-gui:
+ #
+ # Install GUI
+ #
+ $(INSTALL) -c -m 644 hplj1020_icon.gif $(SHAREZJS)
+ $(INSTALL) -c -m 755 hplj10xx_gui.tcl $(SHAREZJS)
+
+
USBDIR=/etc/hotplug/usb
UDEVDIR=/etc/udev/rules.d
RULES=hplj10xx.rules
@@ -611,17 +811,27 @@ install-hotplug-test:
install-hotplug-prog:
if [ -d $(UDEVDIR) ]; then \
- install -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
+ $(INSTALL) -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
fi
- [ -d $(USBDIR) ] || install -d -m 755 $(USBDIR)/
- install -c -m 755 hplj1000 $(USBDIR)/
+ [ -d $(USBDIR) ] || $(INSTALL) -d -m 755 $(USBDIR)/
+ $(INSTALL) -c -m 755 hplj1000 $(USBDIR)/
ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1005
ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1018
ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1020
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1005
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1006
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1007
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1008
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1505
$(USBDIR)/hplj1000 install-usermap
$(USBDIR)/hplj1005 install-usermap
$(USBDIR)/hplj1018 install-usermap
$(USBDIR)/hplj1020 install-usermap
+ $(USBDIR)/hpljP1005 install-usermap
+ $(USBDIR)/hpljP1006 install-usermap
+ $(USBDIR)/hpljP1007 install-usermap
+ $(USBDIR)/hpljP1008 install-usermap
+ $(USBDIR)/hpljP1505 install-usermap
cups: FRC
if [ -x /etc/init.d/cups ]; then \
@@ -655,12 +865,24 @@ uninstall:
-rm -f /etc/udev/rules.d/58-foo2zjs.rules #
-rm -f /sbin/foo2zjs-loadfw #
-rm -rf /usr/share/doc/foo2zjs/
+ -rm -f $(MANDIR)/man1/foo2zjs*.1 $(MANDIR)/man1/zjsdecode.1
+ -rm -f $(MANDIR)/man1/foo2hp*.1
+ -rm -f $(MANDIR)/man1/foo2oak*.1 $(MANDIR)/man1/oakdecode.1
+ -rm -f $(MANDIR)/man1/foo2lava*.1 $(MANDIR)/man1/lavadecode.1
+ -rm -f $(MANDIR)/man1/foo2qpdl*.1 $(MANDIR)/man1/qpdldecode.1
+ -rm -f $(MANDIR)/man1/foo2slx*.1 $(MANDIR)/man1/slxdecode.1
+ -rm -f $(MANDIR)/man1/foo2xqx*.1 $(MANDIR)/man1/xqxdecode.1
+ -rm -f $(MANDIR)/man1/opldecode.1 $(MANDIR)/man1/rodecode.1
+ -rm -f $(MANDIR)/man1/foo2hiperc*.1 $(MANDIR)/man1/hipercdecode.1
+ -rm -f $(MANDIR)/man1/arm2hpdl.1 $(MANDIR)/man1/usb_printerid.1
-rm -rf /usr/share/foo2zjs/
-rm -rf /usr/share/foo2hp/
-rm -rf /usr/share/foo2oak/
-rm -rf /usr/share/foo2xqx/
-rm -rf /usr/share/foo2lava/
-rm -rf /usr/share/foo2qpdl/
+ -rm -rf /usr/share/foo2slx/
+ -rm -rf /usr/share/foo2hiperc/
-rm -f /usr/bin/arm2hpdl
-rm -f /usr/bin/foo2zjs-wrapper /usr/bin/foo2zjs /usr/bin/zjsdecode
-rm -f /usr/bin/foo2oak-wrapper /usr/bin/foo2oak /usr/bin/oakdecode
@@ -668,8 +890,15 @@ uninstall:
-rm -f /usr/bin/foo2xqx-wrapper /usr/bin/foo2xqx /usr/bin/xqxdecode
-rm -f /usr/bin/foo2lava-wrapper /usr/bin/foo2lava /usr/bin/lavadecode
-rm -f /usr/bin/foo2qpdl-wrapper /usr/bin/foo2qpdl /usr/bin/qpdldecode
+ -rm -f /usr/bin/foo2slx-wrapper /usr/bin/foo2slx /usr/bin/slxdecode
+ -rm -f /usr/bin/foo2hiperc-wrapper /usr/bin/foo2hiperc
+ -rm -f /usr/bin/hipercdecode
-rm -f /usr/bin/opldecode
+ -rm -f /usr/bin/rodecode
-rm -f /usr/bin/foo2zjs-icc2ps
+ -rm -f /usr/bin/foo2zjs-pstops
+ -rm -f /usr/share/applications/hplj1020.desktop
+ -rm -f /usr/share/pixmaps/hplj1020_icon.png
-cd foomatic-db; for i in `find driver opt printer -name "*.xml"`; do \
rm -f $(FOODB)/$$i; \
done
@@ -685,13 +914,16 @@ clean:
-rm -f $(PROGS) $(BINPROGS) $(SHELLS)
-rm -f *.zc *.zm
-rm -f xxx.* xxxomatic
- -rm -f foo2zjs.o jbig.o jbig_tab.o zjsdecode.o foo2hp.o
+ -rm -f foo2zjs.o jbig.o jbig_ar.o zjsdecode.o foo2hp.o
+ -rm -f foo2oak.o oakdecode.o
-rm -f foo2xqx.o xqxdecode.o
-rm -f foo2lava.o lavadecode.o
-rm -f foo2qpdl.o qpdldecode.o
- -rm -f opldecode.o
+ -rm -f foo2slx.o slxdecode.o
+ -rm -f foo2hiperc.o hipercdecode.o
+ -rm -f opldecode.o gipddecode.o
-rm -f foo2oak.html foo2zjs.html foo2hp.html foo2xqx.html foo2lava.html
- -rm -f foo2qpdl.html
+ -rm -f foo2slx.html foo2qpdl.html foo2hiperc.html
-rm -f index.html
-rm -f arch*.gif
-rm -f sihp*.dl
@@ -702,7 +934,6 @@ clean:
-rm -f *.zjs *.zm *.zc *.zc? *.zc?? *.oak *.pbm *.pksm *.cmyk
-rm -f pksm2bitcmyk
-rm -f *.icm.*.ps
- -rm -f okidecode.o
cd icc2ps; $(MAKE) $@
#
@@ -712,18 +943,23 @@ zjsdecode.o: zjs.h jbig.h
foo2zjs.o: zjs.h jbig.h
jbig.o: jbig.h
foo2hp.o: zjs.h jbig.h cups.h
-xqxdecode.o: xqx.h jbig.h
foo2xqx.o: xqx.h jbig.h
-lavadecode.o: jbig.h
foo2lava.o: jbig.h
-qpdldecode.o: jbig.h
foo2qpdl.o: jbig.h qpdl.h
+foo2slx.o: slx.h jbig.h
+foo2hiperc.o: jbig.h hiperc.h
+hipercdecode.o: hiperc.h jbig.h
+lavadecode.o: jbig.h
+qpdldecode.o: jbig.h
opldecode.o: jbig.h
+slxdecode.o: slx.h jbig.h
+xqxdecode.o: xqx.h jbig.h
#
# foo2* Regression tests
#
test: testzjs testhp
+ @ls -l *.z* #*.oak
#
# All regression tests passed.
#
@@ -740,59 +976,49 @@ testzjs: testpage.zm \
testpage.zm: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
#
# Tests will pass only if you are using ghostscript-7.05-24.7
- # or ghostscript-8.15.2-1.1
+ # or ghostscript-8.62 (gs.foo)
#
# Monochrome test page for Minolta 2200/2300 DL
- PATH=.:$$PATH time -p foo2zjs-wrapper -b gs testpage.ps > $@
- @want1="c4cf1940d6fb854cc3efdd6283388ea4 $@"; \
- want2="0900df1fe16dd6bb96958bcb5e8e2550 $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ PATH=.:$$PATH time -p foo2zjs-wrapper testpage.ps > $@
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
testpage.zc10: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
#
# Color test page for Minolta 2200/2300 DL
- PATH=.:$$PATH time -p foo2zjs-wrapper -b gs -c -C10 testpage.ps > $@
- @want1="3d3b6fc08d9a1c9f80a99fec867596df $@"; \
- want2="12991b79ed11b18a639d6fd72e92477b $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ PATH=.:$$PATH time -p foo2zjs-wrapper -c -C10 testpage.ps > $@
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
testpage.zc1: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
PATH=.:$$PATH time -p foo2zjs-wrapper -c -C1 testpage.ps > $@
- @want="3d3b6fc08d9a1c9f80a99fec867596df $@"; got=`md5sum $@`; \
- #[ "$$want" = "$$got" ] || \
- # { echo "*** Test failure, got $$got"; exit 1; }
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
testpage.zc2: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
PATH=.:$$PATH time -p foo2zjs-wrapper -c -C2 testpage.ps > $@
- @want="3d3b6fc08d9a1c9f80a99fec867596df $@"; got=`md5sum $@`; \
- #[ "$$want" = "$$got" ] || \
- # { echo "*** Test failure, got $$got"; exit 1; }
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
testpage.zc3: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
PATH=.:$$PATH time -p foo2zjs-wrapper -c -C3 testpage.ps > $@
- @want="3d3b6fc08d9a1c9f80a99fec867596df $@"; got=`md5sum $@`; \
- #[ "$$want" = "$$got" ] || \
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
lj1000.zm: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
#
# Monochrome test page for HP LJ1000
- PATH=.:$$PATH time -p foo2zjs-wrapper -b gs -r600x600 -P testpage.ps >$@
- @want1="e458bacac57331ec5206cacd0181fe8a $@"; \
- want2="ee7ff564b881ce9ee44e47f1dbede560 $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ PATH=.:$$PATH time -p foo2zjs-wrapper -r600x600 -P testpage.ps >$@
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
lj1020.zm: testpage.ps foo2zjs-wrapper foo2zjs Makefile FRC
#
# Monochrome test page for HP LJ1020
- PATH=.:$$PATH time -p foo2zjs-wrapper -b gs -r600x600 -P -z1 \
+ PATH=.:$$PATH time -p foo2zjs-wrapper -r600x600 -P -z1 \
testpage.ps >$@
- @want1="391f91cd50781f733cfa7df44272da09 $@"; \
- want2="1a33dfc460a5725bb7dbc34a7342b092 $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
#
# foo2hp Regression tests
@@ -803,19 +1029,15 @@ lj2600.zm1: testpage.ps foo2hp2600-wrapper foo2hp Makefile FRC
#
# Monochrome test page for HP 2600n (1-bit)
PATH=.:$$PATH time -p foo2hp2600-wrapper testpage.ps > $@
- @want1="11888137a72c4fd0ab1f791d1600fba0 $@"; \
- want2="a768fc2854434276dd8a274896af5d4f $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
lj2600.zc1: testpage.ps foo2hp2600-wrapper foo2hp Makefile FRC
#
# Color test page for HP 2600n (1-bit)
PATH=.:$$PATH time -p foo2hp2600-wrapper -c testpage.ps > $@
- @want1="a20f0d33017200d64ce9aec9fc0111af $@"; \
- want2="88e77799c6e10b15586e9584afa50c09 $@"; \
- got=`md5sum $@`; [ "$$want1" = "$$got" -o "$$want2" = "$$got" ] || \
- { echo "*** Test failure, got $$got"; exit 1; }
+ @got=`md5sum $@`; grep -q "$$got" regress.txt || \
+ { echo "*** Test failure, got $$got"; ls -l $@; exit 1; }
#
# foo2oak Regression tests
@@ -885,7 +1107,46 @@ xxx.zm: FRC
#
# PPD files
#
+FOOPRINT=*.xml
ppd:
+ #
+ # Generate PPD files using local tools
+ #
+ [ -d PPD ] || mkdir PPD
+ > foomatic-db/oldprinterids
+ cd foomatic-db; rm -f db; ln -sf . db
+ cd foomatic-db; rm -f source; ln -sf . source
+ for i in foomatic-db/printer/$(FOOPRINT); \
+ do \
+ printer=`basename $$i .xml`; \
+ echo $$printer; \
+ case "$$printer" in \
+ *M1005*|*M1120*) driver=foo2xqx;; \
+ *P1[05]0[5678]*) driver=foo2xqx;; \
+ *P2014*) driver=foo2xqx;; \
+ *1500*|*OAKT*) driver=foo2oak;; \
+ *P2035*) driver=foo2zjs;; \
+ *1635*|*2035*) driver=foo2oak-z1;; \
+ *1600*|*2600*) driver=foo2hp;; \
+ *1215*) driver=foo2hp;; \
+ *2530*|*24[89]0*) driver=foo2lava;; \
+ *6115*) driver=foo2lava;; \
+ *C500*) driver=foo2slx;; \
+ *C3[1234]00*) driver=foo2hiperc;; \
+ *C3530*) driver=foo2hiperc;; \
+ *C5[12568]00*) driver=foo2hiperc;; \
+ *CLP*|*CLX*|*6110*) driver=foo2qpdl;; \
+ *) driver=foo2zjs;; \
+ esac; \
+ ENGINE=../foomatic/foomatic-db-engine; \
+ PERL5LIB=$$ENGINE/lib \
+ FOOMATICDB=foomatic-db \
+ $$ENGINE/foomatic-ppdfile \
+ -d $$driver -p $$printer \
+ > PPD/$$printer.ppd; \
+ done
+
+oldppd:
# Did you do a "make install"????
./getweb ppd
@@ -895,18 +1156,22 @@ ppd:
#
man: $(MANPAGES)
-.1in.1:
+$(MANPAGES): macros.man includer-man
+
+.1in.1:
-rm -f $*.1
modtime() { $(MODTIME); }; \
MODpage=`modtime $*.1in`; \
MODver=$(VERSION); \
- sed < $*.1in > $*.1 \
+ ./includer-man -v DEF1=$(OLDGROFF) $*.1in | sed > $*.1 \
-e "s@\$${URLOAK}@$(URLOAK)@" \
-e "s@\$${URLZJS}@$(URLZJS)@" \
-e "s@\$${URLHP}@$(URLHP)@" \
-e "s@\$${URLXQX}@$(URLXQX)@" \
-e "s@\$${URLLAVA}@$(URLLAVA)@" \
-e "s@\$${URLQPDL}@$(URLQPDL)@" \
+ -e "s@\$${URLSLX}@$(URLSLX)@" \
+ -e "s@\$${URLHC}@$(URLHC)@" \
-e "s/\$${MODpage}/$$MODpage/" \
-e "s/\$${MODver}/$$MODver/"
chmod -w $*.1
@@ -915,26 +1180,35 @@ install-man: man
#
# Install manual pages
#
- install -d -m 755 $(MANDIR)
- install -d -m 755 $(MANDIR)/man1/
- install -c -m 644 foo2zjs.1 $(MANDIR)/man1/
- install -c -m 644 foo2zjs-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 zjsdecode.1 $(MANDIR)/man1/
- install -c -m 644 foo2oak.1 $(MANDIR)/man1/
- install -c -m 644 foo2oak-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 oakdecode.1 $(MANDIR)/man1/
- install -c -m 644 foo2hp.1 $(MANDIR)/man1/
- install -c -m 644 foo2hp2600-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 xqxdecode.1 $(MANDIR)/man1/
- install -c -m 644 foo2xqx.1 $(MANDIR)/man1/
- install -c -m 644 foo2xqx-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 lavadecode.1 $(MANDIR)/man1/
- install -c -m 644 foo2lava.1 $(MANDIR)/man1/
- install -c -m 644 foo2lava-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 qpdldecode.1 $(MANDIR)/man1/
- install -c -m 644 foo2qpdl.1 $(MANDIR)/man1/
- install -c -m 644 foo2qpdl-wrapper.1 $(MANDIR)/man1/
- install -c -m 644 opldecode.1 $(MANDIR)/man1/
+ $(INSTALL) -d -m 755 $(MANDIR)
+ $(INSTALL) -d -m 755 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2zjs.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2zjs-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 zjsdecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2oak.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2oak-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 oakdecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2hp.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2hp2600-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 xqxdecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2xqx.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2xqx-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 lavadecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2lava.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2lava-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 qpdldecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2qpdl.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2qpdl-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 opldecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 slxdecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2slx.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2slx-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2hiperc.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2hiperc-wrapper.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 hipercdecode.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 foo2zjs-pstops.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 arm2hpdl.1 $(MANDIR)/man1/
+ $(INSTALL) -c -m 644 usb_printerid.1 $(MANDIR)/man1/
doc: README INSTALL manual.pdf
@@ -942,13 +1216,13 @@ install-doc: doc
#
# Install documentation
#
- install -d -m 755 $(DOCDIR)
- install -c -m 644 manual.pdf $(DOCDIR)
- install -c -m 644 COPYING $(DOCDIR)
- install -c -m 644 INSTALL $(DOCDIR)
- install -c -m 644 INSTALL.osx $(DOCDIR)
- install -c -m 644 README $(DOCDIR)
- install -c -m 644 ChangeLog $(DOCDIR)
+ $(INSTALL) -d -m 755 $(DOCDIR)
+ $(INSTALL) -c -m 644 manual.pdf $(DOCDIR)
+ $(INSTALL) -c -m 644 COPYING $(DOCDIR)
+ $(INSTALL) -c -m 644 INSTALL $(DOCDIR)
+ $(INSTALL) -c -m 644 INSTALL.osx $(DOCDIR)
+ $(INSTALL) -c -m 644 README $(DOCDIR)
+ $(INSTALL) -c -m 644 ChangeLog $(DOCDIR)
GROFF=/usr/local/test/bin/groff
GROFF=groff
@@ -962,11 +1236,16 @@ README: README.in
-e "s@\$${URLZJS}@$(URLZJS)@"
chmod -w $@
-INSTALL: INSTALL.in
+INSTALL: INSTALL.in Makefile
rm -f $@
- sed < $@.in > $@ \
+ echo "TOPICS" > $@.tmp
+ echo "------" >> $@.tmp
+ grep ^[A-Z][A-Z] $@.in | sed "s/^/ * /" >> $@.tmp
+ echo >> $@.tmp
+ cat $@.tmp $@.in | sed > $@ \
-e "s@\$${URLOAK}@$(URLOAK)@" \
-e "s@\$${URLZJS}@$(URLZJS)@"
+ rm -f $@.tmp
chmod -w $@
#
@@ -1006,6 +1285,15 @@ tar:
sed -e "s?^?$$HERE/?" | \
(cd ..; tar -c -z -f $$HERE/$$HERE.tar.gz -T-)
+tarver:
+ HERENO=`basename $$PWD`; \
+ HERE=`basename $$PWD-$(VERSION)`; \
+ ln -sf $$HERENO ../$$HERE; \
+ /bin/ls $(FILES) | \
+ sed -e "s?^?$$HERE/?" | \
+ (cd ..; tar -c -z -f $$HERE/$$HERE.tar.gz -T-); \
+ rm -f ../$$HERE
+
#
# Populate the web site
# make web
@@ -1018,10 +1306,13 @@ URLHP=http://foo2hp.rkkda.com
URLXQX=http://foo2xqx.rkkda.com
URLLAVA=http://foo2lava.rkkda.com
URLQPDL=http://foo2qpdl.rkkda.com
+URLSLX=http://foo2slx.rkkda.com
+URLHC=http://foo2hiperc.rkkda.com
FTPSITE=~/.ncftp-website
foo2zjs.html foo2oak.html foo2hp.html \
- foo2xqx.html foo2lava.html foo2qpdl.html: thermometer.gif FRC
+ foo2xqx.html foo2lava.html foo2qpdl.html \
+ foo2slx.html foo2hiperc.html: thermometer.gif FRC
rm -f $@
HERE=`basename $$PWD`; \
TZ=`date | cut -c 21-24`; \
@@ -1036,6 +1327,8 @@ foo2zjs.html foo2oak.html foo2hp.html \
-e "s@\$${URLXQX}@$(URLXQX)@g" \
-e "s@\$${URLLAVA}@$(URLLAVA)@g" \
-e "s@\$${URLQPDL}@$(URLQPDL)@g" \
+ -e "s@\$${URLSLX}@$(URLSLX)@g" \
+ -e "s@\$${URLHC}@$(URLHC)@g" \
-e "s@\$${PRODUCT}@$$PRODUCT@g" \
-e "s/\$${MODindex}/$$MODindex $$TZ/" \
-e "s/\$${MODtarball}/$$MODtarball $$TZ/"
@@ -1043,53 +1336,75 @@ foo2zjs.html foo2oak.html foo2hp.html \
web: test tar manual.pdf webindex
ncftpput -m -f $(FTPSITE) foo2zjs \
- ChangeLog INSTALL manual.pdf *.tar.gz;
+ ChangeLog INSTALL manual.pdf foo2zjs.tar.gz;
webt: tar manual.pdf webindex
ncftpput -m -f $(FTPSITE) foo2zjs \
- ChangeLog INSTALL manual.pdf *.tar.gz;
+ ChangeLog INSTALL manual.pdf foo2zjs.tar.gz;
webworld: web webpics
-webindex: INSTALL zjsindex oakindex hpindex xqxindex lavaindex qpdlindex
+webindex: INSTALL zjsindex oakindex hpindex xqxindex lavaindex \
+ qpdlindex oakindex slxindex hcindex
-webpics: redhat suse ubuntu mandriva
+webpics: redhat suse ubuntu mandriva fedora
zjsindex: foo2zjs.html archzjs.gif thermometer.gif
ln -sf foo2zjs.html index.html
ncftpput -m -f $(FTPSITE) foo2zjs \
index.html style.css archzjs.gif thermometer.gif \
- INSTALL INSTALL.osx zjsfavicon.png;
+ flags.png INSTALL INSTALL.osx zjsfavicon.png;
oakindex: foo2oak.html archoak.gif thermometer.gif
ln -sf foo2oak.html index.html
ncftpput -m -f $(FTPSITE) foo2oak \
index.html style.css archoak.gif thermometer.gif \
- INSTALL;
+ flags.png INSTALL;
hpindex: foo2hp.html archhp.gif thermometer.gif
ln -sf foo2hp.html index.html
ncftpput -m -f $(FTPSITE) foo2hp \
index.html style.css archhp.gif thermometer.gif \
- INSTALL hpfavicon.png;
+ flags.png INSTALL hpfavicon.png;
xqxindex: foo2xqx.html archxqx.gif thermometer.gif
ln -sf foo2xqx.html index.html
ncftpput -m -f $(FTPSITE) foo2xqx \
index.html style.css archxqx.gif thermometer.gif \
- INSTALL xqxfavicon.png;
+ flags.png INSTALL xqxfavicon.png;
lavaindex: foo2lava.html archlava.gif thermometer.gif
ln -sf foo2lava.html index.html
ncftpput -m -f $(FTPSITE) foo2lava \
index.html style.css archlava.gif thermometer.gif \
- INSTALL lavafavicon.png;
+ flags.png INSTALL lavafavicon.png;
qpdlindex: foo2qpdl.html archqpdl.gif thermometer.gif
ln -sf foo2qpdl.html index.html
ncftpput -m -f $(FTPSITE) foo2qpdl \
index.html style.css archqpdl.gif thermometer.gif \
- INSTALL qpdlfavicon.png;
+ flags.png INSTALL qpdlfavicon.png;
+
+slxindex: foo2slx.html archslx.gif thermometer.gif
+ ln -sf foo2slx.html index.html
+ ncftpput -m -f $(FTPSITE) foo2slx \
+ index.html style.css archslx.gif thermometer.gif \
+ flags.png INSTALL slxfavicon.png;
+
+hcindex: foo2hiperc.html archhiperc.gif thermometer.gif
+ ln -sf foo2hiperc.html index.html
+ ncftpput -m -f $(FTPSITE) foo2hiperc \
+ index.html style.css archhiperc.gif thermometer.gif \
+ flags.png INSTALL hipercfavicon.png;
+
+foo2zjs.html: warning.html contribute.html resources.html unsupported.html
+foo2hp.html: warning.html contribute.html resources.html unsupported.html
+foo2xqx.html: warning.html contribute.html resources.html unsupported.html
+foo2lava.html: warning.html contribute.html resources.html unsupported.html
+foo2qpdl.html: warning.html contribute.html resources.html unsupported.html
+foo2slx.html: warning.html contribute.html resources.html unsupported.html
+foo2hiperc.html: warning.html contribute.html resources.html unsupported.html
+foo2oak.html: warning.html contribute.html resources.html unsupported.html
# RedHat
redhat: FRC
@@ -1113,28 +1428,52 @@ mandriva: FRC
#
webextra: webicm webfw
-webicm: icm/km2430.tar.gz icm/hpclj2600n.tar.gz icm/km2530.tar.gz \
- icm/samclp300.tar.gz
- ncftpput -m -f $(FTPSITE) foo2zjs icm/km2430.tar.gz;
- ncftpput -m -f $(FTPSITE) foo2hp icm/hpclj2600n.tar.gz;
- ncftpput -m -f $(FTPSITE) foo2lava icm/km2530.tar.gz;
- ncftpput -m -f $(FTPSITE) foo2qpdl icm/samclp300.tar.gz;
+webicm: icm/km2430.tar.gz icm/hpclj2600n.tar.gz \
+ icm/hp1215.tar.gz icm/km2530.tar.gz \
+ icm/samclp300.tar.gz icm/samclp315.tar.gz \
+ icm/lexc500.tar.gz \
+ icm/okic3200.tar.gz icm/okic3400.tar.gz icm/okic5600.tar.gz
+ ncftpput -m -f $(FTPSITE) foo2zjs/icm icm/km2430.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2hp/icm icm/hpclj2600n.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2hp/icm icm/hp1215.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2lava/icm icm/km2530.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2qpdl/icm icm/samclp300.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2qpdl/icm icm/samclp315.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2slx/icm icm/lexc500.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2hiperc/icm icm/okic3200.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2hiperc/icm icm/okic3400.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2hiperc/icm icm/okic5600.tar.gz;
icm/km2430.tar.gz: FRC
cd icm; tar -c -z -f ../$@ km2430*.icm
icm/hpclj2600n.tar.gz: FRC
cd icm; tar -c -z -f ../$@ hpclj2600*.icm
+icm/hp1215.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ hp1215*.icm
icm/km2530.tar.gz: FRC
cd icm; tar -c -z -f ../$@ km2530*.icm
icm/samclp300.tar.gz: FRC
cd icm; tar -c -z -f ../$@ samclp300*.icm
+icm/samclp315.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ samclp315*.icm
+icm/lexc500.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ lexR*.icm
+icm/okic3200.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ OK32*.icm
+icm/okic3400.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ C3400*.icm
+icm/okic5600.tar.gz: FRC
+ cd icm; tar -c -z -f ../$@ OK56*.icm
webfw: firmware/sihp1000.tar.gz \
firmware/sihp1005.tar.gz \
firmware/sihp1018.tar.gz \
firmware/sihp1020.tar.gz \
+ firmware/sihpP1005.tar.gz \
+ firmware/sihpP1006.tar.gz \
+ firmware/sihpP1505.tar.gz \
$(NULL)
- ncftpput -m -f $(FTPSITE) foo2zjs firmware/*.tar.gz;
+ ncftpput -m -f $(FTPSITE) foo2zjs/firmware firmware/*.tar.gz;
firmware/sihp1000.tar.gz: FRC
cd firmware; tar -c -z -f ../$@ sihp1000.img
@@ -1144,50 +1483,22 @@ firmware/sihp1018.tar.gz: FRC
cd firmware; tar -c -z -f ../$@ sihp1018.img
firmware/sihp1020.tar.gz: FRC
cd firmware; tar -c -z -f ../$@ sihp1020.img
+firmware/sihpP1005.tar.gz: FRC
+ cd firmware; tar -c -z -f ../$@ sihpP1005.img
+firmware/sihpP1006.tar.gz: FRC
+ cd firmware; tar -c -z -f ../$@ sihpP1006.img
+firmware/sihpP1505.tar.gz: FRC
+ cd firmware; tar -c -z -f ../$@ sihpP1505.img
FRC:
#
-# Target for building Oak Technologies encoder/decoder (for HP1500)
-#
-# This source code will not be made available unless someone sponsors
-# me to finish the work on it.
-#
-LIBJBGOAK = jbig.o jbig_tab.o
-o: oakdecode foo2oak foo2oak-wrapper
- root install oakdecode foo2oak foo2oak-wrapper $(BIN)/
-oakdecode: oakdecode_$(MACH).o $(LIBJBGOAK)
- $(CC) $(CFLAGS) oakdecode_$(MACH).o $(LIBJBGOAK) -o $@
-foo2oak: foo2oak_$(MACH).o $(LIBJBGOAK)
- $(CC) $(CFLAGS) -o $@ foo2oak_$(MACH).o $(LIBJBGOAK)
-foo2oak-wrapper: foo2oak-wrapper.in Makefile
- [ ! -f $@ ] || chmod +w $@
- sed < $@.in > $@ \
- -e 's@^PREFIX=.*@PREFIX=$(PREFIX)@' || (rm -f $@ && exit 1)
- chmod 555 $@
-
-SYSNAME := $(shell uname -n)
-ifeq ($(SYSNAME),ipcroe.rkkda.com)
-foo2oak_$(MACH).o: oak.h jbig.h foo2oak.c
- cp -a foo2oak.c foo2oak_$(MACH).c
- $(CC) $(CFLAGS) -c foo2oak_$(MACH).c
-oakdecode_$(MACH).o: oak.h oakdecode.c
- cp -a oakdecode.c oakdecode_$(MACH).c
- $(CC) $(CFLAGS) -c oakdecode_$(MACH).c
-endif
-ifeq ($(SYSNAME),amd.rkkda.org)
-foo2oak_$(MACH).o: oak.h jbig.h foo2oak.c
- cp -a foo2oak.c foo2oak_$(MACH).c
- $(CC) $(CFLAGS) -c foo2oak_$(MACH).c
-oakdecode_$(MACH).o: oak.h oakdecode.c
- cp -a oakdecode.c oakdecode_$(MACH).c
- $(CC) $(CFLAGS) -c oakdecode_$(MACH).c
-endif
-
-#
# Misc
#
-misc: pksm2bitcmyk
+misc: pksm2bitcmyk phorum-logo.gif
pksm2bitcmyk: pksm2bitcmyk.c
- $(CC) $(CFLAGS) pksm2bitcmyk.c -lpbm -o $@
+ $(CC) $(CFLAGS) pksm2bitcmyk.c -lnetpbm -o $@
+
+phorum-logo.gif: archhp.fig
+ fig2dev -L gif -m.25 archhp.fig | giftrans -t "#ffffff" -o $@
diff --git a/PPD/Generic-OAKT_Printer.ppd b/PPD/Generic-OAKT_Printer.ppd
index 5aa434c..d4e497d 100644
--- a/PPD/Generic-OAKT_Printer.ppd
+++ b/PPD/Generic-OAKT_Printer.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2oak,R1,M0,TF;"
+*driverName foo2oak/foo2oak: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2oak.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 0 0 0 0
+
+*HWMargins: 18 36 18 36
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,26 @@
*OpenGroup: General/General
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
+*FoomaticRIPOption BitsPerPlane: enum CmdLine A
+*OrderDependency: 120 AnySetup *BitsPerPlane
+*DefaultBitsPerPlane: 1-BPP
+*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
+*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
+*CloseUI: *BitsPerPlane
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -121,17 +147,17 @@
*CloseUI: *PageRegion
*DefaultImageableArea: Letter
-*ImageableArea Letter/Letter: "0 0 612 792"
-*ImageableArea A4/A4: "0 0 595 842"
-*ImageableArea A5/A5: "0 0 420 595"
-*ImageableArea B5/B5: "0 0 498 708"
-*ImageableArea Env10/Env #10: "0 0 297 684"
-*ImageableArea EnvB5/Env B5: "0 0 498 708"
-*ImageableArea EnvC5/Env C5: "0 0 459 649"
-*ImageableArea EnvDL/Env DL: "0 0 311 623"
-*ImageableArea EnvMonarch/Env Monarch: "0 0 279 540"
-*ImageableArea Executive/Executive: "0 0 522 756"
-*ImageableArea Legal/Legal: "0 0 612 1008"
+*ImageableArea Letter/Letter: "18 36 594 756"
+*ImageableArea A4/A4: "18 36 577 806"
+*ImageableArea A5/A5: "18 36 402 559"
+*ImageableArea B5/B5: "18 36 480 672"
+*ImageableArea Env10/Env #10: "18 36 279 648"
+*ImageableArea EnvB5/Env B5: "18 36 480 672"
+*ImageableArea EnvC5/Env C5: "18 36 441 613"
+*ImageableArea EnvDL/Env DL: "18 36 293 587"
+*ImageableArea EnvMonarch/Env Monarch: "18 36 261 504"
+*ImageableArea Executive/Executive: "18 36 504 720"
+*ImageableArea Legal/Legal: "18 36 594 972"
*DefaultPaperDimension: Letter
*PaperDimension Letter/Letter: "612 792"
@@ -194,26 +220,6 @@
*FoomaticRIPOptionSetting MediaType=Tough: "-m14 "
*CloseUI: *MediaType
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
-*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
-*FoomaticRIPOption BitsPerPlane: enum CmdLine A
-*OrderDependency: 120 AnySetup *BitsPerPlane
-*DefaultBitsPerPlane: 1-BPP
-*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
-*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
-*CloseUI: *BitsPerPlane
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -330,9 +336,13 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: none
+*DefaultICM: default
+*ICM default/Default ICM color correction: "%% FoomaticRIPOptionSetting: ICM=default"
+*FoomaticRIPOptionSetting ICM=default: "-Gdefault "
+*ICM hpclj2600n-1/File hpclj2600n-1.icm (ICCFactory 1): "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
+*FoomaticRIPOptionSetting ICM=hpclj2600n-1: "-Ghpclj2600n-1.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/Generic-ZjStream_Printer.ppd b/PPD/Generic-ZjStream_Printer.ppd
index 2e5e4a6..44e49d6 100644
--- a/PPD/Generic-ZjStream_Printer.ppd
+++ b/PPD/Generic-ZjStream_Printer.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 0 0 0 0
+
+*HWMargins: 18 36 18 36
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,56 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *PrinterType/Printer Type: PickOne
+*FoomaticRIPOption PrinterType: enum CmdLine A
+*OrderDependency: 110 AnySetup *PrinterType
+*DefaultPrinterType: Color
+*PrinterType BW/Black-and-white printer: "%% FoomaticRIPOptionSetting: PrinterType=BW"
+*FoomaticRIPOptionSetting PrinterType=BW: "-P "
+*PrinterType Color/Color printer: "%% FoomaticRIPOptionSetting: PrinterType=Color"
+*FoomaticRIPOptionSetting PrinterType=Color: " "
+*CloseUI: *PrinterType
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -121,17 +177,17 @@
*CloseUI: *PageRegion
*DefaultImageableArea: Letter
-*ImageableArea Letter/Letter: "0 0 612 792"
-*ImageableArea A4/A4: "0 0 595 842"
-*ImageableArea A5/A5: "0 0 420 595"
-*ImageableArea B5/B5: "0 0 498 708"
-*ImageableArea Env10/Env #10: "0 0 297 684"
-*ImageableArea EnvB5/Env B5: "0 0 498 708"
-*ImageableArea EnvC5/Env C5: "0 0 459 649"
-*ImageableArea EnvDL/Env DL: "0 0 311 623"
-*ImageableArea EnvMonarch/Env Monarch: "0 0 279 540"
-*ImageableArea Executive/Executive: "0 0 522 756"
-*ImageableArea Legal/Legal: "0 0 612 1008"
+*ImageableArea Letter/Letter: "18 36 594 756"
+*ImageableArea A4/A4: "18 36 577 806"
+*ImageableArea A5/A5: "18 36 402 559"
+*ImageableArea B5/B5: "18 36 480 672"
+*ImageableArea Env10/Env #10: "18 36 279 648"
+*ImageableArea EnvB5/Env B5: "18 36 480 672"
+*ImageableArea EnvC5/Env C5: "18 36 441 613"
+*ImageableArea EnvDL/Env DL: "18 36 293 587"
+*ImageableArea EnvMonarch/Env Monarch: "18 36 261 504"
+*ImageableArea Executive/Executive: "18 36 504 720"
+*ImageableArea Legal/Legal: "18 36 594 972"
*DefaultPaperDimension: Letter
*PaperDimension Letter/Letter: "612 792"
@@ -200,46 +256,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -349,16 +365,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*OpenUI *PrinterType/Printer Type: PickOne
-*FoomaticRIPOption PrinterType: enum CmdLine A
-*OrderDependency: 110 AnySetup *PrinterType
-*DefaultPrinterType: Color
-*PrinterType BW/Black-and-white printer: "%% FoomaticRIPOptionSetting: PrinterType=BW"
-*FoomaticRIPOptionSetting PrinterType=BW: "-P "
-*PrinterType Color/Color printer: "%% FoomaticRIPOptionSetting: PrinterType=Color"
-*FoomaticRIPOptionSetting PrinterType=Color: " "
-*CloseUI: *PrinterType
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -368,7 +374,7 @@
*OrderDependency: 300 AnySetup *ICM
*DefaultICM: none
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/HP-Color_LaserJet_1500.ppd b/PPD/HP-Color_LaserJet_1500.ppd
index cffafbe..4386b34 100644
--- a/PPD/HP-Color_LaserJet_1500.ppd
+++ b/PPD/HP-Color_LaserJet_1500.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp color LaserJet 1500;CMD:OAKRAS;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp color LaserJet 1500;CMD:OAKRAS;DRV:Dfoo2oak,R1,M0,TF;"
+*driverName foo2oak/foo2oak: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2oak.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 12.00 12.00 12 12
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,26 @@
*OpenGroup: General/General
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
+*FoomaticRIPOption BitsPerPlane: enum CmdLine A
+*OrderDependency: 120 AnySetup *BitsPerPlane
+*DefaultBitsPerPlane: 1-BPP
+*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
+*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
+*CloseUI: *BitsPerPlane
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -194,26 +220,6 @@
*FoomaticRIPOptionSetting MediaType=Tough: "-m14 "
*CloseUI: *MediaType
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
-*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
-*FoomaticRIPOption BitsPerPlane: enum CmdLine A
-*OrderDependency: 120 AnySetup *BitsPerPlane
-*DefaultBitsPerPlane: 1-BPP
-*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
-*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
-*CloseUI: *BitsPerPlane
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -330,9 +336,13 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: none
+*DefaultICM: default
+*ICM default/Default ICM color correction: "%% FoomaticRIPOptionSetting: ICM=default"
+*FoomaticRIPOptionSetting ICM=default: "-Gdefault "
+*ICM hpclj2600n-1/File hpclj2600n-1.icm (ICCFactory 1): "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
+*FoomaticRIPOptionSetting ICM=hpclj2600n-1: "-Ghpclj2600n-1.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/HP-Color_LaserJet_1600.ppd b/PPD/HP-Color_LaserJet_1600.ppd
index 743c6df..d7beb8c 100644
--- a/PPD/HP-Color_LaserJet_1600.ppd
+++ b/PPD/HP-Color_LaserJet_1600.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet 1600;CMD:ACL;DES:HP Color LaserJet 1600;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet 1600;CMD:ACL;DES:HP Color LaserJet 1600;DRV:Dfoo2hp,R1,M0,TF;"
+*driverName foo2hp/foo2hp: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hp.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 12.00 12.00 12 12
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,39 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
+*FoomaticRIPOption BitsPerPlane: enum CmdLine A
+*OrderDependency: 120 AnySetup *BitsPerPlane
+*DefaultBitsPerPlane: 1-BPP
+*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
+*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
+*CloseUI: *BitsPerPlane
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -216,36 +255,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft Mode: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal Mode: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
-*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
-*FoomaticRIPOption BitsPerPlane: enum CmdLine A
-*OrderDependency: 120 AnySetup *BitsPerPlane
-*DefaultBitsPerPlane: 1-BPP
-*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
-*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
-*CloseUI: *BitsPerPlane
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -365,14 +374,18 @@
*DefaultICM: default
*ICM default/Default ICM color correction: "%% FoomaticRIPOptionSetting: ICM=default"
*FoomaticRIPOptionSetting ICM=default: "-Gdefault "
-*ICM hpclj2600n-0/File hpclj2600n-0.icm: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-0"
+*ICM hp1215-argyll-0/HP 1215 - Argyll 0 (default): "%% FoomaticRIPOptionSetting: ICM=hp1215-argyll-0"
+*FoomaticRIPOptionSetting ICM=hp1215-argyll-0: "-Ghp1215-argyll-0.icm &&
+"
+*End
+*ICM hpclj2600n-0/HP 1600/2600 - hpclj2600n-0.icm: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-0"
*FoomaticRIPOptionSetting ICM=hpclj2600n-0: "-Ghpclj2600n-0.icm "
-*ICM hpclj2600n-1/File ICCFactory 1: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
+*ICM hpclj2600n-1/HP 1600/2600 - ICCFactory 1 (default): "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
*FoomaticRIPOptionSetting ICM=hpclj2600n-1: "-Ghpclj2600n-1.icm "
*ICM km2430_2/File km2430_2.icm: "%% FoomaticRIPOptionSetting: ICM=km2430_2"
*FoomaticRIPOptionSetting ICM=km2430_2: "-Gkm2430_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: "-Gnone "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/HP-Color_LaserJet_2600n.ppd b/PPD/HP-Color_LaserJet_2600n.ppd
index 1776065..00db89d 100644
--- a/PPD/HP-Color_LaserJet_2600n.ppd
+++ b/PPD/HP-Color_LaserJet_2600n.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet 2600n;CMD:ACL;DES:HP Color LaserJet 2600n;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet 2600n;CMD:ACL;DES:HP Color LaserJet 2600n;DRV:Dfoo2hp,R1,M0,TF;"
+*driverName foo2hp/foo2hp: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hp.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 12.00 12.00 12 12
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,39 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
+*FoomaticRIPOption BitsPerPlane: enum CmdLine A
+*OrderDependency: 120 AnySetup *BitsPerPlane
+*DefaultBitsPerPlane: 1-BPP
+*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
+*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
+*CloseUI: *BitsPerPlane
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -216,36 +255,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft Mode: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal Mode: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
-*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
-*FoomaticRIPOption BitsPerPlane: enum CmdLine A
-*OrderDependency: 120 AnySetup *BitsPerPlane
-*DefaultBitsPerPlane: 1-BPP
-*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
-*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
-*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
-*CloseUI: *BitsPerPlane
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -365,14 +374,18 @@
*DefaultICM: default
*ICM default/Default ICM color correction: "%% FoomaticRIPOptionSetting: ICM=default"
*FoomaticRIPOptionSetting ICM=default: "-Gdefault "
-*ICM hpclj2600n-0/File hpclj2600n-0.icm: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-0"
+*ICM hp1215-argyll-0/HP 1215 - Argyll 0 (default): "%% FoomaticRIPOptionSetting: ICM=hp1215-argyll-0"
+*FoomaticRIPOptionSetting ICM=hp1215-argyll-0: "-Ghp1215-argyll-0.icm &&
+"
+*End
+*ICM hpclj2600n-0/HP 1600/2600 - hpclj2600n-0.icm: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-0"
*FoomaticRIPOptionSetting ICM=hpclj2600n-0: "-Ghpclj2600n-0.icm "
-*ICM hpclj2600n-1/File ICCFactory 1: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
+*ICM hpclj2600n-1/HP 1600/2600 - ICCFactory 1 (default): "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
*FoomaticRIPOptionSetting ICM=hpclj2600n-1: "-Ghpclj2600n-1.icm "
*ICM km2430_2/File km2430_2.icm: "%% FoomaticRIPOptionSetting: ICM=km2430_2"
*FoomaticRIPOptionSetting ICM=km2430_2: "-Gkm2430_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: "-Gnone "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/HP-Color_LaserJet_CP1215.ppd b/PPD/HP-Color_LaserJet_CP1215.ppd
new file mode 100644
index 0000000..16b93ce
--- /dev/null
+++ b/PPD/HP-Color_LaserJet_CP1215.ppd
@@ -0,0 +1,488 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-Color_LaserJet_CP1215-foo2hp.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HP.PPD"
+*Manufacturer: "HP"
+*Product: "(HP Color LaserJet CP1215)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP Color LaserJet CP1215"
+*ShortNickName: "HP Color LaserJet CP1215 foo2hp"
+*NickName: "HP Color LaserJet CP1215 Foomatic/foo2hp (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP Color LaserJet CP1215;CMD:ZJS,HBS,PJL,ACL,HTTP;DES:HP Color LaserJet CP1215;DRV:Dfoo2hp,R1,M0,TF;"
+
+*driverName foo2hp/foo2hp: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hp.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-Color_LaserJet_CP1215 foo2hp
+*FoomaticRIPCommandLine: "foo2hp2600-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z1: "-z1 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *BitsPerPlane/Bits Per Plane: PickOne
+*FoomaticRIPOption BitsPerPlane: enum CmdLine A
+*OrderDependency: 120 AnySetup *BitsPerPlane
+*DefaultBitsPerPlane: 1-BPP
+*BitsPerPlane 1-BPP/1 Bit Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=1-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=1-BPP: "-b1 "
+*BitsPerPlane 2-BPP/2 Bits Per Plane: "%% FoomaticRIPOptionSetting: BitsPerPlane=2-BPP"
+*FoomaticRIPOptionSetting BitsPerPlane=2-BPP: "-b2 "
+*CloseUI: *BitsPerPlane
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "12.00 12.00 600.00 780.00"
+*ImageableArea A4/A4: "12.00 12.00 583.00 830.00"
+*ImageableArea A5/A5: "12.00 12.00 408.00 583.00"
+*ImageableArea B5/B5: "12.00 12.00 486.00 696.00"
+*ImageableArea Env10/Env #10: "12.00 12.00 285.00 672.00"
+*ImageableArea EnvB5/Env B5: "12.00 12.00 486.00 696.00"
+*ImageableArea EnvC5/Env C5: "12.00 12.00 447.00 637.00"
+*ImageableArea EnvDL/Env DL: "12.00 12.00 299.00 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "12.00 12.00 267.00 528.00"
+*ImageableArea Executive/Executive: "12.00 12.00 510.00 744.00"
+*ImageableArea Legal/Legal: "12.00 12.00 600.00 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s1 "
+*InputSlot Tray3/Tray 3: "%% FoomaticRIPOptionSetting: InputSlot=Tray3"
+*FoomaticRIPOptionSetting InputSlot=Tray3: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType photo/HP Color Laser Photo Paper: "%% FoomaticRIPOptionSetting: MediaType=photo"
+*FoomaticRIPOptionSetting MediaType=photo: "-m278 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Cover/HP Premium Cover: "%% FoomaticRIPOptionSetting: MediaType=Cover"
+*FoomaticRIPOptionSetting MediaType=Cover: "-m277 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Glossy/Glossy: "%% FoomaticRIPOptionSetting: MediaType=Glossy"
+*FoomaticRIPOptionSetting MediaType=Glossy: "-m269 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType HeavyGlossy/Heavy Glossy: "%% FoomaticRIPOptionSetting: MediaType=HeavyGlossy"
+*FoomaticRIPOptionSetting MediaType=HeavyGlossy: "-m270 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType LightGlossy/Light Glossy: "%% FoomaticRIPOptionSetting: MediaType=LightGlossy"
+*FoomaticRIPOptionSetting MediaType=LightGlossy: "-m268 "
+*MediaType Preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Tough/Tough: "%% FoomaticRIPOptionSetting: MediaType=Tough"
+*FoomaticRIPOptionSetting MediaType=Tough: "-m276 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: default
+*ICM default/Default ICM color correction: "%% FoomaticRIPOptionSetting: ICM=default"
+*FoomaticRIPOptionSetting ICM=default: "-Gdefault "
+*ICM hp1215-argyll-0/HP 1215 - Argyll 0 (default): "%% FoomaticRIPOptionSetting: ICM=hp1215-argyll-0"
+*FoomaticRIPOptionSetting ICM=hp1215-argyll-0: "-Ghp1215-argyll-0.icm &&
+"
+*End
+*ICM hpclj2600n-0/HP 1600/2600 - hpclj2600n-0.icm: "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-0"
+*FoomaticRIPOptionSetting ICM=hpclj2600n-0: "-Ghpclj2600n-0.icm "
+*ICM hpclj2600n-1/HP 1600/2600 - ICCFactory 1 (default): "%% FoomaticRIPOptionSetting: ICM=hpclj2600n-1"
+*FoomaticRIPOptionSetting ICM=hpclj2600n-1: "-Ghpclj2600n-1.icm "
+*ICM km2430_2/File km2430_2.icm: "%% FoomaticRIPOptionSetting: ICM=km2430_2"
+*FoomaticRIPOptionSetting ICM=km2430_2: "-Gkm2430_2.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_1000.ppd b/PPD/HP-LaserJet_1000.ppd
index 1e3a79c..44a073b 100644
--- a/PPD/HP-LaserJet_1000.ppd
+++ b/PPD/HP-LaserJet_1000.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp LaserJet 1000;CMD:ZJS;DES:hp LaserJet 1000;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp LaserJet 1000;CMD:ZJS;DES:hp LaserJet 1000;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,25 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BW: "-P "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*FoomaticRIPOption Resolution: enum CmdLine A 130
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -184,22 +209,6 @@
*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
*CloseUI: *MediaType
-*FoomaticRIPOption Resolution: enum CmdLine A 130
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*FoomaticRIPOption ColorMode: enum CmdLine A 120
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -309,9 +318,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=BW: "-P "
-
*CloseGroup: General
*OpenGroup: Miscellaneous/Miscellaneous
diff --git a/PPD/HP-LaserJet_1005.ppd b/PPD/HP-LaserJet_1005.ppd
index 130ebd2..9c49528 100644
--- a/PPD/HP-LaserJet_1005.ppd
+++ b/PPD/HP-LaserJet_1005.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp LaserJet 1005 series;CMD:ZJS;DES:hp LaserJet 1005 series;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:hp LaserJet 1005 series;CMD:ZJS;DES:hp LaserJet 1005 series;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,25 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BW: "-P "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*FoomaticRIPOption Resolution: enum CmdLine A 130
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -184,22 +209,6 @@
*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
*CloseUI: *MediaType
-*FoomaticRIPOption Resolution: enum CmdLine A 130
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*FoomaticRIPOption ColorMode: enum CmdLine A 120
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -309,9 +318,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=BW: "-P "
-
*CloseGroup: General
*OpenGroup: Miscellaneous/Miscellaneous
diff --git a/PPD/HP-LaserJet_1018.ppd b/PPD/HP-LaserJet_1018.ppd
index 7075324..05061b5 100644
--- a/PPD/HP-LaserJet_1018.ppd
+++ b/PPD/HP-LaserJet_1018.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1018;CMD:ACL;DES:HP LaserJet 1018;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1018;CMD:ACL;DES:HP LaserJet 1018;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,32 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -184,29 +216,6 @@
*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
*CloseUI: *MediaType
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*FoomaticRIPOption ColorMode: enum CmdLine A 120
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -316,9 +325,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
-
*CloseGroup: General
*OpenGroup: Miscellaneous/Miscellaneous
diff --git a/PPD/HP-LaserJet_1020.ppd b/PPD/HP-LaserJet_1020.ppd
index fc74f6f..9c9b4ac 100644
--- a/PPD/HP-LaserJet_1020.ppd
+++ b/PPD/HP-LaserJet_1020.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;DES:HP LaserJet 1020;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;DES:HP LaserJet 1020;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,32 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -184,29 +216,6 @@
*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
*CloseUI: *MediaType
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*FoomaticRIPOption ColorMode: enum CmdLine A 120
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -316,9 +325,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
-
*CloseGroup: General
*OpenGroup: Miscellaneous/Miscellaneous
diff --git a/PPD/HP-LaserJet_1022.ppd b/PPD/HP-LaserJet_1022.ppd
index 4faee0a..e282211 100644
--- a/PPD/HP-LaserJet_1022.ppd
+++ b/PPD/HP-LaserJet_1022.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1022;CMD:ACL;DES:HP LaserJet 1022;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet 1022;CMD:ACL;DES:HP LaserJet 1022;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,32 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -200,29 +232,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*FoomaticRIPOption ColorMode: enum CmdLine A 120
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -332,9 +341,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
-
*CloseGroup: General
*OpenGroup: Miscellaneous/Miscellaneous
diff --git a/PPD/HP-LaserJet_M1005_MFP.ppd b/PPD/HP-LaserJet_M1005_MFP.ppd
index 5557a28..5f25644 100644
--- a/PPD/HP-LaserJet_M1005_MFP.ppd
+++ b/PPD/HP-LaserJet_M1005_MFP.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet M1005;CMD:ACL;DES:HP LaserJet M1005;"
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet M1005;CMD:ACL;DES:HP LaserJet M1005;DRV:Dfoo2xqx,R1,M0,TF;"
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,26 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -216,26 +242,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
diff --git a/PPD/HP-LaserJet_M1120_MFP.ppd b/PPD/HP-LaserJet_M1120_MFP.ppd
new file mode 100644
index 0000000..fb479e0
--- /dev/null
+++ b/PPD/HP-LaserJet_M1120_MFP.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_M1120_MFP-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet M1120)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet M1120 MFP"
+*ShortNickName: "HP LaserJet M1120 MFP foo2xqx"
+*NickName: "HP LaserJet M1120 MFP Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet M1120;CMD:ACL;DES:HP LaserJet M1120;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_M1120_MFP foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_M1319_MFP.ppd b/PPD/HP-LaserJet_M1319_MFP.ppd
new file mode 100644
index 0000000..fcddbdd
--- /dev/null
+++ b/PPD/HP-LaserJet_M1319_MFP.ppd
@@ -0,0 +1,415 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_M1319_MFP-foo2zjs.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2ZJS.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet M1319)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet M1319 MFP"
+*ShortNickName: "HP LaserJet M1319 MFP foo2zjs"
+*NickName: "HP LaserJet M1319 MFP Foomatic/foo2zjs (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet M1319;CMD:ACL;DES:HP LaserJet M1319;DRV:Dfoo2zjs,R1,M0,TF;"
+
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_M1319_MFP foo2zjs
+*FoomaticRIPCommandLine: "foo2zjs-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Upper/Upper or Only One InputSlot: "%% FoomaticRIPOptionSetting: InputSlot=Upper"
+*FoomaticRIPOptionSetting InputSlot=Upper: "-s1 "
+*InputSlot Middle/Middle Tray: "%% FoomaticRIPOptionSetting: InputSlot=Middle"
+*FoomaticRIPOptionSetting InputSlot=Middle: "-s3 "
+*InputSlot Lower/Lower Tray: "%% FoomaticRIPOptionSetting: InputSlot=Lower"
+*FoomaticRIPOptionSetting InputSlot=Lower: "-s2 "
+*InputSlot Auto/Auto Source: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Envelope/Envelope: "%% FoomaticRIPOptionSetting: InputSlot=Envelope"
+*FoomaticRIPOptionSetting InputSlot=Envelope: "-s5 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Standard
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m257 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m263 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m259 "
+*MediaType Postcard/Postcard: "%% FoomaticRIPOptionSetting: MediaType=Postcard"
+*FoomaticRIPOptionSetting MediaType=Postcard: "-m262 "
+*MediaType Standard/Standard Paper: "%% FoomaticRIPOptionSetting: MediaType=Standard"
+*FoomaticRIPOptionSetting MediaType=Standard: "-m1 "
+*MediaType ThickStock/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=ThickStock"
+*FoomaticRIPOptionSetting MediaType=ThickStock: "-m261 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P1005.ppd b/PPD/HP-LaserJet_P1005.ppd
new file mode 100644
index 0000000..7943a73
--- /dev/null
+++ b/PPD/HP-LaserJet_P1005.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P1005-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P1005)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P1005"
+*ShortNickName: "HP LaserJet P1005 foo2xqx"
+*NickName: "HP LaserJet P1005 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P1005;CMD:ACL;DES:HP LaserJet P1005;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P1005 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P1006.ppd b/PPD/HP-LaserJet_P1006.ppd
new file mode 100644
index 0000000..12e1722
--- /dev/null
+++ b/PPD/HP-LaserJet_P1006.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P1006-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P1006)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P1006"
+*ShortNickName: "HP LaserJet P1006 foo2xqx"
+*NickName: "HP LaserJet P1006 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;DES:HP LaserJet P1006;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P1006 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P1007.ppd b/PPD/HP-LaserJet_P1007.ppd
new file mode 100644
index 0000000..861acdd
--- /dev/null
+++ b/PPD/HP-LaserJet_P1007.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P1007-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P1007)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P1007"
+*ShortNickName: "HP LaserJet P1007 foo2xqx"
+*NickName: "HP LaserJet P1007 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P1007;CMD:ACL;DES:HP LaserJet P1007;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P1007 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P1008.ppd b/PPD/HP-LaserJet_P1008.ppd
new file mode 100644
index 0000000..cd2e791
--- /dev/null
+++ b/PPD/HP-LaserJet_P1008.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P1008-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P1008)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P1008"
+*ShortNickName: "HP LaserJet P1008 foo2xqx"
+*NickName: "HP LaserJet P1008 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P1008;CMD:ACL;DES:HP LaserJet P1008;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P1008 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P1505.ppd b/PPD/HP-LaserJet_P1505.ppd
new file mode 100644
index 0000000..641f83e
--- /dev/null
+++ b/PPD/HP-LaserJet_P1505.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P1505-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P1505)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P1505"
+*ShortNickName: "HP LaserJet P1505 foo2xqx"
+*NickName: "HP LaserJet P1505 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P1505;CMD:ACL;DES:HP LaserJet P1505;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P1505 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P2014.ppd b/PPD/HP-LaserJet_P2014.ppd
new file mode 100644
index 0000000..10dc2f4
--- /dev/null
+++ b/PPD/HP-LaserJet_P2014.ppd
@@ -0,0 +1,441 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P2014-foo2xqx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2XQX.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P2014)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P2014"
+*ShortNickName: "HP LaserJet P2014 foo2xqx"
+*NickName: "HP LaserJet P2014 Foomatic/foo2xqx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P2014;CMD:ACL;DES:HP LaserJet P2014;DRV:Dfoo2xqx,R1,M0,TF;"
+
+*driverName foo2xqx/foo2xqx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2xqx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P2014 foo2xqx
+*FoomaticRIPCommandLine: "foo2xqx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Plain
+*MediaType Plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType Multipurpose/HP Multipurpose Paper: "%% FoomaticRIPOptionSetting: MediaType=Multipurpose"
+*FoomaticRIPOptionSetting MediaType=Multipurpose: "-m301 "
+*MediaType All-in-one/HP All-in-one Printing Paper: "%% FoomaticRIPOptionSetting: MediaType=All-in-one"
+*FoomaticRIPOptionSetting MediaType=All-in-one: "-m303 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m260 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m261 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m512 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m267 "
+*MediaType Heavy/Heavy: "%% FoomaticRIPOptionSetting: MediaType=Heavy"
+*FoomaticRIPOptionSetting MediaType=Heavy: "-m262 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m265 "
+*MediaType LaserJet/HP LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=LaserJet"
+*FoomaticRIPOptionSetting MediaType=LaserJet: "-m302 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m513 "
+*MediaType Light/Light: "%% FoomaticRIPOptionSetting: MediaType=Light"
+*FoomaticRIPOptionSetting MediaType=Light: "-m258 "
+*MediaType Office/HP Office Paper: "%% FoomaticRIPOptionSetting: MediaType=Office"
+*FoomaticRIPOptionSetting MediaType=Office: "-m300 "
+*MediaType PremiumLaserJet/HP Premium Choice LaserJet Paper: "%% FoomaticRIPOptionSetting: MediaType=PremiumLaserJet"
+*FoomaticRIPOptionSetting MediaType=PremiumLaserJet: "-m302 "
+*MediaType Preprinted/Preprinted Paper: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m514 "
+*MediaType Prepunched/Prepunched Paper: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m515 "
+*MediaType Recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m516 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m263 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*MediaType Unspecified/Unspecified Paper: "%% FoomaticRIPOptionSetting: MediaType=Unspecified"
+*FoomaticRIPOptionSetting MediaType=Unspecified: "-m0 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/HP-LaserJet_P2035.ppd b/PPD/HP-LaserJet_P2035.ppd
new file mode 100644
index 0000000..737ccc3
--- /dev/null
+++ b/PPD/HP-LaserJet_P2035.ppd
@@ -0,0 +1,415 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'HP-LaserJet_P2035-foo2zjs.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2ZJS.PPD"
+*Manufacturer: "HP"
+*Product: "(HP LaserJet P2035)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "HP LaserJet P2035"
+*ShortNickName: "HP LaserJet P2035 foo2zjs"
+*NickName: "HP LaserJet P2035 Foomatic/foo2zjs (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: False
+*DefaultColorSpace: Gray
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "MFG:Hewlett-Packard;MDL:HP LaserJet P2035;CMD:ACL;DES:HP LaserJet P2035;DRV:Dfoo2zjs,R1,M0,TF;"
+
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: HP-LaserJet_P2035 foo2zjs
+*FoomaticRIPCommandLine: "foo2zjs-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=BWz1: "-P -z1 -L0 "
+
+*FoomaticRIPOption ColorMode: enum CmdLine A 120
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p13 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*FoomaticRIPOptionSetting PageSize=EnvB5: "-p34 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvB5/Env B5: "%% FoomaticRIPOptionSetting: PageSize=EnvB5"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "11.34 11.34 600.66 780.66"
+*ImageableArea A4/A4: "11.34 11.34 583.66 830.66"
+*ImageableArea A5/A5: "11.34 11.34 408.66 583.66"
+*ImageableArea B5/B5: "11.34 11.34 486.66 696.66"
+*ImageableArea Env10/Env #10: "11.34 11.34 285.66 672.66"
+*ImageableArea EnvB5/Env B5: "11.34 11.34 486.66 696.66"
+*ImageableArea EnvC5/Env C5: "11.34 11.34 447.66 637.66"
+*ImageableArea EnvDL/Env DL: "11.34 11.34 299.66 611.66"
+*ImageableArea EnvMonarch/Env Monarch: "11.34 11.34 267.66 528.66"
+*ImageableArea Executive/Executive: "11.34 11.34 510.66 744.66"
+*ImageableArea Legal/Legal: "11.34 11.34 600.66 996.66"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvB5/Env B5: "498 708"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Upper/Upper or Only One InputSlot: "%% FoomaticRIPOptionSetting: InputSlot=Upper"
+*FoomaticRIPOptionSetting InputSlot=Upper: "-s1 "
+*InputSlot Middle/Middle Tray: "%% FoomaticRIPOptionSetting: InputSlot=Middle"
+*FoomaticRIPOptionSetting InputSlot=Middle: "-s3 "
+*InputSlot Lower/Lower Tray: "%% FoomaticRIPOptionSetting: InputSlot=Lower"
+*FoomaticRIPOptionSetting InputSlot=Lower: "-s2 "
+*InputSlot Auto/Auto Source: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Envelope/Envelope: "%% FoomaticRIPOptionSetting: InputSlot=Envelope"
+*FoomaticRIPOptionSetting InputSlot=Envelope: "-s5 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Standard
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m257 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m263 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m259 "
+*MediaType Postcard/Postcard: "%% FoomaticRIPOptionSetting: MediaType=Postcard"
+*FoomaticRIPOptionSetting MediaType=Postcard: "-m262 "
+*MediaType Standard/Standard Paper: "%% FoomaticRIPOptionSetting: MediaType=Standard"
+*FoomaticRIPOptionSetting MediaType=Standard: "-m1 "
+*MediaType ThickStock/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=ThickStock"
+*FoomaticRIPOptionSetting MediaType=ThickStock: "-m261 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/KonicaMinolta-magicolor_2480_MF.ppd b/PPD/KONICA_MINOLTA-magicolor_2480_MF.ppd
index cabe8a4..8bf5008 100644
--- a/PPD/KonicaMinolta-magicolor_2480_MF.ppd
+++ b/PPD/KONICA_MINOLTA-magicolor_2480_MF.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -20,7 +20,7 @@
*% DO NOT cut and paste this file into an editor with your mouse. This can
*% introduce additional line breaks which lead to unexpected results.
*%
-*% You may save this file as 'KonicaMinolta-magicolor_2480_MF-foo2lava.ppd'
+*% You may save this file as 'KONICA_MINOLTA-magicolor_2480_MF-foo2lava.ppd'
*%
*%
*FormatVersion: "4.3"
@@ -28,16 +28,16 @@
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "FOO2LAVA.PPD"
-*Manufacturer: "KonicaMinolta"
+*Manufacturer: "KONICA MINOLTA"
*Product: "(magicolor 2480 MF)"
*cupsVersion: 1.0
*cupsManualCopies: True
*cupsModelNumber: 2
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
*%pprRIP: foomatic-rip other
-*ModelName: "KonicaMinolta magicolor 2480 MF"
-*ShortNickName: "Kon.Minolta m. 2480 MF foo2lava"
-*NickName: "KonicaMinolta magicolor 2480 MF Foomatic/foo2lava (recommended)"
+*ModelName: "KONICA MINOLTA magicolor 2480 MF"
+*ShortNickName: "KO. MINOLTA m. 2480 MF foo2lava"
+*NickName: "KONICA MINOLTA magicolor 2480 MF Foomatic/foo2lava (recommended)"
*PSVersion: "(3010.000) 550"
*PSVersion: "(3010.000) 651"
*PSVersion: "(3010.000) 652"
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MANUFACTURER:KONICA MINOLTA;MODEL:magicolor 2480 MF;COMMAND SET:ZJS,PJL;"
+*1284DeviceID: "MANUFACTURER:KONICA MINOLTA;MODEL:magicolor 2480 MF;COMMAND SET:ZJS,PJL;DRV:Dfoo2lava,R1,M0,TF;"
+*driverName foo2lava/foo2lava: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2lava.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -71,11 +77,54 @@
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0
-*FoomaticIDs: KonicaMinolta-magicolor_2480_MF foo2lava
+*FoomaticIDs: KONICA_MINOLTA-magicolor_2480_MF foo2lava
*FoomaticRIPCommandLine: "foo2lava-wrapper %A"
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=opl: "-z1 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -209,46 +258,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -358,9 +367,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=opl: "-z1 "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -368,15 +374,27 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: km2530_1
-*ICM km2530_0/km2530_0 - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
+*DefaultICM: km2530-jc
+*ICM km2530-jc/km2530-jconner-d50.icm (default): "%% FoomaticRIPOptionSetting: ICM=km2530-jc"
+*FoomaticRIPOptionSetting ICM=km2530-jc: "-Gkm2530-jconner-d50.icm "
+*ICM km2530_0/km2530_0.icm - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
*FoomaticRIPOptionSetting ICM=km2530_0: "-Gkm2530_0.icm "
-*ICM km2530_1/km2530_1 - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
+*ICM km2530_1/km2530_1.icm - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
*FoomaticRIPOptionSetting ICM=km2530_1: "-Gkm2530_1.icm "
-*ICM km2530_2/km2530_2 - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
+*ICM km2530_2/km2530_2.icm - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
*FoomaticRIPOptionSetting ICM=km2530_2: "-Gkm2530_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/KonicaMinolta-magicolor_2490_MF.ppd b/PPD/KONICA_MINOLTA-magicolor_2490_MF.ppd
index 350af0d..da9a25c 100644
--- a/PPD/KonicaMinolta-magicolor_2490_MF.ppd
+++ b/PPD/KONICA_MINOLTA-magicolor_2490_MF.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -20,7 +20,7 @@
*% DO NOT cut and paste this file into an editor with your mouse. This can
*% introduce additional line breaks which lead to unexpected results.
*%
-*% You may save this file as 'KonicaMinolta-magicolor_2490_MF-foo2lava.ppd'
+*% You may save this file as 'KONICA_MINOLTA-magicolor_2490_MF-foo2lava.ppd'
*%
*%
*FormatVersion: "4.3"
@@ -28,16 +28,16 @@
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "FOO2LAVA.PPD"
-*Manufacturer: "KonicaMinolta"
+*Manufacturer: "KONICA MINOLTA"
*Product: "(magicolor 2490 MF)"
*cupsVersion: 1.0
*cupsManualCopies: True
*cupsModelNumber: 2
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
*%pprRIP: foomatic-rip other
-*ModelName: "KonicaMinolta magicolor 2490 MF"
-*ShortNickName: "Kon.Minolta m. 2490 MF foo2lava"
-*NickName: "KonicaMinolta magicolor 2490 MF Foomatic/foo2lava (recommended)"
+*ModelName: "KONICA MINOLTA magicolor 2490 MF"
+*ShortNickName: "KO. MINOLTA m. 2490 MF foo2lava"
+*NickName: "KONICA MINOLTA magicolor 2490 MF Foomatic/foo2lava (recommended)"
*PSVersion: "(3010.000) 550"
*PSVersion: "(3010.000) 651"
*PSVersion: "(3010.000) 652"
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MANUFACTURER:KONICA MINOLTA;MODEL:magicolor 2490 MF;COMMAND SET:ZJS,PJL;"
+*1284DeviceID: "MANUFACTURER:KONICA MINOLTA;MODEL:magicolor 2490 MF;COMMAND SET:ZJS,PJL;DRV:Dfoo2lava,R1,M0,TF;"
+*driverName foo2lava/foo2lava: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2lava.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -71,11 +77,54 @@
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0
-*FoomaticIDs: KonicaMinolta-magicolor_2490_MF foo2lava
+*FoomaticIDs: KONICA_MINOLTA-magicolor_2490_MF foo2lava
*FoomaticRIPCommandLine: "foo2lava-wrapper %A"
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -209,46 +258,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -358,9 +367,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -368,15 +374,27 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: km2530_1
-*ICM km2530_0/km2530_0 - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
+*DefaultICM: km2530-jc
+*ICM km2530-jc/km2530-jconner-d50.icm (default): "%% FoomaticRIPOptionSetting: ICM=km2530-jc"
+*FoomaticRIPOptionSetting ICM=km2530-jc: "-Gkm2530-jconner-d50.icm "
+*ICM km2530_0/km2530_0.icm - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
*FoomaticRIPOptionSetting ICM=km2530_0: "-Gkm2530_0.icm "
-*ICM km2530_1/km2530_1 - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
+*ICM km2530_1/km2530_1.icm - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
*FoomaticRIPOptionSetting ICM=km2530_1: "-Gkm2530_1.icm "
-*ICM km2530_2/km2530_2 - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
+*ICM km2530_2/km2530_2.icm - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
*FoomaticRIPOptionSetting ICM=km2530_2: "-Gkm2530_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/KonicaMinolta-magicolor_2530_DL.ppd b/PPD/KONICA_MINOLTA-magicolor_2530_DL.ppd
index 1868492..8c3b12e 100644
--- a/PPD/KonicaMinolta-magicolor_2530_DL.ppd
+++ b/PPD/KONICA_MINOLTA-magicolor_2530_DL.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -20,7 +20,7 @@
*% DO NOT cut and paste this file into an editor with your mouse. This can
*% introduce additional line breaks which lead to unexpected results.
*%
-*% You may save this file as 'KonicaMinolta-magicolor_2530_DL-foo2lava.ppd'
+*% You may save this file as 'KONICA_MINOLTA-magicolor_2530_DL-foo2lava.ppd'
*%
*%
*FormatVersion: "4.3"
@@ -28,16 +28,16 @@
*LanguageVersion: English
*LanguageEncoding: ISOLatin1
*PCFileName: "FOO2LAVA.PPD"
-*Manufacturer: "KonicaMinolta"
+*Manufacturer: "KONICA MINOLTA"
*Product: "(mc2530DL)"
*cupsVersion: 1.0
*cupsManualCopies: True
*cupsModelNumber: 2
*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
*%pprRIP: foomatic-rip other
-*ModelName: "KonicaMinolta magicolor 2530 DL"
-*ShortNickName: "Kon.Minolta m. 2530 DL foo2lava"
-*NickName: "KonicaMinolta magicolor 2530 DL Foomatic/foo2lava (recommended)"
+*ModelName: "KONICA MINOLTA magicolor 2530 DL"
+*ShortNickName: "KO. MINOLTA m. 2530 DL foo2lava"
+*NickName: "KONICA MINOLTA magicolor 2530 DL Foomatic/foo2lava (recommended)"
*PSVersion: "(3010.000) 550"
*PSVersion: "(3010.000) 651"
*PSVersion: "(3010.000) 652"
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:KONICA MINOLTA;MDL:mc2530DL;CMD:ZJS,PJL,LAVAFLOW;DES:KONICA MINOLTA mc2530DL;"
+*1284DeviceID: "MFG:KONICA MINOLTA;MDL:mc2530DL;CMD:ZJS,PJL,LAVAFLOW;DES:KONICA MINOLTA mc2530DL;DRV:Dfoo2lava,R1,M0,TF;"
+*driverName foo2lava/foo2lava: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2lava.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -71,11 +77,54 @@
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0
-*FoomaticIDs: KonicaMinolta-magicolor_2530_DL foo2lava
+*FoomaticIDs: KONICA_MINOLTA-magicolor_2530_DL foo2lava
*FoomaticRIPCommandLine: "foo2lava-wrapper %A"
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -209,46 +258,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -358,9 +367,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -368,15 +374,27 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: km2530_1
-*ICM km2530_0/km2530_0 - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
+*DefaultICM: km2530-jc
+*ICM km2530-jc/km2530-jconner-d50.icm (default): "%% FoomaticRIPOptionSetting: ICM=km2530-jc"
+*FoomaticRIPOptionSetting ICM=km2530-jc: "-Gkm2530-jconner-d50.icm "
+*ICM km2530_0/km2530_0.icm - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
*FoomaticRIPOptionSetting ICM=km2530_0: "-Gkm2530_0.icm "
-*ICM km2530_1/km2530_1 - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
+*ICM km2530_1/km2530_1.icm - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
*FoomaticRIPOptionSetting ICM=km2530_1: "-Gkm2530_1.icm "
-*ICM km2530_2/km2530_2 - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
+*ICM km2530_2/km2530_2.icm - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
*FoomaticRIPOptionSetting ICM=km2530_2: "-Gkm2530_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/Kyocera-KM-1635.ppd b/PPD/Kyocera-KM-1635.ppd
new file mode 100644
index 0000000..2a6a6d6
--- /dev/null
+++ b/PPD/Kyocera-KM-1635.ppd
@@ -0,0 +1,286 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Kyocera-KM-1635-foo2oak-z1.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2OAK-.PPD"
+*Manufacturer: "Kyocera"
+*Product: "(KM-1635)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Kyocera KM-1635"
+*ShortNickName: "Kyocera KM-1635 foo2oak-z1"
+*NickName: "Kyocera KM-1635 Foomatic/foo2oak-z1 (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2oak-z1,R1,M0,TF;"
+
+*driverName foo2oak-z1/foo2oak-z1: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2oak.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Kyocera-KM-1635 foo2oak-z1
+*FoomaticRIPCommandLine: "foo2oak-wrapper -z1 %A"
+
+*OpenGroup: General/General
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
+*FoomaticRIPOptionSetting PageSize=A3: "-p8 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p257 "
+*PageSize B4/B4: "%% FoomaticRIPOptionSetting: PageSize=B4"
+*FoomaticRIPOptionSetting PageSize=B4: "-p12 "
+*PageSize B5/B5 [ISO]: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p259 "
+*PageSize B5jis/B5 [JIS]: "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p13 "
+*PageSize B6/B6: "%% FoomaticRIPOptionSetting: PageSize=B6"
+*FoomaticRIPOptionSetting PageSize=B6: "-p258 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvC4/Env C4: "%% FoomaticRIPOptionSetting: PageSize=EnvC4"
+*FoomaticRIPOptionSetting PageSize=EnvC4: "-p30 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p14 "
+*PageSize Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger"
+*FoomaticRIPOptionSetting PageSize=Ledger: "-p3 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*PageSize Statement/Statement: "%% FoomaticRIPOptionSetting: PageSize=Statement"
+*FoomaticRIPOptionSetting PageSize=Statement: "-p6 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B4/B4: "%% FoomaticRIPOptionSetting: PageSize=B4"
+*PageRegion B5/B5 [ISO]: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion B5jis/B5 [JIS]: "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion B6/B6: "%% FoomaticRIPOptionSetting: PageSize=B6"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC4/Env C4: "%% FoomaticRIPOptionSetting: PageSize=EnvC4"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Statement/Statement: "%% FoomaticRIPOptionSetting: PageSize=Statement"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "12.00 12.00 600.00 780.00"
+*ImageableArea A4/A4: "12.00 12.00 583.00 830.00"
+*ImageableArea A3/A3: "12.00 12.00 830.00 1179.00"
+*ImageableArea A5/A5: "12.00 12.00 408.00 583.00"
+*ImageableArea A6/A6: "12.00 12.00 285.00 408.00"
+*ImageableArea B4/B4: "12.00 12.00 696.00 988.00"
+*ImageableArea B5/B5 [ISO]: "12.00 12.00 486.00 696.00"
+*ImageableArea B5jis/B5 [JIS]: "12.00 12.00 506.00 715.00"
+*ImageableArea B6/B6: "12.00 12.00 342.00 486.00"
+*ImageableArea Env10/Env #10: "12.00 12.00 285.00 672.00"
+*ImageableArea EnvC4/Env C4: "12.00 12.00 637.00 906.00"
+*ImageableArea EnvC5/Env C5: "12.00 12.00 447.00 637.00"
+*ImageableArea EnvDL/Env DL: "12.00 12.00 299.00 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "12.00 12.00 267.00 528.00"
+*ImageableArea Executive/Executive: "12.00 12.00 510.00 744.00"
+*ImageableArea Folio/Folio: "12.00 12.00 600.00 924.00"
+*ImageableArea Ledger/Ledger: "12.00 12.00 1212.00 780.00"
+*ImageableArea Legal/Legal: "12.00 12.00 600.00 996.00"
+*ImageableArea Statement/Statement: "12.00 12.00 384.00 600.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A3/A3: "842 1191"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B4/B4: "708 1000"
+*PaperDimension B5/B5 [ISO]: "498 708"
+*PaperDimension B5jis/B5 [JIS]: "518 727"
+*PaperDimension B6/B6: "354 498"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC4/Env C4: "649 918"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Ledger/Ledger: "1224 792"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Statement/Statement: "396 612"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Cassette1/Cassette 1: "%% FoomaticRIPOptionSetting: InputSlot=Cassette1"
+*FoomaticRIPOptionSetting InputSlot=Cassette1: "-s1 "
+*InputSlot MPTray/MP Tray: "%% FoomaticRIPOptionSetting: InputSlot=MPTray"
+*FoomaticRIPOptionSetting InputSlot=MPTray: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Auto
+*MediaType Plain/Plain: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType HighQuality/High quality: "%% FoomaticRIPOptionSetting: MediaType=HighQuality"
+*FoomaticRIPOptionSetting MediaType=HighQuality: "-m20 "
+*MediaType Auto/Auto Select: "%% FoomaticRIPOptionSetting: MediaType=Auto"
+*FoomaticRIPOptionSetting MediaType=Auto: "-m0 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m7 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m10 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m9 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m12 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m6 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m3 "
+*MediaType Preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m2 "
+*MediaType Prepunched/Prepunched: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m5 "
+*MediaType Recycled/Recycled: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m8 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m16 "
+*MediaType Thick/Thick: "%% FoomaticRIPOptionSetting: MediaType=Thick"
+*FoomaticRIPOptionSetting MediaType=Thick: "-m19 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m4 "
+*MediaType Vellum/Vellum: "%% FoomaticRIPOptionSetting: MediaType=Vellum"
+*FoomaticRIPOptionSetting MediaType=Vellum: "-m15 "
+*CloseUI: *MediaType
+
+*CloseGroup: General
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Kyocera-KM-2035.ppd b/PPD/Kyocera-KM-2035.ppd
new file mode 100644
index 0000000..359cd73
--- /dev/null
+++ b/PPD/Kyocera-KM-2035.ppd
@@ -0,0 +1,286 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Kyocera-KM-2035-foo2oak-z1.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2OAK-.PPD"
+*Manufacturer: "Kyocera"
+*Product: "(KM-2035)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Kyocera KM-2035"
+*ShortNickName: "Kyocera KM-2035 foo2oak-z1"
+*NickName: "Kyocera KM-2035 Foomatic/foo2oak-z1 (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2oak-z1,R1,M0,TF;"
+
+*driverName foo2oak-z1/foo2oak-z1: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2oak.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 12.00 12.00 +12.00 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Kyocera-KM-2035 foo2oak-z1
+*FoomaticRIPCommandLine: "foo2oak-wrapper -z1 %A"
+
+*OpenGroup: General/General
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p1 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p9 "
+*PageSize A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
+*FoomaticRIPOptionSetting PageSize=A3: "-p8 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p11 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p257 "
+*PageSize B4/B4: "%% FoomaticRIPOptionSetting: PageSize=B4"
+*FoomaticRIPOptionSetting PageSize=B4: "-p12 "
+*PageSize B5/B5 [ISO]: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p259 "
+*PageSize B5jis/B5 [JIS]: "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p13 "
+*PageSize B6/B6: "%% FoomaticRIPOptionSetting: PageSize=B6"
+*FoomaticRIPOptionSetting PageSize=B6: "-p258 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p20 "
+*PageSize EnvC4/Env C4: "%% FoomaticRIPOptionSetting: PageSize=EnvC4"
+*FoomaticRIPOptionSetting PageSize=EnvC4: "-p30 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p28 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p27 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p37 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p7 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p14 "
+*PageSize Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger"
+*FoomaticRIPOptionSetting PageSize=Ledger: "-p3 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p5 "
+*PageSize Statement/Statement: "%% FoomaticRIPOptionSetting: PageSize=Statement"
+*FoomaticRIPOptionSetting PageSize=Statement: "-p6 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A3/A3: "%% FoomaticRIPOptionSetting: PageSize=A3"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B4/B4: "%% FoomaticRIPOptionSetting: PageSize=B4"
+*PageRegion B5/B5 [ISO]: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion B5jis/B5 [JIS]: "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion B6/B6: "%% FoomaticRIPOptionSetting: PageSize=B6"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC4/Env C4: "%% FoomaticRIPOptionSetting: PageSize=EnvC4"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Ledger/Ledger: "%% FoomaticRIPOptionSetting: PageSize=Ledger"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Statement/Statement: "%% FoomaticRIPOptionSetting: PageSize=Statement"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "12.00 12.00 600.00 780.00"
+*ImageableArea A4/A4: "12.00 12.00 583.00 830.00"
+*ImageableArea A3/A3: "12.00 12.00 830.00 1179.00"
+*ImageableArea A5/A5: "12.00 12.00 408.00 583.00"
+*ImageableArea A6/A6: "12.00 12.00 285.00 408.00"
+*ImageableArea B4/B4: "12.00 12.00 696.00 988.00"
+*ImageableArea B5/B5 [ISO]: "12.00 12.00 486.00 696.00"
+*ImageableArea B5jis/B5 [JIS]: "12.00 12.00 506.00 715.00"
+*ImageableArea B6/B6: "12.00 12.00 342.00 486.00"
+*ImageableArea Env10/Env #10: "12.00 12.00 285.00 672.00"
+*ImageableArea EnvC4/Env C4: "12.00 12.00 637.00 906.00"
+*ImageableArea EnvC5/Env C5: "12.00 12.00 447.00 637.00"
+*ImageableArea EnvDL/Env DL: "12.00 12.00 299.00 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "12.00 12.00 267.00 528.00"
+*ImageableArea Executive/Executive: "12.00 12.00 510.00 744.00"
+*ImageableArea Folio/Folio: "12.00 12.00 600.00 924.00"
+*ImageableArea Ledger/Ledger: "12.00 12.00 1212.00 780.00"
+*ImageableArea Legal/Legal: "12.00 12.00 600.00 996.00"
+*ImageableArea Statement/Statement: "12.00 12.00 384.00 600.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A3/A3: "842 1191"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B4/B4: "708 1000"
+*PaperDimension B5/B5 [ISO]: "498 708"
+*PaperDimension B5jis/B5 [JIS]: "518 727"
+*PaperDimension B6/B6: "354 498"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC4/Env C4: "649 918"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Ledger/Ledger: "1224 792"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Statement/Statement: "396 612"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s7 "
+*InputSlot Cassette1/Cassette 1: "%% FoomaticRIPOptionSetting: InputSlot=Cassette1"
+*FoomaticRIPOptionSetting InputSlot=Cassette1: "-s1 "
+*InputSlot MPTray/MP Tray: "%% FoomaticRIPOptionSetting: InputSlot=MPTray"
+*FoomaticRIPOptionSetting InputSlot=MPTray: "-s4 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: Auto
+*MediaType Plain/Plain: "%% FoomaticRIPOptionSetting: MediaType=Plain"
+*FoomaticRIPOptionSetting MediaType=Plain: "-m1 "
+*MediaType HighQuality/High quality: "%% FoomaticRIPOptionSetting: MediaType=HighQuality"
+*FoomaticRIPOptionSetting MediaType=HighQuality: "-m20 "
+*MediaType Auto/Auto Select: "%% FoomaticRIPOptionSetting: MediaType=Auto"
+*FoomaticRIPOptionSetting MediaType=Auto: "-m0 "
+*MediaType Bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=Bond"
+*FoomaticRIPOptionSetting MediaType=Bond: "-m7 "
+*MediaType Cardstock/Cardstock: "%% FoomaticRIPOptionSetting: MediaType=Cardstock"
+*FoomaticRIPOptionSetting MediaType=Cardstock: "-m10 "
+*MediaType Color/Color: "%% FoomaticRIPOptionSetting: MediaType=Color"
+*FoomaticRIPOptionSetting MediaType=Color: "-m9 "
+*MediaType Envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=Envelope"
+*FoomaticRIPOptionSetting MediaType=Envelope: "-m12 "
+*MediaType Labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=Labels"
+*FoomaticRIPOptionSetting MediaType=Labels: "-m6 "
+*MediaType Letterhead/Letterhead: "%% FoomaticRIPOptionSetting: MediaType=Letterhead"
+*FoomaticRIPOptionSetting MediaType=Letterhead: "-m3 "
+*MediaType Preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=Preprinted"
+*FoomaticRIPOptionSetting MediaType=Preprinted: "-m2 "
+*MediaType Prepunched/Prepunched: "%% FoomaticRIPOptionSetting: MediaType=Prepunched"
+*FoomaticRIPOptionSetting MediaType=Prepunched: "-m5 "
+*MediaType Recycled/Recycled: "%% FoomaticRIPOptionSetting: MediaType=Recycled"
+*FoomaticRIPOptionSetting MediaType=Recycled: "-m8 "
+*MediaType Rough/Rough: "%% FoomaticRIPOptionSetting: MediaType=Rough"
+*FoomaticRIPOptionSetting MediaType=Rough: "-m16 "
+*MediaType Thick/Thick: "%% FoomaticRIPOptionSetting: MediaType=Thick"
+*FoomaticRIPOptionSetting MediaType=Thick: "-m19 "
+*MediaType Transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=Transparency"
+*FoomaticRIPOptionSetting MediaType=Transparency: "-m4 "
+*MediaType Vellum/Vellum: "%% FoomaticRIPOptionSetting: MediaType=Vellum"
+*FoomaticRIPOptionSetting MediaType=Vellum: "-m15 "
+*CloseUI: *MediaType
+
+*CloseGroup: General
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Lexmark-C500.ppd b/PPD/Lexmark-C500.ppd
new file mode 100644
index 0000000..c2ab03d
--- /dev/null
+++ b/PPD/Lexmark-C500.ppd
@@ -0,0 +1,426 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Lexmark-C500-foo2slx.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2SLX.PPD"
+*Manufacturer: "Lexmark"
+*Product: "(C500)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Lexmark C500"
+*ShortNickName: "Lexmark C500 foo2slx"
+*NickName: "Lexmark C500 Foomatic/foo2slx (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2slx,R1,M0,TF;"
+
+*driverName foo2slx/foo2slx: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2slx.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Lexmark-C500 foo2slx
+*FoomaticRIPCommandLine: "foo2slx-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p6 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p2 "
+*PageSize B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*FoomaticRIPOptionSetting PageSize=B5: "-p4 "
+*PageSize B5iso/B5iso: "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*FoomaticRIPOptionSetting PageSize=B5iso: "-p5 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p11 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p8 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p9 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion B5/B5: "%% FoomaticRIPOptionSetting: PageSize=B5"
+*PageRegion B5iso/B5iso: "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea B5/B5: "9 12.00 489 696.00"
+*ImageableArea B5iso/B5iso: "9 12.00 489 696.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension B5/B5: "498 708"
+*PaperDimension B5iso/B5iso: "498 708"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Cassette1/Cassette 1: "%% FoomaticRIPOptionSetting: InputSlot=Cassette1"
+*FoomaticRIPOptionSetting InputSlot=Cassette1: "-s1 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType middle/Middle: "%% FoomaticRIPOptionSetting: MediaType=middle"
+*FoomaticRIPOptionSetting MediaType=middle: "-m8 "
+*MediaType envelope1/Envelope 1: "%% FoomaticRIPOptionSetting: MediaType=envelope1"
+*FoomaticRIPOptionSetting MediaType=envelope1: "-m4 "
+*MediaType envelope2/Envelope 2: "%% FoomaticRIPOptionSetting: MediaType=envelope2"
+*FoomaticRIPOptionSetting MediaType=envelope2: "-m7 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m2 "
+*MediaType special/Special: "%% FoomaticRIPOptionSetting: MediaType=special"
+*FoomaticRIPOptionSetting MediaType=special: "-m9 "
+*MediaType thick1/Thick 1: "%% FoomaticRIPOptionSetting: MediaType=thick1"
+*FoomaticRIPOptionSetting MediaType=thick1: "-m3 "
+*MediaType thick2/Thick 2: "%% FoomaticRIPOptionSetting: MediaType=thick2"
+*FoomaticRIPOptionSetting MediaType=thick2: "-m6 "
+*MediaType thin/Thin: "%% FoomaticRIPOptionSetting: MediaType=thin"
+*FoomaticRIPOptionSetting MediaType=thin: "-m5 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m1 "
+*CloseUI: *MediaType
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: lexRPCA2000
+*ICM lexRPCA2000/File lexRPCA2000.icm (xp): "%% FoomaticRIPOptionSetting: ICM=lexRPCA2000"
+*FoomaticRIPOptionSetting ICM=lexRPCA2000: "-GlexRPCA2000.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Minolta-Color_PageWorks_Pro_L.ppd b/PPD/Minolta-Color_PageWorks_Pro_L.ppd
index 9e3157a..51f9238 100644
--- a/PPD/Minolta-Color_PageWorks_Pro_L.ppd
+++ b/PPD/Minolta-Color_PageWorks_Pro_L.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,46 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -196,46 +242,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -360,7 +366,7 @@
*ICM CPWL24W/File CPWL24W.icm: "%% FoomaticRIPOptionSetting: ICM=CPWL24W"
*FoomaticRIPOptionSetting ICM=CPWL24W: "-GCPWL24W.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/Minolta-magicolor_2200_DL.ppd b/PPD/Minolta-magicolor_2200_DL.ppd
index 7dc6276..8196fc4 100644
--- a/PPD/Minolta-magicolor_2200_DL.ppd
+++ b/PPD/Minolta-magicolor_2200_DL.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,40 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=Color: " "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*FoomaticRIPOption Resolution: enum CmdLine A 130
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -198,44 +238,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -345,9 +347,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=Color: " "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -359,7 +358,7 @@
*ICM DL2200RGB/File DL2200RGB.icm: "%% FoomaticRIPOptionSetting: ICM=DL2200RGB"
*FoomaticRIPOptionSetting ICM=DL2200RGB: "-GDL2200RGB.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/Minolta-magicolor_2300_DL.ppd b/PPD/Minolta-magicolor_2300_DL.ppd
index 9650ff5..9b58860 100644
--- a/PPD/Minolta-magicolor_2300_DL.ppd
+++ b/PPD/Minolta-magicolor_2300_DL.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MANUFACTURER:MINOLTA-QMS;MODEL:magicolor 2300 DL;COMMAND SET:ZJS,PJL;"
+*1284DeviceID: "MANUFACTURER:MINOLTA-QMS;MODEL:magicolor 2300 DL;COMMAND SET:ZJS,PJL;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,49 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=Color: " "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -196,46 +245,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -345,9 +354,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=Color: " "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -363,7 +369,7 @@
*ICM km2430_2/File km2430_2.icm: "%% FoomaticRIPOptionSetting: ICM=km2430_2"
*FoomaticRIPOptionSetting ICM=km2430_2: "-Gkm2430_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/Minolta-magicolor_2430_DL.ppd b/PPD/Minolta-magicolor_2430_DL.ppd
index 7a05fe0..1d1fc10 100644
--- a/PPD/Minolta-magicolor_2430_DL.ppd
+++ b/PPD/Minolta-magicolor_2430_DL.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MANUFACTURER:MINOLTA-QMS;MODEL:magicolor 2430 DL;COMMAND SET:ZJS,PJL;"
+*1284DeviceID: "MANUFACTURER:MINOLTA-QMS;MODEL:magicolor 2430 DL;COMMAND SET:ZJS,PJL;DRV:Dfoo2zjs,R1,M0,TF;"
+*driverName foo2zjs/foo2zjs: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2zjs.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,49 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=Color: " "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -196,46 +245,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -345,9 +354,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=Color: " "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -363,7 +369,7 @@
*ICM km2430_2/File km2430_2.icm: "%% FoomaticRIPOptionSetting: ICM=km2430_2"
*FoomaticRIPOptionSetting ICM=km2430_2: "-Gkm2430_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
-*FoomaticRIPOptionSetting ICM=none: " "
+*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
diff --git a/PPD/Oki-C3100.ppd b/PPD/Oki-C3100.ppd
new file mode 100644
index 0000000..39efe7f
--- /dev/null
+++ b/PPD/Oki-C3100.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C3100-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C3100)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C3100"
+*ShortNickName: "Oki C3100 foo2hiperc"
+*NickName: "Oki C3100 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C3100 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C3200.ppd b/PPD/Oki-C3200.ppd
new file mode 100644
index 0000000..019dc3c
--- /dev/null
+++ b/PPD/Oki-C3200.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C3200-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C3200)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C3200"
+*ShortNickName: "Oki C3200 foo2hiperc"
+*NickName: "Oki C3200 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C3200 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C3300.ppd b/PPD/Oki-C3300.ppd
new file mode 100644
index 0000000..27e6574
--- /dev/null
+++ b/PPD/Oki-C3300.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C3300-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C3300)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C3300"
+*ShortNickName: "Oki C3300 foo2hiperc"
+*NickName: "Oki C3300 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C3300 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C3400.ppd b/PPD/Oki-C3400.ppd
new file mode 100644
index 0000000..1fbfb4a
--- /dev/null
+++ b/PPD/Oki-C3400.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C3400-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C3400)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C3400"
+*ShortNickName: "Oki C3400 foo2hiperc"
+*NickName: "Oki C3400 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C3400 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C3530_MFP.ppd b/PPD/Oki-C3530_MFP.ppd
new file mode 100644
index 0000000..b1ae1bc
--- /dev/null
+++ b/PPD/Oki-C3530_MFP.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C3530_MFP-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C3530 MFP)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C3530 MFP"
+*ShortNickName: "Oki C3530 MFP foo2hiperc"
+*NickName: "Oki C3530 MFP Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C3530_MFP foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C5100.ppd b/PPD/Oki-C5100.ppd
new file mode 100644
index 0000000..a37f551
--- /dev/null
+++ b/PPD/Oki-C5100.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C5100-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C5100)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C5100"
+*ShortNickName: "Oki C5100 foo2hiperc"
+*NickName: "Oki C5100 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C5100 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C5200.ppd b/PPD/Oki-C5200.ppd
new file mode 100644
index 0000000..de48f94
--- /dev/null
+++ b/PPD/Oki-C5200.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C5200-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C5200)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C5200"
+*ShortNickName: "Oki C5200 foo2hiperc"
+*NickName: "Oki C5200 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C5200 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C5500.ppd b/PPD/Oki-C5500.ppd
new file mode 100644
index 0000000..ab1f3d9
--- /dev/null
+++ b/PPD/Oki-C5500.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C5500-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C5500)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C5500"
+*ShortNickName: "Oki C5500 foo2hiperc"
+*NickName: "Oki C5500 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C5500 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C5600.ppd b/PPD/Oki-C5600.ppd
new file mode 100644
index 0000000..66eaf25
--- /dev/null
+++ b/PPD/Oki-C5600.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C5600-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C5600)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C5600"
+*ShortNickName: "Oki C5600 foo2hiperc"
+*NickName: "Oki C5600 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C5600 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Oki-C5800.ppd b/PPD/Oki-C5800.ppd
new file mode 100644
index 0000000..015eb34
--- /dev/null
+++ b/PPD/Oki-C5800.ppd
@@ -0,0 +1,475 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Oki-C5800-foo2hiperc.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2HIPE.PPD"
+*Manufacturer: "Oki"
+*Product: "(C5800)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Oki C5800"
+*ShortNickName: "Oki C5800 foo2hiperc"
+*NickName: "Oki C5800 Foomatic/foo2hiperc (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2hiperc,R1,M0,TF;"
+
+*driverName foo2hiperc/foo2hiperc: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2hiperc.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Oki-C5800 foo2hiperc
+*FoomaticRIPCommandLine: "foo2hiperc-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 600x600dpi
+*Resolution 300x300dpi/300x300 dpi: "%% FoomaticRIPOptionSetting: Resolution=300x300dpi"
+*FoomaticRIPOptionSetting Resolution=300x300dpi: "-r300x300 "
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 600x1200dpi/600x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x1200dpi"
+*FoomaticRIPOptionSetting Resolution=600x1200dpi: "-r600x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p2 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p1 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p5 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p7 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p6 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p11 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p10 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p8 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p12 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p3 "
+*PageSize Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*FoomaticRIPOptionSetting PageSize=Legal13: "-p4 "
+*PageSize Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*FoomaticRIPOptionSetting PageSize=Legal135: "-p14 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*PageRegion Legal13/Legal 13: "%% FoomaticRIPOptionSetting: PageSize=Legal13"
+*PageRegion Legal135/Legal 135: "%% FoomaticRIPOptionSetting: PageSize=Legal135"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+*ImageableArea Legal13/Legal 13: "9 12.00 603 996.00"
+*ImageableArea Legal135/Legal 135: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Legal/Legal: "612 1008"
+*PaperDimension Legal13/Legal 13: "612 1008"
+*PaperDimension Legal135/Legal 135: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
+*InputSlot Tray2/Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s2 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s0 "
+*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s4 "
+*InputSlot Multi/MultiPurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m1 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m2 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *Compression/Compression Mode: PickOne
+*FoomaticRIPOption Compression: enum CmdLine A
+*OrderDependency: 120 AnySetup *Compression
+*DefaultCompression: uncompressed
+*Compression compressed/Compressed: "%% FoomaticRIPOptionSetting: Compression=compressed"
+*FoomaticRIPOptionSetting Compression=compressed: "-Z1 "
+*Compression uncompressed/Uncompressed: "%% FoomaticRIPOptionSetting: Compression=uncompressed"
+*FoomaticRIPOptionSetting Compression=uncompressed: "-Z0 "
+*CloseUI: *Compression
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: OK3200L2
+*ICM C3400-L1/C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L1"
+*FoomaticRIPOptionSetting ICM=C3400-L1: "-C10 -GC3400-L1-BIN-ICC_06031&&
+50.icm "
+*End
+*ICM C3400-L2/C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP: "%% FoomaticRIPOptionSetting: ICM=C3400-L2"
+*FoomaticRIPOptionSetting ICM=C3400-L2: "-C10 -GC3400-L2-BIN-ICC_06041&&
+10.icm "
+*End
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM OK3200L1/OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L1"
+*FoomaticRIPOptionSetting ICM=OK3200L1: "-C10 -GOK3200L1.icm "
+*ICM OK3200L2/OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200: "%% FoomaticRIPOptionSetting: ICM=OK3200L2"
+*FoomaticRIPOptionSetting ICM=OK3200L2: "-C10 -GOK3200L2.icm "
+*ICM OK5600L1/OK5600L1.icm - 600dpi Multi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L1"
+*FoomaticRIPOptionSetting ICM=OK5600L1: "-C10 -GOK5600L1.icm "
+*ICM OK5600L2/OK5600L2.icm - 1200dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L2"
+*FoomaticRIPOptionSetting ICM=OK5600L2: "-C10 -GOK5600L2.icm "
+*ICM OK5600L3/OK5600L3.icm - 600dpi C5500/C5600/C5800: "%% FoomaticRIPOptionSetting: ICM=OK5600L3"
+*FoomaticRIPOptionSetting ICM=OK5600L3: "-C10 -GOK5600L3.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Samsung-CLP-300.ppd b/PPD/Samsung-CLP-300.ppd
index 609d31f..4959603 100644
--- a/PPD/Samsung-CLP-300.ppd
+++ b/PPD/Samsung-CLP-300.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 9 12.00 9 12
+
+*HWMargins: 9 12.00 9 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,41 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -165,8 +206,10 @@
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Auto
-*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
@@ -219,38 +262,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
-*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -370,14 +381,26 @@
*DefaultICM: clp300
*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/Samsung-CLP-315.ppd b/PPD/Samsung-CLP-315.ppd
new file mode 100644
index 0000000..3386cb0
--- /dev/null
+++ b/PPD/Samsung-CLP-315.ppd
@@ -0,0 +1,493 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Samsung-CLP-315-foo2qpdl.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2QPDL.PPD"
+*Manufacturer: "Samsung"
+*Product: "(CLP-315)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Samsung CLP-315"
+*ShortNickName: "Samsung CLP-315 foo2qpdl"
+*NickName: "Samsung CLP-315 Foomatic/foo2qpdl (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Samsung-CLP-315 foo2qpdl
+*FoomaticRIPCommandLine: "foo2qpdl-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z2: "-z2 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p0 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p2 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p16 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p17 "
+*PageSize B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*FoomaticRIPOptionSetting PageSize=B5iso: "-p12 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p11 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p6 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p8 "
+*PageSize EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*FoomaticRIPOptionSetting PageSize=EnvC6: "-p23 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p7 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p3 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p24 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p1 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5iso/B5 (ISO): "9 12.00 489 696.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvC6/Env C6: "9 12.00 314 447.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Folio/Folio: "9 12.00 603 924.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5iso/B5 (ISO): "498 708"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvC6/Env C6: "323 459"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
+*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
+*InputSlot Multi/Multipurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType archive/Archive Paper: "%% FoomaticRIPOptionSetting: MediaType=archive"
+*FoomaticRIPOptionSetting MediaType=archive: "-m12 "
+*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
+*FoomaticRIPOptionSetting MediaType=bond: "-m3 "
+*MediaType card/Card Stock: "%% FoomaticRIPOptionSetting: MediaType=card"
+*FoomaticRIPOptionSetting MediaType=card: "-m5 "
+*MediaType color/Color Paper: "%% FoomaticRIPOptionSetting: MediaType=color"
+*FoomaticRIPOptionSetting MediaType=color: "-m4 "
+*MediaType cotton/Cotton: "%% FoomaticRIPOptionSetting: MediaType=cotton"
+*FoomaticRIPOptionSetting MediaType=cotton: "-m9 "
+*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
+*FoomaticRIPOptionSetting MediaType=envelope: "-m7 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m6 "
+*MediaType preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=preprinted"
+*FoomaticRIPOptionSetting MediaType=preprinted: "-m8 "
+*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
+*FoomaticRIPOptionSetting MediaType=recycled: "-m10 "
+*MediaType thick/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=thick"
+*FoomaticRIPOptionSetting MediaType=thick: "-m1 "
+*MediaType thin/Thin Stock: "%% FoomaticRIPOptionSetting: MediaType=thin"
+*FoomaticRIPOptionSetting MediaType=thin: "-m2 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m11 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d4 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d5 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: clp315
+*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
+*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
+*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
+*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
+*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
+*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
+*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Samsung-CLP-600.ppd b/PPD/Samsung-CLP-600.ppd
index f9d007c..238b89e 100644
--- a/PPD/Samsung-CLP-600.ppd
+++ b/PPD/Samsung-CLP-600.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 9 12.00 9 12
+
+*HWMargins: 9 12.00 9 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,41 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z1: "-z1 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -165,8 +206,10 @@
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Auto
-*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
@@ -219,38 +262,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
-*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -370,14 +381,26 @@
*DefaultICM: clp600
*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/Samsung-CLP-610.ppd b/PPD/Samsung-CLP-610.ppd
new file mode 100644
index 0000000..ac4c4fe
--- /dev/null
+++ b/PPD/Samsung-CLP-610.ppd
@@ -0,0 +1,493 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Samsung-CLP-610-foo2qpdl.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2QPDL.PPD"
+*Manufacturer: "Samsung"
+*Product: "(CLP-610)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Samsung CLP-610"
+*ShortNickName: "Samsung CLP-610 foo2qpdl"
+*NickName: "Samsung CLP-610 Foomatic/foo2qpdl (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Samsung-CLP-610 foo2qpdl
+*FoomaticRIPCommandLine: "foo2qpdl-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z2: "-z2 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p0 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p2 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p16 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p17 "
+*PageSize B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*FoomaticRIPOptionSetting PageSize=B5iso: "-p12 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p11 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p6 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p8 "
+*PageSize EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*FoomaticRIPOptionSetting PageSize=EnvC6: "-p23 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p7 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p3 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p24 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p1 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5iso/B5 (ISO): "9 12.00 489 696.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvC6/Env C6: "9 12.00 314 447.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Folio/Folio: "9 12.00 603 924.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5iso/B5 (ISO): "498 708"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvC6/Env C6: "323 459"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
+*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
+*InputSlot Multi/Multipurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType archive/Archive Paper: "%% FoomaticRIPOptionSetting: MediaType=archive"
+*FoomaticRIPOptionSetting MediaType=archive: "-m12 "
+*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
+*FoomaticRIPOptionSetting MediaType=bond: "-m3 "
+*MediaType card/Card Stock: "%% FoomaticRIPOptionSetting: MediaType=card"
+*FoomaticRIPOptionSetting MediaType=card: "-m5 "
+*MediaType color/Color Paper: "%% FoomaticRIPOptionSetting: MediaType=color"
+*FoomaticRIPOptionSetting MediaType=color: "-m4 "
+*MediaType cotton/Cotton: "%% FoomaticRIPOptionSetting: MediaType=cotton"
+*FoomaticRIPOptionSetting MediaType=cotton: "-m9 "
+*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
+*FoomaticRIPOptionSetting MediaType=envelope: "-m7 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m6 "
+*MediaType preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=preprinted"
+*FoomaticRIPOptionSetting MediaType=preprinted: "-m8 "
+*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
+*FoomaticRIPOptionSetting MediaType=recycled: "-m10 "
+*MediaType thick/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=thick"
+*FoomaticRIPOptionSetting MediaType=thick: "-m1 "
+*MediaType thin/Thin Stock: "%% FoomaticRIPOptionSetting: MediaType=thin"
+*FoomaticRIPOptionSetting MediaType=thin: "-m2 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m11 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d2 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d3 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: clp610
+*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
+*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
+*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
+*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
+*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
+*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
+*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Samsung-CLX-2160.ppd b/PPD/Samsung-CLX-2160.ppd
new file mode 100644
index 0000000..65d88d0
--- /dev/null
+++ b/PPD/Samsung-CLX-2160.ppd
@@ -0,0 +1,493 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Samsung-CLX-2160-foo2qpdl.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2QPDL.PPD"
+*Manufacturer: "Samsung"
+*Product: "(CLX-2160)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Samsung CLX-2160"
+*ShortNickName: "Samsung CLX-2160 foo2qpdl"
+*NickName: "Samsung CLX-2160 Foomatic/foo2qpdl (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Samsung-CLX-2160 foo2qpdl
+*FoomaticRIPCommandLine: "foo2qpdl-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p0 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p2 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p16 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p17 "
+*PageSize B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*FoomaticRIPOptionSetting PageSize=B5iso: "-p12 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p11 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p6 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p8 "
+*PageSize EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*FoomaticRIPOptionSetting PageSize=EnvC6: "-p23 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p7 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p3 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p24 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p1 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5iso/B5 (ISO): "9 12.00 489 696.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvC6/Env C6: "9 12.00 314 447.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Folio/Folio: "9 12.00 603 924.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5iso/B5 (ISO): "498 708"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvC6/Env C6: "323 459"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
+*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
+*InputSlot Multi/Multipurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType archive/Archive Paper: "%% FoomaticRIPOptionSetting: MediaType=archive"
+*FoomaticRIPOptionSetting MediaType=archive: "-m12 "
+*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
+*FoomaticRIPOptionSetting MediaType=bond: "-m3 "
+*MediaType card/Card Stock: "%% FoomaticRIPOptionSetting: MediaType=card"
+*FoomaticRIPOptionSetting MediaType=card: "-m5 "
+*MediaType color/Color Paper: "%% FoomaticRIPOptionSetting: MediaType=color"
+*FoomaticRIPOptionSetting MediaType=color: "-m4 "
+*MediaType cotton/Cotton: "%% FoomaticRIPOptionSetting: MediaType=cotton"
+*FoomaticRIPOptionSetting MediaType=cotton: "-m9 "
+*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
+*FoomaticRIPOptionSetting MediaType=envelope: "-m7 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m6 "
+*MediaType preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=preprinted"
+*FoomaticRIPOptionSetting MediaType=preprinted: "-m8 "
+*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
+*FoomaticRIPOptionSetting MediaType=recycled: "-m10 "
+*MediaType thick/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=thick"
+*FoomaticRIPOptionSetting MediaType=thick: "-m1 "
+*MediaType thin/Thin Stock: "%% FoomaticRIPOptionSetting: MediaType=thin"
+*FoomaticRIPOptionSetting MediaType=thin: "-m2 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m11 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d4 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d5 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: clx2160
+*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
+*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
+*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
+*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
+*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
+*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
+*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Samsung-CLX-3160.ppd b/PPD/Samsung-CLX-3160.ppd
index 37e810a..911bb65 100644
--- a/PPD/Samsung-CLX-3160.ppd
+++ b/PPD/Samsung-CLX-3160.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 9 12.00 9 12
+
+*HWMargins: 9 12.00 9 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -76,6 +82,41 @@
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -165,8 +206,10 @@
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Auto
-*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
@@ -219,38 +262,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
-*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -370,14 +381,26 @@
*DefaultICM: clx3160
*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/Samsung-CLX-3175.ppd b/PPD/Samsung-CLX-3175.ppd
new file mode 100644
index 0000000..f31458d
--- /dev/null
+++ b/PPD/Samsung-CLX-3175.ppd
@@ -0,0 +1,493 @@
+*PPD-Adobe: "4.3"
+*%
+*% For information on using this, and to obtain the required backend
+*% script, consult http://www.openprinting.org/
+*%
+*% This file is published under the GNU General Public License
+*%
+*% PPD-O-MATIC (3.0.0 or newer) generated this PPD file. It is for use with
+*% all programs and environments which use PPD files for dealing with
+*% printer capability information. The printer must be configured with the
+*% "foomatic-rip" backend filter script of Foomatic 3.0.0 or newer. This
+*% file and "foomatic-rip" work together to support PPD-controlled printer
+*% driver option access with arbitrary free software printer drivers and
+*% printing spoolers.
+*%
+*% To save this file on your disk, wait until the download has completed
+*% (the animation of the browser logo must stop) and then use the
+*% "Save as..." command in the "File" menu of your browser or in the
+*% pop-up manu when you click on this document with the right mouse button.
+*% DO NOT cut and paste this file into an editor with your mouse. This can
+*% introduce additional line breaks which lead to unexpected results.
+*%
+*% You may save this file as 'Samsung-CLX-3175-foo2qpdl.ppd'
+*%
+*%
+*FormatVersion: "4.3"
+*FileVersion: "1.1"
+*LanguageVersion: English
+*LanguageEncoding: ISOLatin1
+*PCFileName: "FOO2QPDL.PPD"
+*Manufacturer: "Samsung"
+*Product: "(CLX-3175)"
+*cupsVersion: 1.0
+*cupsManualCopies: True
+*cupsModelNumber: 2
+*cupsFilter: "application/vnd.cups-postscript 0 foomatic-rip"
+*%pprRIP: foomatic-rip other
+*ModelName: "Samsung CLX-3175"
+*ShortNickName: "Samsung CLX-3175 foo2qpdl"
+*NickName: "Samsung CLX-3175 Foomatic/foo2qpdl (recommended)"
+*PSVersion: "(3010.000) 550"
+*PSVersion: "(3010.000) 651"
+*PSVersion: "(3010.000) 652"
+*PSVersion: "(3010.000) 653"
+*PSVersion: "(3010.000) 704"
+*PSVersion: "(3010.000) 705"
+*PSVersion: "(3010.000) 800"
+*LanguageLevel: "3"
+*ColorDevice: True
+*DefaultColorSpace: RGB
+*FileSystem: False
+*Throughput: "1"
+*LandscapeOrientation: Plus90
+*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2qpdl,R1,M0,TF;"
+
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
+
+
+
+
+*HWMargins: 9 12.00 9 +12.00
+*VariablePaperSize: True
+*MaxMediaWidth: 100000
+*MaxMediaHeight: 100000
+*NonUIOrderDependency: 135 AnySetup *CustomPageSize
+*CustomPageSize True: "pop pop pop pop pop
+%% FoomaticRIPOptionSetting: PageSize=Custom"
+*End
+*FoomaticRIPOptionSetting PageSize=Custom: "-pCustom.%0x%1 "
+*ParamCustomPageSize Width: 1 points 36 100000
+*ParamCustomPageSize Height: 2 points 36 100000
+*ParamCustomPageSize Orientation: 3 int 0 0
+*ParamCustomPageSize WidthOffset: 4 points 0 0
+*ParamCustomPageSize HeightOffset: 5 points 0 0
+
+*FoomaticIDs: Samsung-CLX-3175 foo2qpdl
+*FoomaticRIPCommandLine: "foo2qpdl-wrapper %A"
+
+*OpenGroup: General/General
+
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z2: "-z2 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
+*OpenUI *PageSize/Page Size: PickOne
+*FoomaticRIPOption PageSize: enum CmdLine A
+*OrderDependency: 135 AnySetup *PageSize
+*DefaultPageSize: Letter
+*PageSize Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*FoomaticRIPOptionSetting PageSize=Letter: "-p0 "
+*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*FoomaticRIPOptionSetting PageSize=A4: "-p2 "
+*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*FoomaticRIPOptionSetting PageSize=A5: "-p16 "
+*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*FoomaticRIPOptionSetting PageSize=A6: "-p17 "
+*PageSize B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*FoomaticRIPOptionSetting PageSize=B5iso: "-p12 "
+*PageSize B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*FoomaticRIPOptionSetting PageSize=B5jis: "-p11 "
+*PageSize Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*FoomaticRIPOptionSetting PageSize=Env10: "-p6 "
+*PageSize EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*FoomaticRIPOptionSetting PageSize=EnvC5: "-p8 "
+*PageSize EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*FoomaticRIPOptionSetting PageSize=EnvC6: "-p23 "
+*PageSize EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*FoomaticRIPOptionSetting PageSize=EnvDL: "-p9 "
+*PageSize EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*FoomaticRIPOptionSetting PageSize=EnvMonarch: "-p7 "
+*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*FoomaticRIPOptionSetting PageSize=Executive: "-p3 "
+*PageSize Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*FoomaticRIPOptionSetting PageSize=Folio: "-p24 "
+*PageSize Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*FoomaticRIPOptionSetting PageSize=Legal: "-p1 "
+*CloseUI: *PageSize
+
+*OpenUI *PageRegion: PickOne
+*OrderDependency: 135 AnySetup *PageRegion
+*DefaultPageRegion: Letter
+*PageRegion Letter/Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
+*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
+*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
+*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
+*PageRegion B5iso/B5 (ISO): "%% FoomaticRIPOptionSetting: PageSize=B5iso"
+*PageRegion B5jis/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5jis"
+*PageRegion Env10/Env #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
+*PageRegion EnvC5/Env C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
+*PageRegion EnvC6/Env C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
+*PageRegion EnvDL/Env DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
+*PageRegion EnvMonarch/Env Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
+*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
+*PageRegion Folio/Folio: "%% FoomaticRIPOptionSetting: PageSize=Folio"
+*PageRegion Legal/Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
+*CloseUI: *PageRegion
+
+*DefaultImageableArea: Letter
+*ImageableArea Letter/Letter: "9 12.00 603 780.00"
+*ImageableArea A4/A4: "9 12.00 586 830.00"
+*ImageableArea A5/A5: "9 12.00 411 583.00"
+*ImageableArea A6/A6: "9 12.00 288 408.00"
+*ImageableArea B5iso/B5 (ISO): "9 12.00 489 696.00"
+*ImageableArea B5jis/B5 (JIS): "9 12.00 509 715.00"
+*ImageableArea Env10/Env #10: "9 12.00 288 672.00"
+*ImageableArea EnvC5/Env C5: "9 12.00 450 637.00"
+*ImageableArea EnvC6/Env C6: "9 12.00 314 447.00"
+*ImageableArea EnvDL/Env DL: "9 12.00 302 611.00"
+*ImageableArea EnvMonarch/Env Monarch: "9 12.00 270 528.00"
+*ImageableArea Executive/Executive: "9 12.00 513 744.00"
+*ImageableArea Folio/Folio: "9 12.00 603 924.00"
+*ImageableArea Legal/Legal: "9 12.00 603 996.00"
+
+*DefaultPaperDimension: Letter
+*PaperDimension Letter/Letter: "612 792"
+*PaperDimension A4/A4: "595 842"
+*PaperDimension A5/A5: "420 595"
+*PaperDimension A6/A6: "297 420"
+*PaperDimension B5iso/B5 (ISO): "498 708"
+*PaperDimension B5jis/B5 (JIS): "518 727"
+*PaperDimension Env10/Env #10: "297 684"
+*PaperDimension EnvC5/Env C5: "459 649"
+*PaperDimension EnvC6/Env C6: "323 459"
+*PaperDimension EnvDL/Env DL: "311 623"
+*PaperDimension EnvMonarch/Env Monarch: "279 540"
+*PaperDimension Executive/Executive: "522 756"
+*PaperDimension Folio/Folio: "612 936"
+*PaperDimension Legal/Legal: "612 1008"
+
+*OpenUI *InputSlot/Media Source: PickOne
+*FoomaticRIPOption InputSlot: enum CmdLine A
+*OrderDependency: 150 AnySetup *InputSlot
+*DefaultInputSlot: Auto
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
+*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
+*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
+*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
+*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
+*InputSlot Multi/Multipurpose: "%% FoomaticRIPOptionSetting: InputSlot=Multi"
+*FoomaticRIPOptionSetting InputSlot=Multi: "-s3 "
+*CloseUI: *InputSlot
+
+*OpenUI *MediaType/Media Type: PickOne
+*FoomaticRIPOption MediaType: enum CmdLine A
+*OrderDependency: 150 AnySetup *MediaType
+*DefaultMediaType: plain
+*MediaType plain/Plain Paper: "%% FoomaticRIPOptionSetting: MediaType=plain"
+*FoomaticRIPOptionSetting MediaType=plain: "-m0 "
+*MediaType archive/Archive Paper: "%% FoomaticRIPOptionSetting: MediaType=archive"
+*FoomaticRIPOptionSetting MediaType=archive: "-m12 "
+*MediaType bond/Bond: "%% FoomaticRIPOptionSetting: MediaType=bond"
+*FoomaticRIPOptionSetting MediaType=bond: "-m3 "
+*MediaType card/Card Stock: "%% FoomaticRIPOptionSetting: MediaType=card"
+*FoomaticRIPOptionSetting MediaType=card: "-m5 "
+*MediaType color/Color Paper: "%% FoomaticRIPOptionSetting: MediaType=color"
+*FoomaticRIPOptionSetting MediaType=color: "-m4 "
+*MediaType cotton/Cotton: "%% FoomaticRIPOptionSetting: MediaType=cotton"
+*FoomaticRIPOptionSetting MediaType=cotton: "-m9 "
+*MediaType envelope/Envelope: "%% FoomaticRIPOptionSetting: MediaType=envelope"
+*FoomaticRIPOptionSetting MediaType=envelope: "-m7 "
+*MediaType labels/Labels: "%% FoomaticRIPOptionSetting: MediaType=labels"
+*FoomaticRIPOptionSetting MediaType=labels: "-m6 "
+*MediaType preprinted/Preprinted: "%% FoomaticRIPOptionSetting: MediaType=preprinted"
+*FoomaticRIPOptionSetting MediaType=preprinted: "-m8 "
+*MediaType recycled/Recycled Paper: "%% FoomaticRIPOptionSetting: MediaType=recycled"
+*FoomaticRIPOptionSetting MediaType=recycled: "-m10 "
+*MediaType thick/Thick Stock: "%% FoomaticRIPOptionSetting: MediaType=thick"
+*FoomaticRIPOptionSetting MediaType=thick: "-m1 "
+*MediaType thin/Thin Stock: "%% FoomaticRIPOptionSetting: MediaType=thin"
+*FoomaticRIPOptionSetting MediaType=thin: "-m2 "
+*MediaType transparency/Transparency: "%% FoomaticRIPOptionSetting: MediaType=transparency"
+*FoomaticRIPOptionSetting MediaType=transparency: "-m11 "
+*CloseUI: *MediaType
+
+*OpenUI *Duplex/Duplex Printing: PickOne
+*FoomaticRIPOption Duplex: enum CmdLine A
+*OrderDependency: 210 AnySetup *Duplex
+*DefaultDuplex: None
+*Duplex DuplexNoTumble/Long Edge (Standard): "%% FoomaticRIPOptionSetting: Duplex=DuplexNoTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexNoTumble: "-d4 "
+*Duplex DuplexTumble/Short Edge (Flip): "%% FoomaticRIPOptionSetting: Duplex=DuplexTumble"
+*FoomaticRIPOptionSetting Duplex=DuplexTumble: "-d5 "
+*Duplex None/Off: "%% FoomaticRIPOptionSetting: Duplex=None"
+*FoomaticRIPOptionSetting Duplex=None: "-d1 "
+*CloseUI: *Duplex
+
+*OpenUI *Copies/Copies: PickOne
+*FoomaticRIPOption Copies: int CmdLine A
+*FoomaticRIPOptionPrototype Copies: "-n%s "
+*FoomaticRIPOptionRange Copies: 1 100
+*OrderDependency: 220 AnySetup *Copies
+*DefaultCopies: 1
+*FoomaticRIPDefaultCopies: 1
+*Copies 1/1: "%% FoomaticRIPOptionSetting: Copies=1"
+*Copies 2/2: "%% FoomaticRIPOptionSetting: Copies=2"
+*Copies 3/3: "%% FoomaticRIPOptionSetting: Copies=3"
+*Copies 4/4: "%% FoomaticRIPOptionSetting: Copies=4"
+*Copies 5/5: "%% FoomaticRIPOptionSetting: Copies=5"
+*Copies 6/6: "%% FoomaticRIPOptionSetting: Copies=6"
+*Copies 7/7: "%% FoomaticRIPOptionSetting: Copies=7"
+*Copies 8/8: "%% FoomaticRIPOptionSetting: Copies=8"
+*Copies 9/9: "%% FoomaticRIPOptionSetting: Copies=9"
+*Copies 10/10: "%% FoomaticRIPOptionSetting: Copies=10"
+*Copies 11/11: "%% FoomaticRIPOptionSetting: Copies=11"
+*Copies 12/12: "%% FoomaticRIPOptionSetting: Copies=12"
+*Copies 13/13: "%% FoomaticRIPOptionSetting: Copies=13"
+*Copies 14/14: "%% FoomaticRIPOptionSetting: Copies=14"
+*Copies 15/15: "%% FoomaticRIPOptionSetting: Copies=15"
+*Copies 16/16: "%% FoomaticRIPOptionSetting: Copies=16"
+*Copies 17/17: "%% FoomaticRIPOptionSetting: Copies=17"
+*Copies 18/18: "%% FoomaticRIPOptionSetting: Copies=18"
+*Copies 19/19: "%% FoomaticRIPOptionSetting: Copies=19"
+*Copies 20/20: "%% FoomaticRIPOptionSetting: Copies=20"
+*Copies 21/21: "%% FoomaticRIPOptionSetting: Copies=21"
+*Copies 22/22: "%% FoomaticRIPOptionSetting: Copies=22"
+*Copies 23/23: "%% FoomaticRIPOptionSetting: Copies=23"
+*Copies 24/24: "%% FoomaticRIPOptionSetting: Copies=24"
+*Copies 25/25: "%% FoomaticRIPOptionSetting: Copies=25"
+*Copies 26/26: "%% FoomaticRIPOptionSetting: Copies=26"
+*Copies 27/27: "%% FoomaticRIPOptionSetting: Copies=27"
+*Copies 28/28: "%% FoomaticRIPOptionSetting: Copies=28"
+*Copies 29/29: "%% FoomaticRIPOptionSetting: Copies=29"
+*Copies 30/30: "%% FoomaticRIPOptionSetting: Copies=30"
+*Copies 31/31: "%% FoomaticRIPOptionSetting: Copies=31"
+*Copies 32/32: "%% FoomaticRIPOptionSetting: Copies=32"
+*Copies 33/33: "%% FoomaticRIPOptionSetting: Copies=33"
+*Copies 34/34: "%% FoomaticRIPOptionSetting: Copies=34"
+*Copies 35/35: "%% FoomaticRIPOptionSetting: Copies=35"
+*Copies 36/36: "%% FoomaticRIPOptionSetting: Copies=36"
+*Copies 37/37: "%% FoomaticRIPOptionSetting: Copies=37"
+*Copies 38/38: "%% FoomaticRIPOptionSetting: Copies=38"
+*Copies 39/39: "%% FoomaticRIPOptionSetting: Copies=39"
+*Copies 40/40: "%% FoomaticRIPOptionSetting: Copies=40"
+*Copies 41/41: "%% FoomaticRIPOptionSetting: Copies=41"
+*Copies 42/42: "%% FoomaticRIPOptionSetting: Copies=42"
+*Copies 43/43: "%% FoomaticRIPOptionSetting: Copies=43"
+*Copies 44/44: "%% FoomaticRIPOptionSetting: Copies=44"
+*Copies 45/45: "%% FoomaticRIPOptionSetting: Copies=45"
+*Copies 46/46: "%% FoomaticRIPOptionSetting: Copies=46"
+*Copies 47/47: "%% FoomaticRIPOptionSetting: Copies=47"
+*Copies 48/48: "%% FoomaticRIPOptionSetting: Copies=48"
+*Copies 49/49: "%% FoomaticRIPOptionSetting: Copies=49"
+*Copies 50/50: "%% FoomaticRIPOptionSetting: Copies=50"
+*Copies 51/51: "%% FoomaticRIPOptionSetting: Copies=51"
+*Copies 52/52: "%% FoomaticRIPOptionSetting: Copies=52"
+*Copies 53/53: "%% FoomaticRIPOptionSetting: Copies=53"
+*Copies 54/54: "%% FoomaticRIPOptionSetting: Copies=54"
+*Copies 55/55: "%% FoomaticRIPOptionSetting: Copies=55"
+*Copies 56/56: "%% FoomaticRIPOptionSetting: Copies=56"
+*Copies 57/57: "%% FoomaticRIPOptionSetting: Copies=57"
+*Copies 58/58: "%% FoomaticRIPOptionSetting: Copies=58"
+*Copies 59/59: "%% FoomaticRIPOptionSetting: Copies=59"
+*Copies 60/60: "%% FoomaticRIPOptionSetting: Copies=60"
+*Copies 61/61: "%% FoomaticRIPOptionSetting: Copies=61"
+*Copies 62/62: "%% FoomaticRIPOptionSetting: Copies=62"
+*Copies 63/63: "%% FoomaticRIPOptionSetting: Copies=63"
+*Copies 64/64: "%% FoomaticRIPOptionSetting: Copies=64"
+*Copies 65/65: "%% FoomaticRIPOptionSetting: Copies=65"
+*Copies 66/66: "%% FoomaticRIPOptionSetting: Copies=66"
+*Copies 67/67: "%% FoomaticRIPOptionSetting: Copies=67"
+*Copies 68/68: "%% FoomaticRIPOptionSetting: Copies=68"
+*Copies 69/69: "%% FoomaticRIPOptionSetting: Copies=69"
+*Copies 70/70: "%% FoomaticRIPOptionSetting: Copies=70"
+*Copies 71/71: "%% FoomaticRIPOptionSetting: Copies=71"
+*Copies 72/72: "%% FoomaticRIPOptionSetting: Copies=72"
+*Copies 73/73: "%% FoomaticRIPOptionSetting: Copies=73"
+*Copies 74/74: "%% FoomaticRIPOptionSetting: Copies=74"
+*Copies 75/75: "%% FoomaticRIPOptionSetting: Copies=75"
+*Copies 76/76: "%% FoomaticRIPOptionSetting: Copies=76"
+*Copies 77/77: "%% FoomaticRIPOptionSetting: Copies=77"
+*Copies 78/78: "%% FoomaticRIPOptionSetting: Copies=78"
+*Copies 79/79: "%% FoomaticRIPOptionSetting: Copies=79"
+*Copies 80/80: "%% FoomaticRIPOptionSetting: Copies=80"
+*Copies 81/81: "%% FoomaticRIPOptionSetting: Copies=81"
+*Copies 82/82: "%% FoomaticRIPOptionSetting: Copies=82"
+*Copies 83/83: "%% FoomaticRIPOptionSetting: Copies=83"
+*Copies 84/84: "%% FoomaticRIPOptionSetting: Copies=84"
+*Copies 85/85: "%% FoomaticRIPOptionSetting: Copies=85"
+*Copies 86/86: "%% FoomaticRIPOptionSetting: Copies=86"
+*Copies 87/87: "%% FoomaticRIPOptionSetting: Copies=87"
+*Copies 88/88: "%% FoomaticRIPOptionSetting: Copies=88"
+*Copies 89/89: "%% FoomaticRIPOptionSetting: Copies=89"
+*Copies 90/90: "%% FoomaticRIPOptionSetting: Copies=90"
+*Copies 91/91: "%% FoomaticRIPOptionSetting: Copies=91"
+*Copies 92/92: "%% FoomaticRIPOptionSetting: Copies=92"
+*Copies 93/93: "%% FoomaticRIPOptionSetting: Copies=93"
+*Copies 94/94: "%% FoomaticRIPOptionSetting: Copies=94"
+*Copies 95/95: "%% FoomaticRIPOptionSetting: Copies=95"
+*Copies 96/96: "%% FoomaticRIPOptionSetting: Copies=96"
+*Copies 97/97: "%% FoomaticRIPOptionSetting: Copies=97"
+*Copies 98/98: "%% FoomaticRIPOptionSetting: Copies=98"
+*Copies 99/99: "%% FoomaticRIPOptionSetting: Copies=99"
+*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
+*CloseUI: *Copies
+
+*CloseGroup: General
+
+*OpenGroup: Adjustment/Adjustment
+
+*OpenUI *ICM/ICM Color Profile: PickOne
+*FoomaticRIPOption ICM: enum CmdLine A
+*OrderDependency: 300 AnySetup *ICM
+*DefaultICM: clp3175
+*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
+*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
+*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
+*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
+*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
+*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
+*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
+*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
+*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
+*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
+*CloseUI: *ICM
+
+*CloseGroup: Adjustment
+
+*OpenGroup: Miscellaneous/Miscellaneous
+
+*OpenUI *Nup/N-up Printing: PickOne
+*FoomaticRIPOption Nup: enum CmdLine A
+*OrderDependency: 200 AnySetup *Nup
+*DefaultNup: 1up
+*Nup 1up/1-up: "%% FoomaticRIPOptionSetting: Nup=1up"
+*FoomaticRIPOptionSetting Nup=1up: " "
+*Nup 2up/2-up: "%% FoomaticRIPOptionSetting: Nup=2up"
+*FoomaticRIPOptionSetting Nup=2up: "-2 "
+*Nup 3up/3-up: "%% FoomaticRIPOptionSetting: Nup=3up"
+*FoomaticRIPOptionSetting Nup=3up: "-3 "
+*Nup 4up/4-up: "%% FoomaticRIPOptionSetting: Nup=4up"
+*FoomaticRIPOptionSetting Nup=4up: "-4 "
+*Nup 6up/6-up: "%% FoomaticRIPOptionSetting: Nup=6up"
+*FoomaticRIPOptionSetting Nup=6up: "-6 "
+*Nup 8up/8-up: "%% FoomaticRIPOptionSetting: Nup=8up"
+*FoomaticRIPOptionSetting Nup=8up: "-8 "
+*Nup 10up/10-up: "%% FoomaticRIPOptionSetting: Nup=10up"
+*FoomaticRIPOptionSetting Nup=10up: "-10 "
+*Nup 12up/12-up: "%% FoomaticRIPOptionSetting: Nup=12up"
+*FoomaticRIPOptionSetting Nup=12up: "-12 "
+*Nup 14up/14-up: "%% FoomaticRIPOptionSetting: Nup=14up"
+*FoomaticRIPOptionSetting Nup=14up: "-14 "
+*Nup 15up/15-up: "%% FoomaticRIPOptionSetting: Nup=15up"
+*FoomaticRIPOptionSetting Nup=15up: "-15 "
+*Nup 16up/16-up: "%% FoomaticRIPOptionSetting: Nup=16up"
+*FoomaticRIPOptionSetting Nup=16up: "-16 "
+*Nup 18up/18-up: "%% FoomaticRIPOptionSetting: Nup=18up"
+*FoomaticRIPOptionSetting Nup=18up: "-18 "
+*CloseUI: *Nup
+
+*OpenUI *NupOrient/N-up Orientation: PickOne
+*FoomaticRIPOption NupOrient: enum CmdLine A
+*OrderDependency: 200 AnySetup *NupOrient
+*DefaultNupOrient: port
+*NupOrient land/Landscape: "%% FoomaticRIPOptionSetting: NupOrient=land"
+*FoomaticRIPOptionSetting NupOrient=land: "-ol "
+*NupOrient port/Portrait: "%% FoomaticRIPOptionSetting: NupOrient=port"
+*FoomaticRIPOptionSetting NupOrient=port: " "
+*NupOrient sea/Seascape: "%% FoomaticRIPOptionSetting: NupOrient=sea"
+*FoomaticRIPOptionSetting NupOrient=sea: "-os "
+*CloseUI: *NupOrient
+
+*CloseGroup: Miscellaneous
+
+
+*% Generic boilerplate PPD stuff as standard PostScript fonts and so on
+
+*DefaultFont: Courier
+*Font AvantGarde-Book: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-BookOblique: Standard "(001.006S)" Standard ROM
+*Font AvantGarde-Demi: Standard "(001.007S)" Standard ROM
+*Font AvantGarde-DemiOblique: Standard "(001.007S)" Standard ROM
+*Font Bookman-Demi: Standard "(001.004S)" Standard ROM
+*Font Bookman-DemiItalic: Standard "(001.004S)" Standard ROM
+*Font Bookman-Light: Standard "(001.004S)" Standard ROM
+*Font Bookman-LightItalic: Standard "(001.004S)" Standard ROM
+*Font Courier: Standard "(002.004S)" Standard ROM
+*Font Courier-Bold: Standard "(002.004S)" Standard ROM
+*Font Courier-BoldOblique: Standard "(002.004S)" Standard ROM
+*Font Courier-Oblique: Standard "(002.004S)" Standard ROM
+*Font Helvetica: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Narrow-Bold: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-BoldOblique: Standard "(001.007S)" Standard ROM
+*Font Helvetica-Narrow-Oblique: Standard "(001.006S)" Standard ROM
+*Font Helvetica-Oblique: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Bold: Standard "(001.009S)" Standard ROM
+*Font NewCenturySchlbk-BoldItalic: Standard "(001.007S)" Standard ROM
+*Font NewCenturySchlbk-Italic: Standard "(001.006S)" Standard ROM
+*Font NewCenturySchlbk-Roman: Standard "(001.007S)" Standard ROM
+*Font Palatino-Bold: Standard "(001.005S)" Standard ROM
+*Font Palatino-BoldItalic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Italic: Standard "(001.005S)" Standard ROM
+*Font Palatino-Roman: Standard "(001.005S)" Standard ROM
+*Font Symbol: Special "(001.007S)" Special ROM
+*Font Times-Bold: Standard "(001.007S)" Standard ROM
+*Font Times-BoldItalic: Standard "(001.009S)" Standard ROM
+*Font Times-Italic: Standard "(001.007S)" Standard ROM
+*Font Times-Roman: Standard "(001.007S)" Standard ROM
+*Font ZapfChancery-MediumItalic: Standard "(001.007S)" Standard ROM
+*Font ZapfDingbats: Special "(001.004S)" Standard ROM
+
diff --git a/PPD/Xerox-Phaser-6110.ppd b/PPD/Xerox-Phaser_6110.ppd
index 3ad90c2..b7c19a7 100644
--- a/PPD/Xerox-Phaser-6110.ppd
+++ b/PPD/Xerox-Phaser_6110.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
-*1284DeviceID: "MFG:Xerox;MDL:Phaser 6110;CMD:SPLC;"
+*1284DeviceID: "MFG:Xerox;MDL:Phaser 6110;CMD:SPLC;DRV:Dfoo2qpdl,R1,M0,TF;"
+*driverName foo2qpdl/foo2qpdl: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2qpdl.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 9 12.00 9 12
+
+
+*HWMargins: 9 12.00 9 +12.00
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -71,11 +77,46 @@
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0
-*FoomaticIDs: Xerox-Phaser-6110 foo2qpdl
+*FoomaticIDs: Xerox-Phaser_6110 foo2qpdl
*FoomaticRIPCommandLine: "foo2qpdl-wrapper %A"
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=z0: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
+*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -165,8 +206,10 @@
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Auto
-*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
+*InputSlot Tray1/Upper / Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s4 "
+*InputSlot Tray2/Lower / Tray 2: "%% FoomaticRIPOptionSetting: InputSlot=Tray2"
+*FoomaticRIPOptionSetting InputSlot=Tray2: "-s5 "
*InputSlot Auto/Auto Select: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s1 "
*InputSlot Manual/Manual Select: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
@@ -219,38 +262,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 1200x1200dpi/1200x1200 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x1200dpi"
-*FoomaticRIPOptionSetting Resolution=1200x1200dpi: "-r1200x1200 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode Color/Color: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -370,14 +381,26 @@
*DefaultICM: ph6110
*ICM clp300/CLP-300: "%% FoomaticRIPOptionSetting: ICM=clp300"
*FoomaticRIPOptionSetting ICM=clp300: "-C10 -Gsamclp300-0.icm "
+*ICM clp315/CLP-315: "%% FoomaticRIPOptionSetting: ICM=clp315"
+*FoomaticRIPOptionSetting ICM=clp315: "-C10 -Gsamclp315-argyll-0.icm "
*ICM clp600/CLP-600: "%% FoomaticRIPOptionSetting: ICM=clp600"
*FoomaticRIPOptionSetting ICM=clp600: "-z1 "
+*ICM clp610/CLP-610: "%% FoomaticRIPOptionSetting: ICM=clp610"
+*FoomaticRIPOptionSetting ICM=clp610: "-z2 "
+*ICM clp3175/CLP-3175: "%% FoomaticRIPOptionSetting: ICM=clp3175"
+*FoomaticRIPOptionSetting ICM=clp3175: "-C10 -Gsamclp315-argyll-0.icm &&
+"
+*End
+*ICM clx2160/CLX-2160: "%% FoomaticRIPOptionSetting: ICM=clx2160"
+*FoomaticRIPOptionSetting ICM=clx2160: "-C10 -Gsamclp300-0.icm "
*ICM clx3160/CLX-3160: "%% FoomaticRIPOptionSetting: ICM=clx3160"
*FoomaticRIPOptionSetting ICM=clx3160: "-C10 -Gsamclp300-0.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-C10 -Gnone.icm "
*ICM ph6110/Phaser 6110: "%% FoomaticRIPOptionSetting: ICM=ph6110"
*FoomaticRIPOptionSetting ICM=ph6110: "-C10 -Gsamclp300-0.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-C10 -Gtesting.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/PPD/Xerox-Phaser-6115MFP.ppd b/PPD/Xerox-Phaser_6115MFP.ppd
index 3373e10..907ed60 100644
--- a/PPD/Xerox-Phaser-6115MFP.ppd
+++ b/PPD/Xerox-Phaser_6115MFP.ppd
@@ -1,7 +1,7 @@
*PPD-Adobe: "4.3"
*%
*% For information on using this, and to obtain the required backend
-*% script, consult http://www.linuxprinting.org/
+*% script, consult http://www.openprinting.org/
*%
*% This file is published under the GNU General Public License
*%
@@ -52,11 +52,17 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
+*1284DeviceID: "DRV:Dfoo2lava,R0,M0,TF;"
+*driverName foo2lava/foo2lava: ""
+*driverType F/Filter: ""
+*driverUrl: "http://foo2lava.rkkda.com/"
+*driverObsolete: False
-*HWMargins: 11.34 11.34 11.34 11.34
+
+*HWMargins: 11.34 11.34 +11.34 +11.34
*VariablePaperSize: True
*MaxMediaWidth: 100000
*MaxMediaHeight: 100000
@@ -71,11 +77,54 @@
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0
-*FoomaticIDs: Xerox-Phaser-6115MFP foo2lava
+*FoomaticIDs: Xerox-Phaser_6115MFP foo2lava
*FoomaticRIPCommandLine: "foo2lava-wrapper %A"
*OpenGroup: General/General
+*OpenUI *Quality/Printing Quality: PickOne
+*FoomaticRIPOption Quality: enum CmdLine A
+*OrderDependency: 110 AnySetup *Quality
+*DefaultQuality: normal
+*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
+*FoomaticRIPOptionSetting Quality=draft: " -t "
+*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
+*FoomaticRIPOptionSetting Quality=normal: " "
+*CloseUI: *Quality
+
+*FoomaticRIPOption PrinterType: enum CmdLine A 110
+*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
+
+*OpenUI *ColorMode/Color Mode: PickOne
+*FoomaticRIPOption ColorMode: enum CmdLine A
+*OrderDependency: 120 AnySetup *ColorMode
+*DefaultColorMode: Monochrome
+*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
+*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
+*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
+*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
+*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
+*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
+*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
+*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
+*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
+*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
+*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
+*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
+*CloseUI: *ColorMode
+
+*OpenUI *Resolution/Resolution: PickOne
+*FoomaticRIPOption Resolution: enum CmdLine A
+*OrderDependency: 130 AnySetup *Resolution
+*DefaultResolution: 1200x600dpi
+*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
+*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
+*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
+*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
+*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
+*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
+*CloseUI: *Resolution
+
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 135 AnySetup *PageSize
@@ -209,46 +258,6 @@
*FoomaticRIPOptionSetting Duplex=None: "-d1 "
*CloseUI: *Duplex
-*OpenUI *Resolution/Resolution: PickOne
-*FoomaticRIPOption Resolution: enum CmdLine A
-*OrderDependency: 130 AnySetup *Resolution
-*DefaultResolution: 1200x600dpi
-*Resolution 600x600dpi/600x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=600x600dpi"
-*FoomaticRIPOptionSetting Resolution=600x600dpi: "-r600x600 "
-*Resolution 1200x600dpi/1200x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=1200x600dpi"
-*FoomaticRIPOptionSetting Resolution=1200x600dpi: "-r1200x600 "
-*Resolution 2400x600dpi/2400x600 dpi: "%% FoomaticRIPOptionSetting: Resolution=2400x600dpi"
-*FoomaticRIPOptionSetting Resolution=2400x600dpi: "-r2400x600 "
-*CloseUI: *Resolution
-
-*OpenUI *Quality/Printing Quality: PickOne
-*FoomaticRIPOption Quality: enum CmdLine A
-*OrderDependency: 110 AnySetup *Quality
-*DefaultQuality: normal
-*Quality draft/Draft: "%% FoomaticRIPOptionSetting: Quality=draft"
-*FoomaticRIPOptionSetting Quality=draft: " -t "
-*Quality normal/Normal: "%% FoomaticRIPOptionSetting: Quality=normal"
-*FoomaticRIPOptionSetting Quality=normal: " "
-*CloseUI: *Quality
-
-*OpenUI *ColorMode/Color Mode: PickOne
-*FoomaticRIPOption ColorMode: enum CmdLine A
-*OrderDependency: 120 AnySetup *ColorMode
-*DefaultColorMode: Monochrome
-*ColorMode PhotoOnly/Color - Photo Only: "%% FoomaticRIPOptionSetting: ColorMode=PhotoOnly"
-*FoomaticRIPOptionSetting ColorMode=PhotoOnly: "-c -C1 "
-*ColorMode PhotosAndText/Color - Photos and Text: "%% FoomaticRIPOptionSetting: ColorMode=PhotosAndText"
-*FoomaticRIPOptionSetting ColorMode=PhotosAndText: "-c -C2 "
-*ColorMode Color/Color - Best Compromise: "%% FoomaticRIPOptionSetting: ColorMode=Color"
-*FoomaticRIPOptionSetting ColorMode=Color: "-c -C2 "
-*ColorMode GraphicsAndText/Color - Graphics and Text: "%% FoomaticRIPOptionSetting: ColorMode=GraphicsAndText"
-*FoomaticRIPOptionSetting ColorMode=GraphicsAndText: "-c -C3 "
-*ColorMode ICM/Color - use ICM color profile: "%% FoomaticRIPOptionSetting: ColorMode=ICM"
-*FoomaticRIPOptionSetting ColorMode=ICM: "-c -C10 "
-*ColorMode Monochrome/Monochrome: "%% FoomaticRIPOptionSetting: ColorMode=Monochrome"
-*FoomaticRIPOptionSetting ColorMode=Monochrome: " "
-*CloseUI: *ColorMode
-
*OpenUI *Copies/Copies: PickOne
*FoomaticRIPOption Copies: int CmdLine A
*FoomaticRIPOptionPrototype Copies: "-n%s "
@@ -358,9 +367,6 @@
*Copies 100/100: "%% FoomaticRIPOptionSetting: Copies=100"
*CloseUI: *Copies
-*FoomaticRIPOption PrinterType: enum CmdLine A 110
-*FoomaticRIPOptionSetting PrinterType=lavaflow: "-z0 "
-
*CloseGroup: General
*OpenGroup: Adjustment/Adjustment
@@ -368,15 +374,27 @@
*OpenUI *ICM/ICM Color Profile: PickOne
*FoomaticRIPOption ICM: enum CmdLine A
*OrderDependency: 300 AnySetup *ICM
-*DefaultICM: km2530_1
-*ICM km2530_0/km2530_0 - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
+*DefaultICM: km2530-jc
+*ICM km2530-jc/km2530-jconner-d50.icm (default): "%% FoomaticRIPOptionSetting: ICM=km2530-jc"
+*FoomaticRIPOptionSetting ICM=km2530-jc: "-Gkm2530-jconner-d50.icm "
+*ICM km2530_0/km2530_0.icm - Resolution 600: "%% FoomaticRIPOptionSetting: ICM=km2530_0"
*FoomaticRIPOptionSetting ICM=km2530_0: "-Gkm2530_0.icm "
-*ICM km2530_1/km2530_1 - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
+*ICM km2530_1/km2530_1.icm - Resolution 1200: "%% FoomaticRIPOptionSetting: ICM=km2530_1"
*FoomaticRIPOptionSetting ICM=km2530_1: "-Gkm2530_1.icm "
-*ICM km2530_2/km2530_2 - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
+*ICM km2530_2/km2530_2.icm - Resolution 2400: "%% FoomaticRIPOptionSetting: ICM=km2530_2"
*FoomaticRIPOptionSetting ICM=km2530_2: "-Gkm2530_2.icm "
*ICM none/No ICM color correction: "%% FoomaticRIPOptionSetting: ICM=none"
*FoomaticRIPOptionSetting ICM=none: "-Gnone.icm "
+*ICM testing/File testing.icm: "%% FoomaticRIPOptionSetting: ICM=testing"
+*FoomaticRIPOptionSetting ICM=testing: "-Gtesting.icm "
+*ICM user1/File user1.icm: "%% FoomaticRIPOptionSetting: ICM=user1"
+*FoomaticRIPOptionSetting ICM=user1: "-Guser1.icm "
+*ICM user2/File user2.icm: "%% FoomaticRIPOptionSetting: ICM=user2"
+*FoomaticRIPOptionSetting ICM=user2: "-Guser2.icm "
+*ICM user3/File user3.icm: "%% FoomaticRIPOptionSetting: ICM=user3"
+*FoomaticRIPOptionSetting ICM=user3: "-Guser3.icm "
+*ICM user4/File user4.icm: "%% FoomaticRIPOptionSetting: ICM=user4"
+*FoomaticRIPOptionSetting ICM=user4: "-Guser4.icm "
*CloseUI: *ICM
*CloseGroup: Adjustment
diff --git a/README b/README
index f44ff53..2b059fa 100644
--- a/README
+++ b/README
@@ -19,6 +19,7 @@ GENERAL
- Konica Minolta magicolor 2430 DL B/W and color
- Minolta/QMS 2300 DL B/W and color
- Minolta/QMS 2200 DL B/W and color
+ - HP LaserJet 1022 B/W
- HP LaserJet 1020 B/W
- HP LaserJet 1018 B/W
- HP LaserJet 1005 B/W
@@ -32,8 +33,23 @@ GENERAL
With foo2hp, you can print to some HP ZjStream printers, such as these:
+ - HP Color LaserJet CP1215 B/W and color
+ - HP Color LaserJet 1600 B/W and color
- HP Color LaserJet 2600n B/W and color
+ FOO2LAVA
+ --------
+ foo2lava converts Ghostscript pbmraw, bitcmyk, or pksmraw output for-
+ mats to monochrome or color LAVAFLOW or OPL streams, for driving the
+ Konica Minolta magicolor 2530 DL network color laser printer, the Kon-
+ ica Minolta magicolor 2480/2480 MF AIO printer, and other Zenographics-
+ based LAVAFLOW printers.
+
+ - Konica Minolta magicolor 2530 DL B/W and color
+ - Konica Minolta magicolor 2490 MF B/W and color
+ - Xerox Phaser 6115MFP B/W and color
+ - Konica Minolta magicolor 2480 MF B/W and color
+
FOO2OAK
-------
foo2oak converts pbm (B/W) images and 1-bit-per-pixel cmyk images
@@ -45,6 +61,41 @@ GENERAL
- HP LaserJet 1500 B/W and color, but only 1-bit per pixel
+ FOO2SLX
+ -------
+ foo2slx converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats
+ to monochrome or color SLX streams, for driving the Lexmark C500 net-
+ work color laser printer and other SLZ-based printers. The SLX stream
+ is a variant of ZjStream produced by Software Imaging K.K
+
+ - Lexmark C500n B/W and color
+
+ FOO2XQX
+ -------
+ foo2xqx converts Ghostscript pbmraw to monochrome XQX streams, for
+ driving the HP LaserJet M1005 MFP and other XQX-based printers
+
+ - HP LaserJet M1005 MFP
+ - HP LaserJet M1120 MFP
+ - HP LaserJet P1005
+ - HP LaserJet P1006
+ - HP LaserJet P1007
+ - HP LaserJet P1008
+ - HP LaserJet P1505/P1505n
+ - HP LaserJet P2014/P2014n
+
+ FOO2HIPERC
+ ----------
+ foo2hiperc converts Ghostscript pbmraw, bitcmyk, or pksmraw output for-
+ mats to monochrome or color HIPERC streams, for driving the Oki C3200,
+ C3300n, C3400n, C5100n, and the C5500n HIPERC printers.
+
+ - Oki C3200n
+ - Oki C3300n/C3400n
+ - Oki C3530n MFP
+ - Oki C5100n/C5200n
+ - Oki C5500n/C5600n/C5800n
+
Please read the manual pages for more details on the program operation.
$ acroread manual.pdf
@@ -72,8 +123,6 @@ BUGS AND DEFICIENCIES
implementation differences might result in incorrect printer behavior.
AUTHORS
- FOO2ZJS
- -------
The foo2zjs engine program began life as Robert Szalai's 'pbmtozjs'
program. It also uses Markus Kuhn's JBIG-KIT compression library
(included, but available at http://www.cl.cam.ac.uk/~mgk25/jbigkit/),
@@ -86,28 +135,13 @@ AUTHORS
Rick also contributed the zjsdecode program and the foomatic database
entries for the Minolta/QMS magicolor 2300 DL.
+ The foo2* engine was written entirely from scratch by Rick Richardson.
+
The latest version of foo2zjs can be found at:
http://foo2zjs.rkkda.com
wget http://foo2zjs.rkkda.com/foo2zjs.tar.gz
- FOO2HP
- -------
- The foo2hp engine was written entirely from scratch by Rick Richardson.
-
- The latest version of foo2hp can be found at:
-
- ${URLHP}
- wget ${URLHP}/foo2zjs.tar.gz
- FOO2OAK
- -------
- The foo2oak engine was written entirely from scratch by Rick Richardson.
-
- The latest version of foo2oak can be found at:
-
- http://foo2oak.rkkda.com
- wget http://foo2zjs.rkkda.com/foo2zjs.tar.gz
-
You can contact the current author at mailto://rick.richardson@comcast.net
I do not read or reply to HTML email or messages sent under an alias.
diff --git a/README.in b/README.in
index 11b1e20..b5ecf4a 100644
--- a/README.in
+++ b/README.in
@@ -19,6 +19,7 @@ GENERAL
- Konica Minolta magicolor 2430 DL B/W and color
- Minolta/QMS 2300 DL B/W and color
- Minolta/QMS 2200 DL B/W and color
+ - HP LaserJet 1022 B/W
- HP LaserJet 1020 B/W
- HP LaserJet 1018 B/W
- HP LaserJet 1005 B/W
@@ -32,8 +33,23 @@ GENERAL
With foo2hp, you can print to some HP ZjStream printers, such as these:
+ - HP Color LaserJet CP1215 B/W and color
+ - HP Color LaserJet 1600 B/W and color
- HP Color LaserJet 2600n B/W and color
+ FOO2LAVA
+ --------
+ foo2lava converts Ghostscript pbmraw, bitcmyk, or pksmraw output for-
+ mats to monochrome or color LAVAFLOW or OPL streams, for driving the
+ Konica Minolta magicolor 2530 DL network color laser printer, the Kon-
+ ica Minolta magicolor 2480/2480 MF AIO printer, and other Zenographics-
+ based LAVAFLOW printers.
+
+ - Konica Minolta magicolor 2530 DL B/W and color
+ - Konica Minolta magicolor 2490 MF B/W and color
+ - Xerox Phaser 6115MFP B/W and color
+ - Konica Minolta magicolor 2480 MF B/W and color
+
FOO2OAK
-------
foo2oak converts pbm (B/W) images and 1-bit-per-pixel cmyk images
@@ -45,6 +61,41 @@ GENERAL
- HP LaserJet 1500 B/W and color, but only 1-bit per pixel
+ FOO2SLX
+ -------
+ foo2slx converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats
+ to monochrome or color SLX streams, for driving the Lexmark C500 net-
+ work color laser printer and other SLZ-based printers. The SLX stream
+ is a variant of ZjStream produced by Software Imaging K.K
+
+ - Lexmark C500n B/W and color
+
+ FOO2XQX
+ -------
+ foo2xqx converts Ghostscript pbmraw to monochrome XQX streams, for
+ driving the HP LaserJet M1005 MFP and other XQX-based printers
+
+ - HP LaserJet M1005 MFP
+ - HP LaserJet M1120 MFP
+ - HP LaserJet P1005
+ - HP LaserJet P1006
+ - HP LaserJet P1007
+ - HP LaserJet P1008
+ - HP LaserJet P1505/P1505n
+ - HP LaserJet P2014/P2014n
+
+ FOO2HIPERC
+ ----------
+ foo2hiperc converts Ghostscript pbmraw, bitcmyk, or pksmraw output for-
+ mats to monochrome or color HIPERC streams, for driving the Oki C3200,
+ C3300n, C3400n, C5100n, and the C5500n HIPERC printers.
+
+ - Oki C3200n
+ - Oki C3300n/C3400n
+ - Oki C3530n MFP
+ - Oki C5100n/C5200n
+ - Oki C5500n/C5600n/C5800n
+
Please read the manual pages for more details on the program operation.
$ acroread manual.pdf
@@ -72,8 +123,6 @@ BUGS AND DEFICIENCIES
implementation differences might result in incorrect printer behavior.
AUTHORS
- FOO2ZJS
- -------
The foo2zjs engine program began life as Robert Szalai's 'pbmtozjs'
program. It also uses Markus Kuhn's JBIG-KIT compression library
(included, but available at http://www.cl.cam.ac.uk/~mgk25/jbigkit/),
@@ -86,28 +135,13 @@ AUTHORS
Rick also contributed the zjsdecode program and the foomatic database
entries for the Minolta/QMS magicolor 2300 DL.
+ The foo2* engine was written entirely from scratch by Rick Richardson.
+
The latest version of foo2zjs can be found at:
${URLZJS}
wget ${URLZJS}/foo2zjs.tar.gz
- FOO2HP
- -------
- The foo2hp engine was written entirely from scratch by Rick Richardson.
-
- The latest version of foo2hp can be found at:
-
- ${URLHP}
- wget ${URLHP}/foo2zjs.tar.gz
- FOO2OAK
- -------
- The foo2oak engine was written entirely from scratch by Rick Richardson.
-
- The latest version of foo2oak can be found at:
-
- ${URLOAK}
- wget ${URLZJS}/foo2zjs.tar.gz
-
You can contact the current author at mailto://rick.richardson@comcast.net
I do not read or reply to HTML email or messages sent under an alias.
diff --git a/arm2hpdl.1in b/arm2hpdl.1in
new file mode 100644
index 0000000..918784f
--- /dev/null
+++ b/arm2hpdl.1in
@@ -0,0 +1,44 @@
+.TH arm2hpdl 1 "${MODpage}" "arm2hpdl ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+arm2hpdl \- Add HP download header/trailer to an ARM ELF binary.
+.SH SYNOPSIS
+.B arm2hpdl
+.RI [ options "] arm-binary.img > hpdl.dl"
+.SH DESCRIPTION
+.B arm2hpdl
+adds an HP download header/trailer to an ARM ELF binary.
+If the file already has an HP header, just copy it to stdout.
+.SH COMMAND LINE OPTIONS
+These are the options that can appear on the command line.
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Add an HPDL header to a HP LaserJet 1005.
+
+.nf
+.ft CW
+$ arm2hpdl sihp1005.img > sihp1005.dl
+.ft P
+.fi
+
+.SH FILES
+.BR /usr/bin/arm2hpdl,
+.BR /usr/share/foo2*/firmware/
+.SH SEE ALSO
+.BR foo2zjs (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLZJS}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2hiperc-wrapper.1in b/foo2hiperc-wrapper.1in
new file mode 100644
index 0000000..2f83727
--- /dev/null
+++ b/foo2hiperc-wrapper.1in
@@ -0,0 +1,211 @@
+'\" t
+.TH foo2hiperc-wrapper 1 "${MODpage}" "foo2hiperc-wrapper ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+foo2hiperc-wrapper \- Convert Postscript into a HIPERC printer stream
+.SH SYNOPSIS
+.B foo2hiperc-wrapper
+.RI [ options "] [" ps-file ]
+.SH DESCRIPTION
+.B foo2hiperc-wrapper
+is a Foomatic compatible printer wrapper for the
+\fBfoo2hiperc\fP printer driver.
+This script reads a Postscript \fIps-file\fP or standard input
+and converts it to the Oki HIPERC printer format
+for driving the
+Oki C3100, C3200, C3300n, C3400n, C5100n, C5500n, C5600n and the C5800n
+HIPERC printers.
+.P
+This script can be used in a standalone fashion, but is intended to
+be called from a printer spooler system which uses the Foomatic
+printer database.
+
+.SH COMMAND LINE OPTIONS
+.SS Normal Options
+These are the options used to select the parameters of a
+print job that are usually controlled on a per job basis.
+.TP
+.BI \-c
+Print in color (else monochrome).
+.TP
+.BI \-C\0 colormode
+Color correction mode [0].
+.TS
+n l .
+10 ICM color profile (using -G *.icm file)
+.TE
+.TP
+.BI \-d\0 duplex
+Duplex code to send to printer [1].
+.TS
+| n l | n l | n l .
+1 off 2 long edge 3 short edge
+.TE
+.TP
+.BI \-m\0 media
+Media code to send to printer [0].
+.TS
+l l l
+l n n.
+_
+Media HIPERC
+_
+plain 0
+labels 1
+transparency 2
+.TE
+.TP
+.BI \-p\0 paper
+Paper size code to send to printer [2].
+.TS
+box;
+| n l | n l.
+1 A4 2 letter
+3 legal - -
+5 A5 6 B5jis
+7 A6 8 env Monarch
+9 env DL 10 env C5
+11 env #10 12 executive
+13 env #9 - -
+.TE
+.TP
+.BI \-n\0 copies
+Number of copies [1].
+.TP
+.BI \-r\0 xres x yres
+Set device resolution in pixels/inch [600x600].
+.TP
+.BI \-s\0 source
+Source (Input Slot) code to send to printer [0].
+.TS
+| n l | n l.
+0 auto select
+1 tray1 2 tray2
+3 multi 4 manual
+.TE
+.TP
+.BI \-t
+Draft mode. Every other pixel is white.
+.TP
+.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18"
+Print in N-up. Requires the \fBpsutils\fP package.
+.TP
+.BI \-o\0 orient
+Orientation used for N-up.
+.TS
+l l l.
+Portrait -op (normal)
+Landscape -ol (rotated 90 degrees anticlockwise)
+Seascape -os (rotated 90 degrees clockwise)
+.TE
+.SS Printer Tweaking Options
+These are the options used to customize the operation of \fBfoo2hiperc\fP
+for a particular printer.
+.TP
+.BI \-u\0 xoff x yoff
+Set the offset of the start of the printable region from the
+upper left corner, in pixels [varies with paper size].
+.TP
+.BI \-l\0 xoff x yoff
+Set the offset of the end of the printable region from the
+lower right corner, in pixels [varies with paper size].
+.TP
+.BI \-L\0 mask
+Send the logical clipping values from -u/-l in the HIPERC stream.
+\fBfoo2hiperc-wrapper\fP always runs Ghostscript with the ideal page dimensions,
+so that the scale of the image is correct,
+regardless whether or not the printer has unprintable regions.
+This option is used to move the position of the clipped image
+back to where it belongs on the page. The default is to send
+the amount which was clipped by -u and -l, and should be
+good in most cases.
+.TS
+l l.
+0 don't send any logical clipping amounts
+1 only send Y clipping amount
+2 only send X clipping amount
+3 send both X and Y clipping amounts
+.TE
+.TP
+.BI \-Z\0 compressed
+Use uncompressed (0) or compressed (1) JBIG data.
+.SS Color Tweaking Options
+These are the options used to control the quality of color output.
+Color correction is currently a WORK IN PROGRESS.
+.TP
+.BI \-g\0 gsopts
+Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq,
+etc. This option may appear more than once.
+.TP
+.BI \-G\0 profile.icm
+Convert \fIprofile.icm\fP to a Postscript color rendering
+dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and
+adjust the printer colors by using the Postscript \fBsetcolorrendering\fP
+operator. (WORK IN PROGRESS).
+.TP
+.BI \-G\0 gamma-file.ps
+Prepend \fIgamma-file.ps\fP to the Postscript input to perform
+color correction using the \fBsetcolortransfer\fP Postscript operator.
+For example, the file might contain:
+.br
+{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer
+.TP
+.BI \-I\0 intent
+Select profile intent from the ICM file.
+0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute.
+Default is 0 (perceptual).
+.SS Debugging Options
+These options are used for debugging \fBfoo2hiperc\fP and its wrapper.
+.TP
+.BI \-S\0 plane
+Output just a single color plane from a color print and print it
+on the black plane. The default is to output all color planes.
+.TS
+l l.
+1 Cyan
+2 Magenta
+3 Yellow
+4 Black
+.TE
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Create a monochrome HIPERC stream from a Postscript document,
+examine it, and then print it using nc(1) or netcat(1):
+
+.RS
+.nf
+foo2hiperc-wrapper testpage.ps > testpage.hc
+hipercdecode < testpage.hc
+nc 192.168.1.NNN 9100 < testpage.hc
+.fi
+.RE
+.P
+Create a color HIPERC stream from a Postscript document:
+
+.RS
+.nf
+foo2hiperc-wrapper -c testpage.ps > testpage.hc
+.fi
+.RE
+
+.SH FILES
+.BR /usr/bin/foo2hiperc-wrapper
+.SH SEE ALSO
+.BR foo2hiperc (1),
+.BR hipercdecode (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLHC}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2hiperc-wrapper.in b/foo2hiperc-wrapper.in
new file mode 100755
index 0000000..5fdb75d
--- /dev/null
+++ b/foo2hiperc-wrapper.in
@@ -0,0 +1,668 @@
+#!/bin/sh
+
+#* Copyright (C) 2003-2006 Rick Richardson
+#*
+#* This program is free software; you can redistribute it and/or modify
+#* it under the terms of the GNU General Public License as published by
+#* the Free Software Foundation; either version 2 of the License, or
+#* (at your option) any later version.
+#*
+#* This program is distributed in the hope that it will be useful,
+#* but WITHOUT ANY WARRANTY; without even the implied warranty of
+#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#* GNU General Public License for more details.
+#*
+#* You should have received a copy of the GNU General Public License
+#* along with this program; if not, write to the Free Software
+#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#*
+#* Authors: Rick Richardson <rick.richardson@comcast.net>
+
+VERSION='$Id: foo2hiperc-wrapper.in,v 1.13 2009/01/21 07:52:13 rick Exp $'
+
+#
+# Printer Notes:
+#
+# Oki Data C3100
+# Oki Data C3200
+# Oki Data C3300
+# Oki Data C3400
+# Oki Data C5100
+# Oki Data C5250
+# Oki Data C5500
+# Oki Data C5600
+# Oki Data C5800
+#
+
+PROGNAME="$0"
+BASENAME=`basename $PROGNAME`
+PREFIX=/usr
+SHARE=$PREFIX/share/foo2hiperc
+PATH=$PATH:/sw/bin:/opt/local/bin
+PATH=$PATH:.
+
+#
+# Log the command line, for debugging and problem reports
+#
+if [ -x /usr/bin/logger ]; then
+ logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
+fi
+
+usage() {
+ cat <<EOF
+Usage:
+ $BASENAME [options] [ps-file]
+
+ Foomatic printer wrapper for the foo2hiperc printer driver.
+ This script reads a Postscript ps-file or standard input
+ and converts it to a Oki Data HIPERC stream for the
+ C3100/C3200/C3250/C3400/C5100/C5250n/C5500/C5600/C5800 printers.
+
+Normal Options:
+-c Print in color (else monochrome)
+-C colormode Colormode [$COLORMODE]
+ 10=ICM color profile (using -G *.icm file)
+-d duplex Duplex code to send to printer [$DUPLEX]
+ 1=off, 2=longedge, 3=shortedge
+-m media Media code to send to printer [$MEDIA]
+ 0=plain 1=labels 2=transparency
+-p paper Paper code [$PAPER]
+ 1=A4, 2=letter, 3=legal, 5=A5, 6=B5, 7=A6, 8=envMonarch
+ 9=envDL, 10=envC5, 11=env#10, 12=executive, 13=env#9
+-n copies Number of copies [$COPIES]
+-r <xres>x<yres> Set device resolution in pixels/inch [$RES]
+-s source Source code to send to printer [$SOURCE]
+ 0=auto 1=tray1 2=tray2 3=multi 4=manual
+ Code numbers may vary with printer model.
+-t Draft mode. Every other pixel is white.
+-2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18
+ Print with N-up (requires psutils)
+-o orient For N-up: -op is portrait, -ol is landscape, -os is seascape.
+
+Printer Tweaking Options:
+-u <xoff>x<yoff> Set offset of upper left printable in pixels [varies]
+-l <xoff>x<yoff> Set offset of lower right printable in pixels [varies]
+-L mask Send logical clipping values from -u/-l in ZjStream [3]
+ 0=no, 1=Y, 2=X, 3=XY
+-P Do not output START_PLANE codes. May be needed by some
+ monochrome-only printers.
+-X padlen Add extra zero padding to the end of BID segments [16]
+-Z compressed Use uncompressed (0) or compressed (1) data [0]
+
+Color Tweaking Options:
+-g gsopts Additional options to pass to Ghostscript, such as
+ -dDITHERPPI=nnn, etc. May appear more than once. []
+-G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and
+ adjust colors using the setcolorrendering PS operator.
+ $SHARE/icm/ will be searched for profile.icm.
+-I intent Select profile intent from ICM file [$INTENT]
+ 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
+-G gamma-file.ps Prepend gamma-file to the Postscript input to perform
+ color correction using the setcolortransfer PS operator.
+
+Debugging Options:
+-S plane Output just a single color plane from a color print [all]
+ 1=Cyan, 2=Magenta, 3=Yellow, 4=Black
+-D lvl Set Debug level [$DEBUG]
+-V $VERSION
+EOF
+
+ exit 1
+}
+
+#
+# Report an error and exit
+#
+error() {
+ echo "$BASENAME: $1" >&2
+ exit 1
+}
+
+dbgcmd() {
+ if [ $DEBUG -ge 1 ]; then
+ echo "$@" >&2
+ fi
+ "$@"
+}
+
+#
+# N-up-ify the job. Requires psnup from psutils package
+#
+nup() {
+ case "$NUP" in
+ [2368]|1[0458])
+ tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q
+ ;;
+ [49]|1[26])
+ tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q
+ ;;
+ *)
+ error "Illegal call to nup()."
+ ;;
+ esac
+}
+
+#
+# Process the options
+#
+
+# Try to use a local copy of GhostScript 8.54, if available. Otherwise,
+# fallback to whatever the Linux distro has installed (usually 7.07)
+#
+# N.B. := operator used here, when :- would be better, because "ash"
+# doesn't have :-
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
+else
+ GSBIN=${GSBIN:-gs}
+fi
+
+CMDLINE="$*"
+DEBUG=0
+DUPLEX=1
+COLOR=
+COLORMODE=default
+MODEL=0
+QUALITY=1
+QUALITY=wts
+MEDIA=0
+COPIES=1
+PAPER=2
+RES=600x600
+SOURCE=0
+NUP=
+CLIP_UL=
+CLIP_LR=
+CLIP_LOG=
+BC=
+AIB=
+NOPLANES=
+COLOR2MONO=
+GAMMAFILE=default
+INTENT=0
+GSOPTS=
+EXTRAPAD=
+SAVETONER=
+NUP_ORIENT=
+COMPRESSED=
+GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+7*) DEFAULTCOLORMODE=10
+ DEFAULTCOLORMODE=10
+ ;;
+8.1*)
+ DEFAULTCOLORMODE=10
+ QUALITY=1
+ ;;
+*) DEFAULTCOLORMODE=10
+ ;;
+esac
+while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Z:Vh?" opt
+do
+ case $opt in
+ b) GSBIN="$OPTARG";;
+ c) COLOR=-c;;
+ d) DUPLEX="$OPTARG";;
+ g) GSOPTS="$GSOPTS $OPTARG";;
+ m) MEDIA="$OPTARG";;
+ n) COPIES="$OPTARG";;
+ p) PAPER="$OPTARG";;
+ q) QUALITY="$OPTARG";;
+ r) RES="$OPTARG";;
+ s) SOURCE="$OPTARG";;
+ t) SAVETONER="-t";;
+ z) MODEL="$OPTARG";;
+ l) CLIP_LR="-l $OPTARG";;
+ u) CLIP_UL="-u $OPTARG";;
+ L) CLIP_LOG="-L $OPTARG";;
+ A) AIB=-A;;
+ B) BC=-B;;
+ C) COLORMODE="$OPTARG";;
+ S) COLOR2MONO="-S$OPTARG";;
+ D) DEBUG="$OPTARG";;
+ G) GAMMAFILE="$OPTARG";;
+ I) INTENT="$OPTARG";;
+ P) NOPLANES=-P;;
+ X) EXTRAPAD="-X $OPTARG";;
+ Z) COMPRESSED="-Z $OPTARG";;
+ [234689]) NUP="$opt";;
+ [57]) error "Can't find acceptable layout for $opt-up";;
+ 1) case "$OPTARG" in
+ [024568]) NUP="1$OPTARG";;
+ *) error "Can't find acceptable layout for 1$OPTARG-up";;
+ esac
+ ;;
+ o) case "$OPTARG" in
+ l*) NUP_ORIENT=-l;;
+ s*) NUP_ORIENT=-r;;
+ p*|*) NUP_ORIENT=;;
+ esac;;
+ V) echo "$VERSION"; foo2hiperc -V; foo2zjs-pstops -V; exit 0;;
+ h|\?)
+ if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
+ echo "Illegal command:"
+ echo " $0 $CMDLINE"
+ echo
+ fi
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+#
+# If there is an argument left, take it as the file to print.
+# Else, the input comes from stdin.
+#
+if [ $# -ge 1 ]; then
+ if [ "$LPJOB" = "" ]; then
+ : # LPJOB="$1"
+ fi
+ exec < $1
+fi
+
+#
+case "$QUALITY" in
+0)
+ GSOPTS="-dCOLORSCREEN $GSOPTS"
+ ;;
+1)
+ GSOPTS="-dCOLORSCREEN $GSOPTS"
+ ;;
+2)
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
+ ;;
+esac
+
+#
+# Validate model code
+#
+case "$MODEL" in
+0|1) ;;
+*) error "Unknown model code $MODEL";;
+esac
+
+#
+# Validate media code
+#
+case "$MEDIA" in
+0|plain) MEDIA=0;;
+1|labels) MEDIA=1;;
+2|transparency) MEDIA=2;;
+[0-9]*) ;;
+*) error "Unknown media code $MEDIA";;
+esac
+
+#
+# Validate source (InputSlot) code
+#
+case "$SOURCE" in
+1|tray1) SOURCE=1;;
+2|tray2) SOURCE=2;;
+3|multi) SOURCE=3;;
+4|manual) SOURCE=4;;
+[0-9]*) ;;
+*) error "Unknown source code $SOURCE";;
+esac
+
+#
+# Validate Duplex code
+#
+case "$DUPLEX" in
+1|off|none) DUPLEX=1;;
+2|long*) DUPLEX=2;;
+3|short*) DUPLEX=3;;
+[0-9]*) ;;
+*) error "Unknown duplex code $DUPLEX";;
+esac
+
+#
+# Validate Resolution
+#
+case "$RES" in
+300x300) ;;
+600x600) ;;
+1200x600) ;;
+1200x1200) ;;
+600x1200) ;;
+*) error "Illegal resolution $RES";;
+esac
+
+#
+# Figure out the paper dimensions in pixels/inch, and set the
+# default clipping region. Unfortunately, this is a trouble
+# area for ZjStream printers. Various versions of ZjS print
+# engines react differently when asked to print into their
+# unprintable regions.
+#
+set_clipping() {
+ ulx=$1; uly=$2
+ lrx=$3; lry=$4
+
+ # Set clipping region if it isn't already set
+ if [ "$CLIP_UL" = "" ]; then
+ case "$RES" in
+ 300x300) ulx=`expr $ulx / 4`; uly=`expr $uly / 2`;;
+ 600x600) ulx=`expr $ulx / 2`;;
+ 600x1200) ulx=`expr $ulx / 2`; uly=`expr $uly \* 2`;;
+ 2400x600) ulx=`expr $ulx \* 2`;;
+ esac
+ CLIP_UL="-u ${ulx}x${uly}"
+ fi
+ if [ "$CLIP_LR" = "" ]; then
+ case "$RES" in
+ 300x300) lrx=`expr $lrx / 4`; lry=`expr $lry / 2`;;
+ 600x600) lrx=`expr $lrx / 2`;;
+ 600x1200) lrx=`expr $lrx / 2`; lry=`expr $lry \* 2`;;
+ 2400x600) lrx=`expr $lrx \* 2`;;
+ esac
+ CLIP_LR="-l ${lrx}x${lry}"
+ fi
+}
+
+case "$PAPER" in
+Custom*)
+ #%%BeginFeature: *CustomPageSize True
+ #216
+ #360
+ #0
+ #0
+ #0
+ #pop pop pop pop pop
+
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
+ cat >$TMPFILE
+ exec <$TMPFILE
+
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
+ ;;
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
+ ;;
+ esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
+ YDIM=`dc -e "$YDIM 600* 72/p"`
+ PAPER=21; paper=letter;
+ set_clipping 2 100 2 100
+ ;;
+1|a4|A4) PAPER=1; paper=a4; XDIM="9920"; YDIM="7016"
+ set_clipping 150 100 150 100
+ ;;
+2|letter) PAPER=2; paper=letter; XDIM="10200"; YDIM="6600"
+ set_clipping 150 100 150 100
+ ;;
+3|legal) PAPER=3; paper=legal; XDIM="10200"; YDIM="8400"
+ set_clipping 150 100 150 100
+ ;;
+5|a5|A5) PAPER=5; paper=a5; XDIM="6992"; YDIM="4960"
+ set_clipping 150 100 150 100
+ ;;
+6|b5jis|B5jis) PAPER=6; paper=b5; XDIM="8598"; YDIM="6070"
+ set_clipping 150 100 150 100
+ ;;
+7|a6|A6) PAPER=7; paper=a6; XDIM="4960"; YDIM="3496"
+ set_clipping 150 100 150 100
+ ;;
+8|envMonarch) PAPER=8; paper=envMonarch;XDIM="4650"; YDIM="4500"
+ set_clipping 150 100 150 100
+ ;;
+9|envDL) PAPER=9; paper=envDL; XDIM="5200"; YDIM="5200"
+ set_clipping 150 100 150 100
+ ;;
+10|envC5) PAPER=10; paper=envC5; XDIM="7650"; YDIM="5408"
+ set_clipping 150 100 150 100
+ ;;
+11|"env#10") PAPER=11; paper=env10; XDIM="4950"; YDIM="5700"
+ set_clipping 150 100 150 100
+ ;;
+12|executive) PAPER=12; paper=executive; XDIM="8700"; YDIM="6300"
+ set_clipping 150 100 150 100
+ ;;
+13|"env#9") PAPER=13; paper=env9; XDIM="4496"; YDIM="5324"
+ set_clipping 150 100 150 100
+ ;;
+*) error "Unimplemented paper code $PAPER";;
+esac
+# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps
+PAPERSIZE="-sPAPERSIZE=$paper";
+
+case "$RES" in
+300x300) XDIM=`expr $XDIM / 4`; YDIM=`expr $YDIM / 2`;;
+600x600) XDIM=`expr $XDIM / 2`;;
+1200x600) ;;
+1200x1200) YDIM=`expr $YDIM \* 2`;;
+600x1200) XDIM=`expr $XDIM / 2`; YDIM=`expr $YDIM \* 2`;;
+esac
+DIM="${XDIM}x${YDIM}"
+
+#
+# Filter thru psnup if N-up printing has been requested
+#
+case $NUP in
+[234689]|1[024568]) PREFILTER="nup";;
+*) PREFILTER=cat;;
+esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
+
+#
+# Overload -G. If the file name ends with ".icm" or ".ICM"
+# then convert the ICC color profile to a Postscript CRD,
+# then prepend it to the users job. Select the intent
+# using the -I option.
+#
+
+create_crd() {
+ #
+ # Create a Postscript CRD
+ #
+ ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
+ if [ -x $ICC2PS ]; then
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ ;;
+ *)
+ $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
+ || error "Problem converting .ICM file to Postscript"
+ ;;
+ esac
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
+ cat > $ICCTMP.usecie.ps <<-EOF
+ %!PS-Adobe-3.0
+ <</UseCIEColor true>>setpagedevice
+ EOF
+ if [ "$QUALITY" = wts ]; then
+ cat >> $ICCTMP.usecie.ps <<-EOF
+ << /UseWTS true >> setuserparams
+ <<
+ /AccurateScreens true
+ /HalftoneType 1
+ /HalftoneName (Round Dot Screen) cvn
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
+ /Frequency 137
+ /Angle 37
+ >> sethalftone
+ EOF
+ fi
+ cat > $ICCTMP.selcrd.ps <<-EOF
+ /Current /ColorRendering findresource setcolorrendering
+ EOF
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
+ *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
+ esac
+ else
+ GAMMFILE=
+ fi
+}
+
+if [ $DEBUG -gt 0 ]; then
+ ICCTMP=/tmp/icc
+else
+ ICCTMP=/tmp/icc$$
+fi
+
+if [ "" = "$COLOR" ]; then
+ COLORMODE=
+ GAMMAFILE=
+else
+ case "$COLORMODE" in
+ default) COLORMODE=$DEFAULTCOLORMODE;;
+ esac
+ case "$GAMMAFILE" in
+ default) GAMMAFILE=samclp300-0.icm;;
+ esac
+fi
+
+CRDBASE="$PREFIX/share/foo2hiperc/crd"
+case "$MODEL" in
+ 0) model=CLP-300;;
+ 1) model=CLP-600;;
+esac
+case "$RES" in
+ 600x600) SCREEN=$model-600x600cms2;;
+ 1200x600) SCREEN=$model-1200x600cms2;;
+ 1200x1200) SCREEN=$model-1200x1200cms2;;
+esac
+
+PSTOPS_OPTS="-n"
+
+case "$COLORMODE" in
+0|"")
+ # Monochrome
+ ;;
+10|icm)
+ # Use old ICM method
+ AIB=-A
+ BC=-B
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ create_crd
+ ;;
+ *.icm|*.ICM|*.icc|*.ICC)
+ #
+ # Its really an .ICM file, not a gamma file.
+ #
+ # The file can be a full path name, or the name of a file in $SHARE/icm/
+ #
+ if [ -r "$GAMMAFILE" ]; then
+ create_crd
+ elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
+ GAMMAFILE="$SHARE/icm/$GAMMAFILE"
+ create_crd
+ else
+ GAMMAFILE=
+ fi
+ ;;
+ esac
+ ;;
+1|crd)
+ # CRD
+ GAMMAFILE=""
+ GAMMAFILE="$GAMMAFILE $CRDBASE/${model}cms"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+*.crd)
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ if [ -f $COLORMODE ]; then
+ GAMMAFILE="$GAMMAFILE $COLORMODE"
+ elif [ -f $CRDBASE/$COLORMODE ]; then
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"
+ else
+ error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"
+ fi
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+*)
+ error "Unknown color method '$COLORMODE'"
+ ;;
+esac
+
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
+if [ "" != "$COLOR" ]; then
+ if [ "" = "$AIB" -a "" = "$BC" ]; then
+ # Faster, but can't handle AllIsBlack or BlackClears
+ GSDEV=-sDEVICE=pksmraw
+ else
+ # Can't handle different size pages
+ GSDEV=-sDEVICE=bitcmyk
+ fi
+fi
+
+#
+# Figure out USERNAME
+#
+if [ "$LPUSER" != "" ]; then
+ USER="$LPUSER@$LPHOST"
+else
+ USER=""
+fi
+
+#
+# Main Program, just cobble together the pipeline and run it
+#
+# The malarky with file descriptors 1 and 3 is to avoid a bug in
+# (some versions?) of Ghostscript where Postscript's stdout gets
+# intermingled with the printer drivers output, resulting in
+# corrupted image data.
+#
+GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+
+foo2zjs-pstops $PSTOPS_OPTS | \
+$PREFILTER \
+| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
+| foo2hiperc -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
+ $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
+ -J "$LPJOB" -U "$USER" \
+ $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD $COMPRESSED -D$DEBUG
+
+#
+# Log the command line, for debugging and problem reports
+#
+if [ -x /usr/bin/logger ]; then
+ logger -t "$BASENAME" -p lpr.info -- \
+ "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
+ logger -t "$BASENAME" -p lpr.info -- \
+ "foo2hiperc -r$RES -g$DIM -p$PAPER -m$MEDIA \
+-n$COPIES -d$DUPLEX -s$SOURCE $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
+$SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD $COMPRESSED"
+fi
+
+#
+# Remove cruft
+#
+if [ $DEBUG -eq 0 ]; then
+ for i in crd.ps log usecie.ps selcrd.ps
+ do
+ file="$ICCTMP.$i"
+ [ -f $file ] && rm -f $file
+ done
+ [ -f "$TMPFILE" ] && rm -f $TMPFILE
+ [ -f "$TMPFILE2" ] && rm -f $TMPFILE2
+fi
+
+exit 0
diff --git a/foo2hiperc.1in b/foo2hiperc.1in
new file mode 100644
index 0000000..ce611f3
--- /dev/null
+++ b/foo2hiperc.1in
@@ -0,0 +1,179 @@
+'\" t
+.TH foo2hiperc 1 "${MODpage}" "foo2hiperc ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+foo2hiperc \- Convert Ghostscript pbmraw or bitcmyk format into a
+HIPERC printer stream
+.SH SYNOPSIS
+.B foo2hiperc
+.RI [ options "] <" pbmraw-file " >" hiperc-file
+.sp 1
+.B foo2hiperc
+.RI [ options "] <" bitcmyk-file " >" hiperc-file
+.sp 1
+.B foo2hiperc
+.RI [ options "] <" pksmraw-file " >" hiperc-file
+.SH DESCRIPTION
+.B foo2hiperc
+converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome
+or color HIPERC streams,
+for driving the
+Oki C3100, C3200, C3300n, C3400n, C5100n, C5500n, C5600n, and the C5800n
+HIPERC printers.
+
+.SH COMMAND LINE OPTIONS
+.SS Normal Options
+These are the options used to select the parameters of a
+print job that are usually controlled on a per job basis.
+.TP
+.BI \-c
+Force color mode if autodetect doesn't work.
+.TP
+.BI \-d\0 duplex
+Duplex code to send to printer [1].
+.TS
+| n l | n l | n l .
+1 off 2 long edge 3 short edge
+.TE
+.TP
+.BI \-g\0 xpix x ypix
+Set page dimensions in pixels [5100x6600].
+.TP
+.BI \-m\0 media
+Media code to send to printer [0].
+.TS
+l l l
+l n n.
+_
+Media HIPERC
+_
+plain 0
+labels 1
+transparency 2
+.TE
+.TP
+.BI \-p\0 paper
+Paper code to send to printer [2].
+.TS
+box;
+| n l | n l.
+1 A4 2 letter
+3 legal - -
+5 A5 6 B5jis
+7 A6 8 env Monarch
+9 env DL 10 env C5
+11 env #10 12 executive
+13 env #9 - -
+.TE
+.TP
+.BI \-n\0 copies
+Number of copies [1].
+.TP
+.BI \-r\0 xres x yres
+Set device resolution in pixels/inch [600x600].
+.TP
+.BI \-s\0 source
+Source (InputSlot) code to send to printer [0].
+.TS
+| n l | n l.
+0 auto select
+1 tray1 2 tray2
+3 multi 4 manual
+.TE
+.TP
+.BI \-t
+Draft mode. Every other pixel is white.
+.TP
+.BI \-J\0 filename
+Filename string to send to printer.
+.TP
+.BI \-U\0 username
+Username string to send to printer.
+.SS Printer Tweaking Options
+These are the options used to customize the operation of \fBfoo2hiperc\fP
+for a particular printer.
+.TP
+.BI \-u\0 xoff x yoff
+Set the offset of the start of the printable region from the
+upper left corner, in pixels [0x0].
+.TP
+.BI \-l\0 xoff x yoff
+Set the offset of the end of the printable region from the
+lower right corner, in pixels [0x0].
+.TP
+.BI \-L\0 mask
+Send logical clipping amounts implied by -u/-l in the HIPERC stream [3].
+.TS
+l l.
+0 don't send any logical clipping amounts
+1 only send Y clipping amount
+2 only send X clipping amount
+3 send both X and Y clipping amounts
+.TE
+.TP
+.BI \-A
+AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only.
+.TP
+.BI \-B
+BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only.
+.TP
+.BI \-Z\0 compressed
+Use uncompressed (0) or compressed (1) JBIG data.
+.SS Debugging Options
+These options are used for debugging \fBfoo2hiperc\fP.
+.TP
+.BI \-S\0 plane
+Output just a single color plane from a color print and print it
+on the black plane. The default is to output all color planes.
+.TS
+l l.
+1 Cyan
+2 Magenta
+3 Yellow
+4 Black
+.TE
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Create a black and white HIPERC stream:
+
+.RS
+.nf
+gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \
+ -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \
+ -sOutputFile=- - < testpage.ps \
+| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zm
+.fi
+.RE
+.P
+Create a color HIPERC stream:
+
+.RS
+.nf
+gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \
+ -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \
+ -sOutputFile=- - < testpage.ps \
+| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zc
+.fi
+.RE
+
+.SH FILES
+.BR /usr/bin/foo2hiperc
+.SH SEE ALSO
+.BR foo2hiperc-wrapper (1),
+.BR hipercdecode (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.com>
+.br
+${URLHC}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2hiperc.c b/foo2hiperc.c
new file mode 100644
index 0000000..f718017
--- /dev/null
+++ b/foo2hiperc.c
@@ -0,0 +1,1695 @@
+/*
+
+GENERAL
+This program converts pbm (B/W) images and 1-bit-per-pixel cmyk images
+(both produced by ghostscript) to Zenographics ZJ-stream format. There
+is some information about the ZJS format at http://ddk.zeno.com.
+
+With this utility, you can print to some HP printers, such as these:
+ - Oki C3200, C3300n, C3400n, C5100n, C5500n
+
+AUTHORS
+This program began life as Robert Szalai's 'pbmtozjs' program. It
+also uses Markus Kuhn's jbig-kit compression library (included, but
+also available at http://www.cl.cam.ac.uk/~mgk25/jbigkit/).
+
+The program was overhauled by Rick Richardson to limit data chunk size
+to 65536 bytes, add command line options, add color support,
+and other miscellaneous features.
+
+You can contact the current author at mailto:rick.richardson@comcast.net
+
+LICENSE
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+If you want to use this program under different license conditions,
+then contact the author for an arrangement.
+
+It is possible that certain products which can be built using the jbig
+software module might form inventions protected by patent rights in
+some countries (e.g., by patents about arithmetic coding algorithms
+owned by IBM and AT&T in the USA). Provision of this software by the
+author does NOT include any licenses for any patents. In those
+countries where a patent license is required for certain applications
+of this software module, you will have to obtain such a license
+yourself.
+
+*/
+
+static char Version[] = "$Id: foo2hiperc.c,v 1.24 2008/12/29 23:19:20 rick Exp $";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <time.h>
+#ifdef linux
+ #include <sys/utsname.h>
+#endif
+#include "jbig.h"
+#include "hiperc.h"
+
+/*
+ * Command line options
+ */
+int Debug = 0;
+int ResX = 600;
+int ResY = 600;
+int Bpp = 1;
+int PaperCode = 2; //DMPAPER_LETTER;
+int PageWidth = 600 * 8.5;
+int PageHeight = 600 * 11;
+int UpperLeftX = 0;
+int UpperLeftY = 0;
+int LowerRightX = 0;
+int LowerRightY = 0;
+int Copies = 1;
+int Duplex = DMDUPLEX_OFF;
+int SourceCode = DMBIN_AUTO;
+int MediaCode = DMMEDIA_PLAIN;
+char *Username = NULL;
+char *Filename = NULL;
+int Mode = 1;
+ #define MODE_MONO 1
+ #define MODE_COLOR 2
+
+int Color2Mono = 0;
+int BlackClears = 0;
+int AllIsBlack = 0;
+int OutputStartPlane = 1;
+int ExtraPad = 16;
+
+int LogicalOffsetX = 0;
+int LogicalOffsetY = 0;
+
+#define LOGICAL_CLIP_X 2
+#define LOGICAL_CLIP_Y 1
+int LogicalClip = LOGICAL_CLIP_X | LOGICAL_CLIP_Y;
+int SaveToner = 0;
+int PageNum = 0;
+int RealWidth;
+int EconoMode = 0;
+int Compressed = 0;
+
+int IsCUPS = 0;
+
+FILE *EvenPages = NULL;
+typedef struct
+{
+ off_t b, e;
+} SEEKREC;
+SEEKREC SeekRec[2000];
+int SeekIndex = 0;
+
+long JbgOptions[5] =
+{
+ /* Order */
+ 0, //JBG_ILEAVE | JBG_SMID,
+ /* Options */
+ JBG_DELAY_AT | JBG_LRLTWO | JBG_TPBON,
+ /* L0 */
+ 256,
+ /* MX */
+ 16,
+ /* MY */
+ 0
+};
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" foo2hiperc [options] <pbmraw-file >hiperc-file\n"
+"\n"
+" Convert Ghostscript pbmraw format to a monochrome HIPERC stream,\n"
+" for driving the Oki C3100 to C5800 color laser printers.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2hiperc -r600x600 -g5100x6600 -p1 >testpage.zm\n"
+"\n"
+" foo2hiperc [options] <bitcmyk-file >hiperc-file\n"
+" foo2hiperc [options] <pksmraw-file >hiperc-file\n"
+"\n"
+" Convert Ghostscript bitcmyk or pksmraw format to a color HIPERC stream,\n"
+" for driving the Oki C3100 to C5800 color laser printers\n"
+" N.B. Color correction is expected to be performed by ghostscript.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2hiperc -r600x600 -g5100x6600 -p1 >testpage.zc\n"
+"\n"
+"Normal Options:\n"
+"-c Force color mode if autodetect doesn't work\n"
+"-d duplex Duplex code to send to printer [%d]\n"
+" 1=off, 2=longedge, 3=shortedge\n"
+"-g <xpix>x<ypix> Set page dimensions in pixels [%dx%d]\n"
+"-m media Media code to send to printer [%d]\n"
+" 0=plain 1=labels 2=transparency\n"
+"-p paper Paper code to send to printer [%d]\n"
+" 1=A4, 2=letter, 3=legal, 5=A5, 6=B5, 7=A6, 8=envMonarch\n"
+" 9=envDL, 10=envC5, 11=env#10, 12=executive, 13=env#9\n"
+"-n copies Number of copies [%d]\n"
+"-r <xres>x<yres> Set device resolution in pixels/inch [%dx%d]\n"
+"-s source Source code to send to printer [%d]\n"
+" 0=auto 1=tray1 2=tray2 3=multi 4=manual\n"
+" Code numbers may vary with printer model\n"
+"-t Draft mode. Every other pixel is white.\n"
+"-J filename Filename string to send to printer [%s]\n"
+"-U username Username string to send to printer [%s]\n"
+"\n"
+"Printer Tweaking Options:\n"
+"-u <xoff>x<yoff> Set offset of upper left printable in pixels [%dx%d]\n"
+"-l <xoff>x<yoff> Set offset of lower right printable in pixels [%dx%d]\n"
+"-L mask Send logical clipping values from -u/-l in ZjStream [%d]\n"
+" 0=no, 1=Y, 2=X, 3=XY\n"
+"-A AllIsBlack: convert C=1,M=1,Y=1 to just K=1\n"
+"-B BlackClears: K=1 forces C,M,Y to 0\n"
+" -A, -B work with bitcmyk input only\n"
+"-P Do not output START_PLANE codes. May be needed by some\n"
+" some black and white only printers.\n"
+"-X padlen Add extra zero padding to the end of BID segments [%d]\n"
+"-Z compressed Use uncompressed (0) or compressed (1) data [%d]\n"
+"\n"
+"Debugging Options:\n"
+"-S plane Output just a single color plane from a color print [all]\n"
+" 1=Cyan, 2=Magenta, 3=Yellow, 4=Black\n"
+"-D lvl Set Debug level [%d]\n"
+"-V Version %s\n"
+ , Duplex
+ , PageWidth , PageHeight
+ , MediaCode
+ , PaperCode
+ , Copies
+ , ResX , ResY
+ , SourceCode
+ , Filename ? Filename : ""
+ , Username ? Username : ""
+ , UpperLeftX , UpperLeftY
+ , LowerRightX , LowerRightY
+ , LogicalClip
+ , ExtraPad
+ , Compressed
+ , Debug
+ , Version
+ );
+
+ exit(1);
+}
+
+/*
+ * Mirror1: bits 01234567 become 76543210
+ */
+unsigned char Mirror1[256] =
+{
+ 0,128, 64,192, 32,160, 96,224, 16,144, 80,208, 48,176,112,240,
+ 8,136, 72,200, 40,168,104,232, 24,152, 88,216, 56,184,120,248,
+ 4,132, 68,196, 36,164,100,228, 20,148, 84,212, 52,180,116,244,
+ 12,140, 76,204, 44,172,108,236, 28,156, 92,220, 60,188,124,252,
+ 2,130, 66,194, 34,162, 98,226, 18,146, 82,210, 50,178,114,242,
+ 10,138, 74,202, 42,170,106,234, 26,154, 90,218, 58,186,122,250,
+ 6,134, 70,198, 38,166,102,230, 22,150, 86,214, 54,182,118,246,
+ 14,142, 78,206, 46,174,110,238, 30,158, 94,222, 62,190,126,254,
+ 1,129, 65,193, 33,161, 97,225, 17,145, 81,209, 49,177,113,241,
+ 9,137, 73,201, 41,169,105,233, 25,153, 89,217, 57,185,121,249,
+ 5,133, 69,197, 37,165,101,229, 21,149, 85,213, 53,181,117,245,
+ 13,141, 77,205, 45,173,109,237, 29,157, 93,221, 61,189,125,253,
+ 3,131, 67,195, 35,163, 99,227, 19,147, 83,211, 51,179,115,243,
+ 11,139, 75,203, 43,171,107,235, 27,155, 91,219, 59,187,123,251,
+ 7,135, 71,199, 39,167,103,231, 23,151, 87,215, 55,183,119,247,
+ 15,143, 79,207, 47,175,111,239, 31,159, 95,223, 63,191,127,255,
+};
+
+/*
+ * Mirror2: bits 01234567 become 67452301
+ */
+unsigned char Mirror2[256] =
+{
+ 0, 64,128,192, 16, 80,144,208, 32, 96,160,224, 48,112,176,240,
+ 4, 68,132,196, 20, 84,148,212, 36,100,164,228, 52,116,180,244,
+ 8, 72,136,200, 24, 88,152,216, 40,104,168,232, 56,120,184,248,
+ 12, 76,140,204, 28, 92,156,220, 44,108,172,236, 60,124,188,252,
+ 1, 65,129,193, 17, 81,145,209, 33, 97,161,225, 49,113,177,241,
+ 5, 69,133,197, 21, 85,149,213, 37,101,165,229, 53,117,181,245,
+ 9, 73,137,201, 25, 89,153,217, 41,105,169,233, 57,121,185,249,
+ 13, 77,141,205, 29, 93,157,221, 45,109,173,237, 61,125,189,253,
+ 2, 66,130,194, 18, 82,146,210, 34, 98,162,226, 50,114,178,242,
+ 6, 70,134,198, 22, 86,150,214, 38,102,166,230, 54,118,182,246,
+ 10, 74,138,202, 26, 90,154,218, 42,106,170,234, 58,122,186,250,
+ 14, 78,142,206, 30, 94,158,222, 46,110,174,238, 62,126,190,254,
+ 3, 67,131,195, 19, 83,147,211, 35, 99,163,227, 51,115,179,243,
+ 7, 71,135,199, 23, 87,151,215, 39,103,167,231, 55,119,183,247,
+ 11, 75,139,203, 27, 91,155,219, 43,107,171,235, 59,123,187,251,
+ 15, 79,143,207, 31, 95,159,223, 47,111,175,239, 63,127,191,255,
+};
+
+/*
+ * Mirror4: bits 01234567 become 45670123
+ */
+unsigned char Mirror4[256] =
+{
+ 0, 16, 32, 48, 64, 80, 96,112,128,144,160,176,192,208,224,240,
+ 1, 17, 33, 49, 65, 81, 97,113,129,145,161,177,193,209,225,241,
+ 2, 18, 34, 50, 66, 82, 98,114,130,146,162,178,194,210,226,242,
+ 3, 19, 35, 51, 67, 83, 99,115,131,147,163,179,195,211,227,243,
+ 4, 20, 36, 52, 68, 84,100,116,132,148,164,180,196,212,228,244,
+ 5, 21, 37, 53, 69, 85,101,117,133,149,165,181,197,213,229,245,
+ 6, 22, 38, 54, 70, 86,102,118,134,150,166,182,198,214,230,246,
+ 7, 23, 39, 55, 71, 87,103,119,135,151,167,183,199,215,231,247,
+ 8, 24, 40, 56, 72, 88,104,120,136,152,168,184,200,216,232,248,
+ 9, 25, 41, 57, 73, 89,105,121,137,153,169,185,201,217,233,249,
+ 10, 26, 42, 58, 74, 90,106,122,138,154,170,186,202,218,234,250,
+ 11, 27, 43, 59, 75, 91,107,123,139,155,171,187,203,219,235,251,
+ 12, 28, 44, 60, 76, 92,108,124,140,156,172,188,204,220,236,252,
+ 13, 29, 45, 61, 77, 93,109,125,141,157,173,189,205,221,237,253,
+ 14, 30, 46, 62, 78, 94,110,126,142,158,174,190,206,222,238,254,
+ 15, 31, 47, 63, 79, 95,111,127,143,159,175,191,207,223,239,255,
+};
+
+void
+rotate_bytes_180(unsigned char *sp, unsigned char *ep, unsigned char *mirror)
+{
+ unsigned char tmp;
+
+ while (sp < ep)
+ {
+ tmp = mirror[*sp];
+ *sp = mirror[*ep];
+ *ep = tmp;
+ ++sp;
+ --ep;
+ }
+ if (sp == ep)
+ *sp = mirror[*sp];
+}
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ setvbuf(stderr, (char *) NULL, _IOLBF, BUFSIZ);
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+void
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+
+ if (fatal)
+ exit(fatal);
+}
+
+/*
+ * A linked list of compressed data
+ */
+typedef struct _BIE_CHAIN{
+ unsigned char *data;
+ size_t len;
+ struct _BIE_CHAIN *next;
+} BIE_CHAIN;
+
+void
+free_chain(BIE_CHAIN *chain)
+{
+ BIE_CHAIN *next;
+ next = chain;
+ while ((chain = next))
+ {
+ next = chain->next;
+ if (chain->data)
+ free(chain->data);
+ free(chain);
+ }
+}
+
+/*
+ * This creates a linked list of compressed data. The first item
+ * in the list is the BIH and is always 20 bytes in size. Each following
+ * item is 65536 bytes in length. The last item length is whatever remains.
+ */
+void
+output_jbig(unsigned char *start, size_t len, void *cbarg)
+{
+ BIE_CHAIN *current, **root = (BIE_CHAIN **) cbarg;
+ int size = 0x80000; // Printer does strange things otherwise.
+
+ if ( (*root) == NULL)
+ {
+ (*root) = malloc(sizeof(BIE_CHAIN));
+ if (!(*root))
+ error(1, "Can't allocate space for chain\n");
+
+ (*root)->data = NULL;
+ (*root)->next = NULL;
+ (*root)->len = 0;
+ size = 20;
+ if (len != 20)
+ error(1, "First chunk must be BIH and 20 bytes long\n");
+ }
+
+ current = *root;
+ while (current->next)
+ current = current->next;
+
+ while (len > 0)
+ {
+ int amt, left;
+
+ if (!current->data)
+ {
+ current->data = malloc(size);
+ if (!current->data)
+ error(1, "Can't allocate space for compressed data\n");
+ }
+
+ left = size - current->len;
+ amt = (len > left) ? left : len;
+ memcpy(current->data + current->len, start, amt);
+ current->len += amt;
+ len -= amt;
+ start += amt;
+
+ if (current->len == size)
+ {
+ current->next = malloc(sizeof(BIE_CHAIN));
+ if (!current->next)
+ error(1, "Can't allocate space for chain\n");
+ current = current->next;
+ current->data = NULL;
+ current->next = NULL;
+ current->len = 0;
+ }
+ }
+}
+
+void
+start_page_compressed(int nbie, int w, int h, int plane, unsigned char *bih,
+ FILE *ofp)
+{
+ int h256 = ((h + 255) / 256) * 256;
+ DWORD rec[13];
+
+ rec[0] = be32(52); //reclen=52
+ rec[1] = be32(0); //rectype=0
+
+ rec[2] = be32(16); //block0: len=16
+ //rec[3] = be32( (1<<24) + (plane<<16) + (128<<8) + 17); //block0: data
+ if (ResX == 300)
+ rec[3] = be32( (nbie<<24) + (plane<<16) + (128<<8) + 0);
+ else if (ResY == 1200)
+ rec[3] = be32( (nbie<<24) + (plane<<16) + (128<<8) + 33);
+ else
+ rec[3] = be32( (nbie<<24) + (plane<<16) + (128<<8) + 17);
+ rec[4] = be32(w); //block0: width
+ rec[5] = be32(0); //block0: data
+ rec[6] = be32(0x10000000); //block0: data
+
+ rec[7] = be32(20); //block1: len=20
+ fwrite(rec, 32, 1, ofp);
+
+ ((DWORD *) bih)[2] = be32(h256);
+ fwrite(bih, 20, 1, ofp);
+}
+
+void
+write_plane_compressed(int nbie, unsigned char *buf, int w, int h, int plane,
+ FILE *ofp)
+{
+ int y;
+ int ns = 256;
+
+ for (y = 0; y < h; y += ns)
+ {
+ struct jbg_enc_state se;
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ unsigned char *bitmaps[1];
+ int lines = (h-y) > ns ? ns : (h-y);
+ int chainlen;
+ DWORD rec[5];
+
+ bitmaps[0] = buf + y * ((w+7)/8);
+ chain = NULL;
+ JbgOptions[2] = (lines < ns) ? lines : ns;
+
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1,"Program error: missing BIH at start of chain\n");
+ if (y == 0)
+ start_page_compressed(nbie, w, h, plane, chain->data, ofp);
+
+ chainlen = 0;
+ for (current = chain->next; current; current = current->next)
+ chainlen += current->len;
+
+ rec[0] = be32(chainlen + 20); //reclen
+ rec[1] = be32(1); //rectype=1
+
+ rec[2] = be32(4); //block0: len=4
+ rec[3] = be32(plane << 24); //block0: black
+
+ rec[4] = be32(chainlen); //block1: len
+ fwrite(rec, 20, 1, ofp);
+ for (current = chain->next; current; current = current->next)
+ fwrite(current->data, 1, current->len, ofp);
+ }
+}
+
+int
+write_plane(int pn, BIE_CHAIN **root, FILE *ofp)
+{
+ BIE_CHAIN *current = *root;
+ BIE_CHAIN *next;
+ int len;
+ int w, h;
+ int stripe = 0;
+
+ debug(3, "Write Plane %d\n", pn);
+
+ /* error handling */
+ if (!current)
+ error(1,"There is no JBIG!\n");
+ if (!current->next)
+ error(1,"There is no or wrong JBIG header!\n");
+ if (current->len != 20)
+ error(1,"wrong BIH length\n");
+
+ w = (((long) current->data[ 4] << 24)
+ | ((long) current->data[ 5] << 16)
+ | ((long) current->data[ 6] << 8)
+ | (long) current->data[ 7]);
+ h = (((long) current->data[ 8] << 24)
+ | ((long) current->data[ 9] << 16)
+ | ((long) current->data[10] << 8)
+ | (long) current->data[11]);
+
+ start_page_compressed(1, w, h, pn-1, current->data, ofp);
+
+ for (current = (*root)->next; current && current->len;
+ current = current->next)
+ {
+ DWORD rec[5];
+ int blklen = current->len;
+ unsigned char *buf = current->data;
+ int plane = pn - 1;
+ int y = 0;
+
+ len = current->len;
+ next = current->next;
+ ++stripe;
+
+ rec[0] = be32(blklen + 20); //reclen
+ rec[1] = be32(1); //rectype=1
+
+ rec[2] = be32(4); //block0: len=4
+ rec[3] = be32(plane << 24); //block0: black
+
+ rec[4] = be32(blklen); //block1: len
+ fwrite(rec, 20, 1, ofp);
+ fwrite(buf + y*(w/8), 1, blklen, ofp);
+ }
+ free_chain(*root);
+
+ return 0;
+}
+
+void
+end_page(FILE *ofp)
+{
+ DWORD rec[2];
+ static int pageno = 0;
+
+ rec[0] = be32(8); //reclen=8
+ rec[1] = be32(255); //rectype=255
+ fwrite(rec, 8, 1, ofp);
+
+ ++pageno;
+ if (IsCUPS)
+ fprintf(stderr, "PAGE: %d %d\n", pageno, Copies);
+}
+
+void
+start_page_uncompressed(int nbie, int w, int h, int plane, FILE *ofp)
+{
+ DWORD rec[13];
+ int h256 = ((h + 255) / 256) * 256;
+
+ rec[0] = be32(52); //reclen=52
+ rec[1] = be32(0); //rectype=0
+
+ rec[2] = be32(16); //block0: len=16
+ if (ResX == 300)
+ rec[3] = be32( (nbie<<24) + (plane<<16) + 0); //block0: data
+ else if (ResY == 1200)
+ rec[3] = be32( (nbie<<24) + (plane<<16) + 33); //block0: data
+ else
+ rec[3] = be32( (nbie<<24) + (plane<<16) + 17); //block0: data
+ rec[4] = be32(w); //block0: width
+ rec[5] = be32(0); //block0: data
+ rec[6] = be32(0); //block0: data
+
+ rec[7] = be32(20); //block1: len=20
+ rec[8] = be32(0x30303130); //block1: "0010"
+ rec[9] = be32(w); //block1: width
+ rec[10] = be32(h256); //block1: height
+ rec[11] = be32(256); //block1: rows
+ rec[12] = be32(0); //block1: data
+ fwrite(rec, 52, 1, ofp);
+}
+
+void
+write_plane_uncompressed(unsigned char *buf, int w, int h, int plane, FILE *ofp)
+{
+ int h256 = ((h + 255) / 256) * 256;
+ int w256 = 256 * w/8;
+ int x, y;
+ int blklen;
+ DWORD rec[5];
+
+ for (y = 0; y < h; y += 256)
+ {
+ if ((y+256) <= h)
+ blklen = 256 * w/8;
+ else
+ blklen = (h - y) * w/8;
+ rec[0] = be32(w256 + 20); //reclen
+ rec[1] = be32(1); //rectype=1
+
+ rec[2] = be32(4); //block0: len=4
+ rec[3] = be32(plane << 24); //block0: black
+
+ rec[4] = be32(w256); //block1: len
+ fwrite(rec, 20, 1, ofp);
+ fwrite(buf + y*(w/8), 1, blklen, ofp);
+ }
+
+ // Pad to 256 lines...
+ for (y = h; y < h256; ++y)
+ for (x = 0; x < w/8; ++x)
+ fputc(0, ofp);
+}
+
+int
+write_page(BIE_CHAIN **root, BIE_CHAIN **root2,
+ BIE_CHAIN **root3, BIE_CHAIN **root4, FILE *ofp)
+{
+ int nbie = root2 ? 4 : 1;
+
+// start_page(root, nbie, ofp);
+
+ if (root)
+ {
+ if (OutputStartPlane)
+ write_plane(nbie == 1 ? 4 : 1, root, ofp);
+ else
+ write_plane(nbie == 1 ? 0 : 1, root, ofp);
+ }
+ if (root2)
+ write_plane(2, root2, ofp);
+ if (root3)
+ write_plane(3, root3, ofp);
+ if (root4)
+ write_plane(4, root4, ofp);
+
+ end_page(ofp);
+ return 0;
+}
+
+void
+start_doc(FILE *ofp)
+{
+ time_t now;
+ struct tm *tmp;
+ char datetime[256+1];
+ char *device_uri;
+ char *strmedia[] =
+ {
+ "PLAIN", "LABELS", "TRANSPARENCY"
+ };
+ char *strpaper[] =
+ {
+ "CUSTOM", "A4", "LETTER", "LEGAL", "LEGAL13",
+ "A5", "B5", "A6", "MONARCH", "DL",
+ "C5", "COM10", "EXECUTIVE", "COM9",
+ "LEGAL135"
+ };
+ #define STRARY(X, A) \
+ ((X) >= 0 && (X) < sizeof(A)/sizeof(A[0])) \
+ ? A[X] : "NORMAL"
+
+ fprintf(ofp, "\033%%-12345X@PJL\r\n");
+ fprintf(ofp, "@PJL RDYMSG DISPLAY = \"%s\"\r\n",
+ Username ? Username : "Unknown");
+ fprintf(ofp, "@PJL SET OKIJOBACCOUNTJOB USERID=\"%s\" JOBNAME=\"%s\"\r\n",
+ Username ? Username : "Unknown",
+ Filename ? Filename : "Unknown"
+ );
+ fprintf(ofp, "@PJL SET OKIAUXJOBINFO DATA=\"DocumentName=%s\"\r\n",
+ Filename ? Filename : "Unknown"
+ );
+
+ #ifdef linux
+ {
+ struct utsname u;
+
+ uname(&u);
+ fprintf(ofp, "@PJL SET OKIAUXJOBINFO DATA=\"ComputerName=%s\"\r\n",
+ u.nodename);
+ }
+ #endif
+
+ now = time(NULL);
+ tmp = localtime(&now);
+ strftime(datetime, sizeof(datetime), "00:00:00 %Y/%m/%d", tmp);
+ fprintf(ofp, "@PJL SET OKIAUXJOBINFO DATA=\"ReceptionTime=%s\"\r\n",
+ datetime);
+
+ device_uri = getenv("DEVICE_URI");
+ if (device_uri)
+ fprintf(ofp, "@PJL SET OKIAUXJOBINFO DATA=\"PortName=%s\"\r\n",
+ device_uri);
+
+ if (SourceCode == DMBIN_AUTO)
+ fprintf(ofp, "@PJL SET OKIAUTOTRAYSWITCH=ON\r\n");
+ else
+ fprintf(ofp, "@PJL SET OKIAUTOTRAYSWITCH=OFF\r\n");
+
+ fprintf(ofp, "@PJL SET OKIPAPERSIZECHECK=ENABLE\r\n");
+ switch (ResX)
+ {
+ case 300: fprintf(ofp, "@PJL SET RESOLUTION=300\r\n"); break;
+ case 600: fprintf(ofp, "@PJL SET RESOLUTION=600\r\n"); break;
+ default: error(1, "Illegal X resolution\n"); break;
+ }
+ switch (ResY)
+ {
+ case 300:
+ case 600: break;
+ case 1200: fprintf(ofp, "@PJL SET RESOLUTION=V1200\r\n"); break;
+ }
+
+ fprintf(ofp, "@PJL SET PAPER=%s\r\n", STRARY(PaperCode, strpaper));
+ fprintf(ofp, "@PJL SET OKITRAYSEQUENCE=PAPERFEEDTRAY\r\n");
+
+ switch (SourceCode)
+ {
+ case DMBIN_AUTO:
+ case DMBIN_TRAY1:
+ fprintf(ofp, "@PJL SET OKIPAPERFEED=TRAY1\r\n");
+ break;
+ case DMBIN_TRAY2:
+ fprintf(ofp, "@PJL SET OKIPAPERFEED=TRAY2\r\n");
+ break;
+ case DMBIN_MULTI:
+ fprintf(ofp, "@PJL SET OKIPAPERFEED=FRONTTRAY\r\n");
+ break;
+ case DMBIN_MANUAL:
+ fprintf(ofp, "@PJL SET OKIPAPERFEED=FRONTTRAY\r\n");
+ fprintf(ofp, "@PJL SET MANUALFEED=ON\r\n");
+ break;
+ }
+
+ fprintf(ofp, "@PJL SET OKIMEDIATYPE = %s\r\n", STRARY(MediaCode, strmedia));
+
+ fprintf(ofp, "@PJL SET LPARM:PCL OKIPRINTMARGIN=INCH1D6\r\n");
+
+ fprintf(ofp, "@PJL SET COPIES=%d\r\n", Copies);
+ fprintf(ofp, "@PJL SET QTY=1\r\n");
+ fprintf(ofp, "@PJL SET HIPERCEFFECTIVEBLOCKSIZE=%d\r\n",
+ PageWidth * PageHeight / 8);
+
+ switch (Duplex)
+ {
+ case DMDUPLEX_LONGEDGE:
+ case DMDUPLEX_MANUALLONG:
+ fprintf(ofp, "@PJL SET DUPLEX=ON\r\n");
+ //fprintf(ofp, "@PJL SET BINDING=LONGEDGE\r\n");
+ break;
+ case DMDUPLEX_SHORTEDGE:
+ case DMDUPLEX_MANUALSHORT:
+ fprintf(ofp, "@PJL SET DUPLEX=ON\r\n");
+ //fprintf(ofp, "@PJL SET BINDING=SHORTEDGE\r\n");
+ break;
+ }
+ fprintf(ofp, "@PJL ENTER LANGUAGE=HIPERC\n");
+}
+
+void
+end_doc(FILE *ofp)
+{
+ //fprintf(ofp, "%c", 9);
+ fprintf(ofp, "\033%%-12345X@PJL\r\n");
+ fprintf(ofp, "@PJL EOJ NAME = \"End \"\n");
+ fprintf(ofp, "\033%%-12345X");
+}
+
+static int AnyColor;
+
+void
+cmyk_planes(unsigned char *plane[4], unsigned char *raw, int w, int h)
+{
+ int rawbpl = (w+1) / 2;
+ int bpl = (w + 7) / 8;
+ int i;
+ int x, y;
+ unsigned char byte;
+ unsigned char mask[8] = { 128, 64, 32, 16, 8, 4, 2, 1 };
+ int aib = AllIsBlack;
+ int bc = BlackClears;
+
+ bpl = (bpl + 15) & ~15;
+ debug(1, "w=%d, bpl=%d, rawbpl=%d\n", w, bpl, rawbpl);
+ AnyColor = 0;
+ for (i = 0; i < 4; ++i)
+ memset(plane[i], 0, bpl * h);
+
+ //
+ // Unpack the combined plane into individual color planes
+ //
+ // TODO: this can be speeded up using a 256 or 65536 entry lookup table
+ //
+ for (y = 0; y < h; ++y)
+ {
+ for (x = 0; x < w; ++x)
+ {
+ byte = raw[y*rawbpl + x/2];
+
+ if (aib && (byte & 0xE0) == 0xE0)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x10)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x80) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE0) AnyColor |= byte;
+ }
+ }
+ else
+ {
+ if (byte & 0x80) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE0) AnyColor |= byte;
+ }
+
+ ++x;
+ if (aib && (byte & 0x0E) == 0x0E)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x1)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x8) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE) AnyColor |= byte;
+ }
+ }
+ else
+ {
+ if (byte & 0x8) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE) AnyColor |= byte;
+ }
+ }
+ }
+ debug(2, "BlackClears = %d; AnyColor = %s %s %s\n",
+ BlackClears,
+ (AnyColor & 0x88) ? "Cyan" : "",
+ (AnyColor & 0x44) ? "Magenta" : "",
+ (AnyColor & 0x22) ? "Yellow" : ""
+ );
+}
+
+int
+cmyk_page(unsigned char *raw, int w, int h, FILE *ofp)
+{
+ BIE_CHAIN *chain[4];
+ int i;
+ int bpl, bpl16;
+ unsigned char *plane[4], *bitmaps[4][1];
+ struct jbg_enc_state se[4];
+
+ RealWidth = w;
+ w = (w + 127) & ~127;
+ bpl = (w + 7) / 8;
+ bpl16 = (bpl + 15) & ~15;
+ debug(1, "w = %d, bpl = %d, bpl16 = %d\n", w, bpl, bpl16);
+
+ for (i = 0; i < 4; ++i)
+ {
+ plane[i] = malloc(bpl16 * h);
+ if (!plane[i]) error(3, "Cannot allocate space for bit plane\n");
+ chain[i] = NULL;
+ }
+
+ cmyk_planes(plane, raw, RealWidth, h);
+
+ if (Compressed)
+ {
+ for (i = 0; i < 4; ++i)
+ {
+ if (Debug >= 9)
+ {
+ FILE *dfp;
+ char fname[256];
+ sprintf(fname, "xxxplane%d", i);
+ dfp = fopen(fname, "w");
+ if (dfp)
+ {
+ fwrite(plane[i], bpl*h, 1, dfp);
+ fclose(dfp);
+ }
+ }
+
+ *bitmaps[i] = plane[i];
+
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
+
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+ }
+ else
+ {
+ if (Color2Mono)
+ {
+ i = Color2Mono - 1;
+ start_page_uncompressed(1, w, h, i, ofp);
+ write_plane_uncompressed(plane[i], w, h, i, ofp);
+ }
+ else if (AnyColor)
+ {
+ for (i = 0; i < 4; ++i)
+ start_page_uncompressed(4, w, h, i, ofp);
+ for (i = 0; i < 4; ++i)
+ write_plane_uncompressed(plane[i], w, h, i, ofp);
+ }
+ else
+ {
+ start_page_uncompressed(1, w, h, 3, ofp);
+ write_plane_uncompressed(plane[3], w, h, 3, ofp);
+ }
+ end_page(ofp);
+ }
+
+ for (i = 0; i < 4; ++i)
+ free(plane[i]);
+ return 0;
+}
+
+int
+pksm_page(unsigned char *plane[4], int w, int h, FILE *ofp)
+{
+ BIE_CHAIN *chain[4];
+ int i;
+ unsigned char *bitmaps[4][1];
+ struct jbg_enc_state se[4];
+
+ RealWidth = w;
+ w = (w + 127) & ~127;
+ debug(1, "w = %d\n", w);
+
+ if (Compressed)
+ {
+ for (i = 0; i < 4; ++i)
+ chain[i] = NULL;
+
+ for (i = 0; i < 4; ++i)
+ {
+ *bitmaps[i] = plane[i];
+
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
+
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+ }
+ else
+ {
+ if (Color2Mono)
+ {
+ i = Color2Mono - 1;
+ start_page_uncompressed(1, w, h, i, ofp);
+ write_plane_uncompressed(plane[i], w, h, i, ofp);
+ }
+ else if (AnyColor)
+ {
+ for (i = 0; i < 4; ++i)
+ start_page_uncompressed(4, w, h, i, ofp);
+ for (i = 0; i < 4; ++i)
+ write_plane_uncompressed(plane[i], w, h, i, ofp);
+ }
+ else
+ {
+ start_page_uncompressed(1, w, h, 3, ofp);
+ write_plane_uncompressed(plane[3], w, h, 3, ofp);
+ }
+ end_page(ofp);
+ }
+
+ return 0;
+}
+
+int
+pbm_page(unsigned char *buf, int w, int h, FILE *ofp)
+{
+ // BIE_CHAIN *chain = NULL;
+ unsigned char *bitmaps[1];
+ // struct jbg_enc_state se;
+
+ RealWidth = w;
+ w = (w + 127) & ~127;
+
+ if (SaveToner)
+ {
+ int x, y;
+ int bpl, bpl16;
+
+ bpl = (w + 7) / 8;
+ bpl16 = (bpl + 15) & ~15;
+
+ for (y = 0; y < h; y += 2)
+ for (x = 0; x < bpl16; ++x)
+ buf[y*bpl16 + x] &= 0x55;
+ for (y = 1; y < h; y += 2)
+ for (x = 0; x < bpl16; ++x)
+ buf[y*bpl16 + x] &= 0xaa;
+ }
+
+ *bitmaps = buf;
+
+ if (Compressed)
+ {
+ // start_page_compressed(1, w, h, 3, ofp);
+
+ write_plane_compressed(1, buf, w, h, 3, ofp);
+
+ end_page(ofp);
+#if 0
+ jbg_enc_init(&se, w, h, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ write_page(&chain, NULL, NULL, NULL, ofp);
+#endif
+ }
+ else
+ {
+ start_page_uncompressed(1, w, h, 3, ofp);
+
+ write_plane_uncompressed(buf, w, h, 3, ofp);
+
+ end_page(ofp);
+ }
+
+ return 0;
+}
+
+int
+read_and_clip_image(unsigned char *buf,
+ int rawBpl, int rightBpl, int pixelsPerByte,
+ int bpl, int h, int bpl16, FILE *ifp)
+{
+ unsigned char *rowbuf, *rowp;
+ int y;
+ int rc;
+
+ rowbuf = malloc(rawBpl);
+ if (!rowbuf)
+ error(1, "Can't allocate row buffer\n");
+
+ // Clip top rows
+ if (UpperLeftY)
+ {
+ for (y = 0; y < UpperLeftY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc == 0)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(1) on input at y=%d\n", y);
+ }
+ }
+
+ // Copy the rows that we want to image
+ rowp = buf;
+ for (y = 0; y < h; ++y, rowp += bpl16)
+ {
+ // Clip left pixel *bytes*
+ if (UpperLeftX)
+ {
+ rc = fread(rowbuf, UpperLeftX / pixelsPerByte, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(2) on input at y=%d\n", y);
+ }
+
+ if (bpl != bpl16)
+ memset(rowp, 0, bpl16);
+ rc = fread(rowp, bpl, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY && !UpperLeftX)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(3) on input at y=%d\n", y);
+
+ // Clip right pixels
+ if (rightBpl != bpl)
+ {
+ rc = fread(rowbuf, rightBpl - bpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(4) on input at y=%d\n", y);
+ }
+ }
+
+ // Clip bottom rows
+ if (LowerRightY)
+ {
+ for (y = 0; y < LowerRightY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(5) on input at y=%d\n", y);
+ }
+ }
+
+ free(rowbuf);
+ return (0);
+
+eof:
+ free(rowbuf);
+ return (EOF);
+}
+
+int
+cmyk_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int rc;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ rawW = PageWidth;
+ rawH = PageHeight;
+ rawBpl = (PageWidth + 1) / 2;
+
+ // We only clip multiples of 2 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 1;
+ UpperLeftX &= ~1;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 1) / 2;
+ rightBpl = (rawW - UpperLeftX + 1) / 2;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Unable to allocate page buffer of %d x %d = %d bytes\n",
+ rawW, rawH, rawBpl * rawH);
+
+ for (;;)
+ {
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 2, bpl, h, bpl, ifp);
+ if (rc == EOF)
+ goto done;
+
+ ++PageNum;
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
+ if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ cmyk_page(buf, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "CMYK Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ cmyk_page(buf, w, h, ofp);
+ }
+
+done:
+ free(buf);
+ return 0;
+}
+
+static unsigned long
+getint(FILE *fp)
+{
+ int c;
+ unsigned long i;
+
+ while ((c = getc(fp)) != EOF && !isdigit(c))
+ if (c == '#')
+ while ((c = getc(fp)) != EOF && !(c == 13 || c == 10)) ;
+ if (c != EOF)
+ {
+ ungetc(c, fp);
+ fscanf(fp, "%lu", &i);
+ }
+ return i;
+}
+
+static void
+skip_to_nl(FILE *fp)
+{
+ for (;;)
+ {
+ int c;
+ c = getc(fp);
+ if (c == EOF)
+ error(1, "Premature EOF on input stream\n");
+ if (c == '\n')
+ return;
+ }
+}
+
+int
+pbm_header(FILE *ifp, int *p4eatenp, int *wp, int *hp)
+{
+ int c1, c2;
+
+ if (*p4eatenp)
+ *p4eatenp = 0; // P4 already eaten in main
+ else
+ {
+ c1 = getc(ifp);
+ if (c1 == EOF)
+ return 0;
+ c2 = getc(ifp);
+ if (c1 != 'P' || c2 != '4')
+ error(1, "Not a pbmraw data stream\n");
+ }
+
+ skip_to_nl(ifp);
+
+ *wp = getint(ifp);
+ *hp = getint(ifp);
+ skip_to_nl(ifp);
+ return 1;
+}
+
+int
+pksm_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *plane[4];
+ int rawW, rawH, rawBpl;
+ int saveW = 0, saveH = 0;
+ int rightBpl;
+ int w, h, bpl;
+ int bpl16;
+ int i;
+ int rc;
+ int p4eaten = 1;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ for (;;)
+ {
+ ++PageNum;
+ AnyColor = 0;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if (pbm_header(ifp, &p4eaten, &rawW, &rawH) == 0)
+ {
+ if (i == 0)
+ goto eof;
+ else
+ error(1, "Premature EOF(pksm) on page %d hdr, plane %d\n",
+ PageNum, i);
+ }
+ if (i == 0)
+ {
+ saveW = rawW;
+ saveH = rawH;
+ }
+ if (saveW != rawW)
+ error(1, "Image width changed from %d to %d on plane %d\n",
+ saveW, rawW, i);
+ if (saveH != rawH)
+ error(1, "Image height changed from %d to %d on plane %d\n",
+ saveH, rawH, i);
+
+ rawBpl = (rawW + 7) / 8;
+
+ // We only clip multiples of 8 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 7;
+ UpperLeftX &= ~7;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ rightBpl = (rawW - UpperLeftX + 7) / 8;
+
+ bpl16 = (bpl + 15) & ~15;
+ debug(1, "bpl=%d bpl16=%d\n", bpl, bpl16);
+
+ plane[i] = malloc(bpl16 * h);
+ if (!plane[i])
+ error(1, "Can't allocate plane buffer\n");
+
+ rc = read_and_clip_image(plane[i],
+ rawBpl, rightBpl, 8, bpl, h, bpl16, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pksm) on page %d data, plane %d\n",
+ PageNum, i);
+
+ if (Debug >= 9)
+ {
+ FILE *dfp;
+ char fname[256];
+ sprintf(fname, "xxxplane%d", i);
+ dfp = fopen(fname, "w");
+ if (dfp)
+ {
+ fwrite(plane[i], bpl*h, 1, dfp);
+ fclose(dfp);
+ }
+ }
+
+ // See if we can optimize this to be a monochrome page
+ if (!AnyColor && i != 3)
+ {
+ unsigned char *p, *e;
+
+ for (p = plane[i], e = p + bpl16*h; p < e; ++p)
+ if (*p)
+ {
+ AnyColor |= 1<<i;
+ break;
+ }
+ }
+
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(plane[i], plane[i] + bpl16 * h - 1, Mirror1);
+ if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
+ rotate_bytes_180(plane[i], plane[i] + bpl16 * h - 1, Mirror1);
+ }
+
+ debug(2, "AnyColor = %s %s %s\n",
+ (AnyColor & 0x01) ? "Cyan" : "",
+ (AnyColor & 0x02) ? "Magenta" : "",
+ (AnyColor & 0x04) ? "Yellow" : ""
+ );
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ pksm_page(plane, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "PKSM Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ pksm_page(plane, w, h, ofp);
+
+ for (i = 0; i < 4; ++i)
+ free(plane[i]);
+ }
+eof:
+ return (0);
+}
+
+int
+pbm_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int bpl16 = 0;
+ int rc;
+ int p4eaten = 1;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ for (;;)
+ {
+ if (pbm_header(ifp, &p4eaten, &rawW, &rawH) == 0)
+ break;
+
+ rawBpl = (rawW + 7) / 8;
+
+ // We only clip multiples of 8 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 7;
+ UpperLeftX &= ~7;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ rightBpl = (rawW - UpperLeftX + 7) / 8;
+
+ bpl16 = (bpl + 15) & ~15;
+ debug(1, "bpl=%d bpl16=%d\n", bpl, bpl16);
+
+ buf = malloc(bpl16 * h);
+ if (!buf)
+ error(1, "Can't allocate page buffer\n");
+
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 8, bpl, h, bpl16, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pbm) on input stream\n");
+
+ ++PageNum;
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ if (Duplex == DMDUPLEX_MANUALLONG)
+ rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ pbm_page(buf, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "PBM Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ pbm_page(buf, w, h, ofp);
+
+ free(buf);
+ }
+ return (0);
+}
+
+void
+blank_page(FILE *ofp)
+{
+ int w, h, bpl, bpl16 = 0;
+ unsigned char *plane;
+
+ w = PageWidth - UpperLeftX - LowerRightX;
+ h = PageHeight - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ bpl16 = (bpl + 15) & ~15;
+
+ plane = malloc(bpl16 * h);
+ if (!plane)
+ error(1, "Unable to allocate blank plane (%d bytes)\n", bpl16*h);
+ memset(plane, 0, bpl16*h);
+
+ ++PageNum;
+ pbm_page(plane, w, h, ofp);
+ free(plane);
+}
+
+int
+parse_xy(char *str, int *xp, int *yp)
+{
+ char *p;
+
+ if (!str || str[0] == 0) return -1;
+
+ *xp = strtoul(str, &p, 10);
+ if (str == p) return -2;
+ while (*p && (*p < '0' || *p > '9'))
+ ++p;
+ str = p;
+ if (str[0] == 0) return -3;
+ *yp = strtoul(str, &p, 10);
+ if (str == p) return -4;
+ return (0);
+}
+
+void
+do_one(FILE *in)
+{
+ int mode;
+
+ if (Mode == MODE_COLOR)
+ {
+ mode = getc(in);
+ if (mode != 'P')
+ {
+ ungetc(mode, in);
+ cmyk_pages(in, stdout);
+ }
+ else
+ {
+ mode = getc(in);
+ if (mode == '4')
+ pksm_pages(in, stdout);
+ else
+ error(1, "Not a pksmraw file!\n");
+ }
+ }
+ else
+ {
+ mode = getc(in);
+ if (mode != 'P')
+ error(1, "Not a pbm file!\n");
+ mode = getc(in);
+ if (mode == '4')
+ pbm_pages(in, stdout);
+ else
+ error(1, "Not a pbmraw file!\n");
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ int i, j;
+
+ while ( (c = getopt(argc, argv,
+ "cd:g:n:m:p:r:s:tu:l:L:ABPJ:S:U:X:Z:D:V?h")) != EOF)
+ switch (c)
+ {
+ case 'c': Mode = MODE_COLOR; break;
+ case 'S': Color2Mono = atoi(optarg);
+ Mode = MODE_COLOR;
+ if (Color2Mono < 0 || Color2Mono > 4)
+ error(1, "Illegal value '%s' for -C\n", optarg);
+ break;
+ case 'd': Duplex = atoi(optarg); break;
+ case 'g': if (parse_xy(optarg, &PageWidth, &PageHeight))
+ error(1, "Illegal format '%s' for -g\n", optarg);
+ if (PageWidth < 0 || PageWidth > 1000000)
+ error(1, "Illegal X value '%s' for -g\n", optarg);
+ if (PageHeight < 0 || PageHeight > 1000000)
+ error(1, "Illegal Y value '%s' for -g\n", optarg);
+ break;
+ case 'm': MediaCode = atoi(optarg); break;
+ case 'n': Copies = atoi(optarg); break;
+ case 'p': PaperCode = atoi(optarg); break;
+ case 'r': if (parse_xy(optarg, &ResX, &ResY))
+ error(1, "Illegal format '%s' for -r\n", optarg);
+ break;
+ case 's': SourceCode = atoi(optarg); break;
+ case 't': SaveToner = 1; break;
+ case 'u':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &UpperLeftX, &UpperLeftY))
+ error(1, "Illegal format '%s' for -u\n", optarg);
+ break;
+ case 'l':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &LowerRightX, &LowerRightY))
+ error(1, "Illegal format '%s' for -l\n", optarg);
+ break;
+ case 'L': LogicalClip = atoi(optarg);
+ if (LogicalClip < 0 || LogicalClip > 3)
+ error(1, "Illegal value '%s' for -L\n", optarg);
+ break;
+ case 'A': AllIsBlack = !AllIsBlack; break;
+ case 'B': BlackClears = !BlackClears; break;
+ case 'P': OutputStartPlane = !OutputStartPlane; break;
+ case 'J': if (optarg[0]) Filename = optarg; break;
+ case 'U': if (optarg[0]) Username = optarg; break;
+ case 'X': ExtraPad = atoi(optarg); break;
+ case 'Z': Compressed = atoi(optarg); break;
+ case 'D': Debug = atoi(optarg); break;
+ case 'V': printf("%s\n", Version); exit(0);
+ default: usage(); exit(1);
+ }
+
+ if (UpperLeftX < 0 || UpperLeftX >= PageWidth)
+ error(1, "Illegal X value '%d' for -u\n", UpperLeftX);
+ if (UpperLeftY < 0 || UpperLeftY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -u\n", UpperLeftY);
+ if (LowerRightX < 0 || LowerRightX >= PageWidth)
+ error(1, "Illegal X value '%d' for -l\n", LowerRightX);
+ if (LowerRightY < 0 || LowerRightY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -l\n", LowerRightY);
+
+ argc -= optind;
+ argv += optind;
+
+ if (getenv("DEVICE_URI"))
+ IsCUPS = 1;
+
+if (getenv("ccc"))
+ Compressed = 1;
+
+ Bpp = ResX / 600;
+ //ResX = 600;
+ if (0 && SaveToner)
+ {
+ SaveToner = 0;
+ EconoMode = 1;
+ }
+
+ switch (Duplex)
+ {
+ case DMDUPLEX_LONGEDGE:
+ case DMDUPLEX_SHORTEDGE:
+ case DMDUPLEX_MANUALLONG:
+ case DMDUPLEX_MANUALSHORT:
+ EvenPages = tmpfile();
+ break;
+ }
+
+ start_doc(stdout);
+
+ if (argc == 0)
+ {
+ do_one(stdin);
+ }
+ else
+ {
+ for (i = 0; i < argc; ++i)
+ {
+ FILE *ifp;
+
+ ifp = fopen(argv[i], "r");
+ if (!ifp)
+ error(1, "Can't open '%s' for reading\n", argv[i]);
+ do_one(ifp);
+ fclose(ifp);
+ }
+ }
+
+ /*
+ * Do manual duplex
+ */
+ if (EvenPages)
+ {
+ // Handle odd page count
+ if ( (PageNum & 1) == 1)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ blank_page(EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "Blank Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+
+ // Write even pages in reverse order
+ for (i = SeekIndex-1; i >= 0; --i)
+ {
+ debug(1, "EvenPage: %d %ld %ld\n",
+ i, SeekRec[i].b, SeekRec[i].e);
+
+ fseek(EvenPages, SeekRec[i].b, 0L);
+ for (j = 0; j < (SeekRec[i].e - SeekRec[i].b); ++j)
+ putc(getc(EvenPages), stdout);
+ }
+ fclose(EvenPages);
+ }
+
+ end_doc(stdout);
+
+ exit(0);
+}
diff --git a/foo2hp.1in b/foo2hp.1in
index 8248dcd..5b2c5b8 100644
--- a/foo2hp.1in
+++ b/foo2hp.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2hp 1 "${MODpage}" "foo2hp ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2hp Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -246,6 +78,7 @@ photo 278
.BI \-p\0 paper
Paper code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
diff --git a/foo2hp.c b/foo2hp.c
index aaee6c5..7c4d924 100644
--- a/foo2hp.c
+++ b/foo2hp.c
@@ -41,7 +41,7 @@ yourself.
*/
-static char Version[] = "$Id: foo2hp.c,v 1.38 2007/07/15 14:31:55 rick Exp $";
+static char Version[] = "$Id: foo2hp.c,v 1.42 2009/02/19 16:35:08 rick Exp $";
#include <stdio.h>
#include <stdlib.h>
@@ -1426,7 +1426,6 @@ cups_pages(FILE *ifp, FILE *ofp)
AnyColor = 1;
for (;;)
{
- ++PageNum;
seek = sizeof(magic);
if (fread(&c1, sizeof(c1), 1, ifp) != 1)
break;
@@ -1438,6 +1437,8 @@ cups_pages(FILE *ifp, FILE *ofp)
seek += sizeof(c2);
}
+ ++PageNum;
+
rawW = c1.cupsWidth;
rawH = c1.cupsHeight;
// c1.cupsMediaType
@@ -1526,7 +1527,10 @@ blank_page(FILE *ofp)
w = PageWidth - UpperLeftX - LowerRightX;
h = PageHeight - UpperLeftY - LowerRightY;
- bpl = (w + 7) / 8;
+ if (Bpp == 1)
+ bpl = (w + 7) / 8;
+ else
+ bpl = (w + 3) / 4;
bpl16 = (bpl + 15) & ~15;
plane = malloc(bpl16 * h);
@@ -1546,13 +1550,13 @@ parse_xy(char *str, int *xp, int *yp)
if (!str || str[0] == 0) return -1;
- *xp = strtoul(str, &p, 0);
+ *xp = strtoul(str, &p, 10);
if (str == p) return -2;
while (*p && (*p < '0' || *p > '9'))
++p;
str = p;
if (str[0] == 0) return -3;
- *yp = strtoul(str, &p, 0);
+ *yp = strtoul(str, &p, 10);
if (str == p) return -4;
return (0);
}
@@ -1671,7 +1675,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (getenv("DEVICE_URL"))
+ if (getenv("DEVICE_URI"))
IsCUPS = 1;
start_doc(stdout);
diff --git a/foo2hp2600-wrapper.1in b/foo2hp2600-wrapper.1in
index 174cb5b..95631dd 100644
--- a/foo2hp2600-wrapper.1in
+++ b/foo2hp2600-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2hp2600-wrapper 1 "${MODpage}" "foo2hp2600-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2hp2600-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -241,6 +73,7 @@ photo 278
.BI \-p\0 paper
Paper size code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
@@ -322,6 +155,9 @@ Add extra zero padding to the end of BID segments. The default is
is needed for older ZjStream printers, such as the Minolta 2200DL
and HP LaserJet 1000, and seems harmless to newer ones, such as
the Minolta 2300DL. So the default should be good for all cases.
+.TP
+.BI \-z\0 model
+Model: Model: 0=HP CLJ 1600/2600n; 1=HP CLJ CP1215
.SS Color Tweaking Options
These are the options used to control the quality of color output.
Color correction is currently a WORK IN PROGRESS.
diff --git a/foo2hp2600-wrapper.in b/foo2hp2600-wrapper.in
index 23d2d30..b00f31b 100755
--- a/foo2hp2600-wrapper.in
+++ b/foo2hp2600-wrapper.in
@@ -18,7 +18,7 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2hp2600-wrapper.in,v 1.48 2007/06/11 00:48:32 rick Exp $'
+VERSION='$Id: foo2hp2600-wrapper.in,v 1.62 2008/12/07 00:45:18 rick Exp $'
#
# Printer Notes:
@@ -77,6 +77,7 @@ Printer Tweaking Options:
-P Do not output START_PLANE codes. May be needed by some
monochrome-only printers.
-X padlen Add extra zero padding to the end of BID segments [16]
+-z model Model: 0=HP CLJ 1600/2600n; 1=HP CLJ CP1215 [$MODEL]
Color Tweaking Options:
-g gsopts Additional options to pass to Ghostscript, such as
@@ -182,8 +183,8 @@ nup() {
#
# N.B. := operator used here, when :- would be better, because "ash"
# doesn't have :-
-if gs8 -v >/dev/null 2>&1; then
- GSBIN=${GSBIN:-gs8}
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
else
GSBIN=${GSBIN:-gs}
fi
@@ -194,6 +195,7 @@ DUPLEX=1
BPP=1
COLOR=
COLORMODE=default
+MODEL=0
QUALITY=1
QUALITY=wts
@@ -217,6 +219,7 @@ EXTRAPAD=
SAVETONER=
NUP_ORIENT=
GSDEV=-sDEVICE=pbmraw
+SEGFAULT=0
# What mode to use if the user wants us to pick the "best" mode
case `$GSBIN --version` in
7*)
@@ -229,6 +232,7 @@ case `$GSBIN --version` in
GAMMAFILE=km2430_2.icm
else
GAMMAFILE=hpclj2600n-0.icm
+ SEGFAULT=1
fi
QUALITY=1
;;
@@ -237,7 +241,7 @@ case `$GSBIN --version` in
;;
esac
-while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tABS:D:G:I:PX:Vh?" opt
+while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
do
case $opt in
b) BPP="$OPTARG";;
@@ -251,6 +255,7 @@ do
r) RES="$OPTARG";;
s) SOURCE="$OPTARG";;
t) SAVETONER="-t";;
+ z) MODEL="$OPTARG";;
l) CLIP_LR="-l $OPTARG";;
u) CLIP_UL="-u $OPTARG";;
L) CLIP_LOG="-L $OPTARG";;
@@ -275,7 +280,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2hp -V; exit 0;;
+ V) echo "$VERSION"; foo2hp -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -310,12 +315,18 @@ case "$BPP" in
fi
case "$GAMMAFILE" in
default)
- if is32 $GSBIN; then
- GAMMAFILE=km2430_2.icm
- GAMMAFILE=hpclj2600n-1.icm
- else
- GAMMAFILE=hpclj2600n-0.icm
- fi
+ case "$MODEL" in
+ 0)
+ if [ $SEGFAULT = 0 ]; then
+ GAMMAFILE=hpclj2600n-1.icm
+ else
+ GAMMAFILE=hpclj2600n-0.icm
+ fi
+ ;;
+ 1)
+ GAMMAFILE=hp1215-argyll-0.icm
+ ;;
+ esac
;;
none) GAMMAFILE=;;
esac
@@ -330,15 +341,25 @@ case "$BPP" in
GSDEV="-sDEVICE=cups -dcupsColorSpace=6 -dcupsBitsPerColor=2"
GSDEV="$GSDEV -dcupsColorOrder=2"
fi
+ if [ $GSBIN = "gs.foo" ]; then
+ GSBIN=gs
+ fi
case "$GAMMAFILE" in
default)
- if is32 $GSBIN; then
- GAMMAFILE=km2430_2.icm
- GAMMAFILE=hpclj2600n-1.icm
- else
- GAMMAFILE=
- fi
+ case "$MODEL" in
+ 0)
+ if is32 $GSBIN; then
+ GAMMAFILE=km2430_2.icm
+ GAMMAFILE=hpclj2600n-1.icm
+ else
+ GAMMAFILE=
+ fi
+ ;;
+ 1)
+ GAMMAFILE=hp1215-argyll-0.icm
+ ;;
+ esac
;;
none) GAMMAFILE=;;
esac
@@ -347,6 +368,14 @@ case "$BPP" in
esac
#
+# Validate model code
+#
+case "$MODEL" in
+0|1) ;;
+*) error "Unknown model code $MODEL";;
+esac
+
+#
case "$QUALITY" in
0)
GSOPTS="-dCOLORSCREEN $GSOPTS"
@@ -355,10 +384,10 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
;;
wts)
- GSOPTS="-dCOLORSCREEN $GSOPTS"
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
@@ -459,26 +488,32 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
;;
- esac
- XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
PAPER=1; paper=letter;
set_clipping 2 80 2 80
@@ -535,6 +570,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -557,7 +595,8 @@ create_crd() {
|| error "Problem converting .ICM file to Postscript"
;;
esac
-
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
cat > $ICCTMP.usecie.ps <<-EOF
%!PS-Adobe-3.0
<</UseCIEColor true>>setpagedevice
@@ -610,6 +649,8 @@ case "$RES" in
2400x600) SCREEN=screen2400.ps;;
esac
+PSTOPS_OPTS="-n"
+
case "$COLORMODE" in
0|"")
# Monochrome
@@ -655,6 +696,10 @@ case "$COLORMODE" in
;;
esac
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
if [ "" != "$COLOR" ]; then
if [ "" = "$AIB" -a "" = "$BC" ]; then
# Faster, but can't handle AllIsBlack or BlackClears
@@ -688,10 +733,10 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
-sed 's#^[^/]*cupsPSLevel2#false#' | \
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null 2>&1) 3>&1 \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null 2>&1) 3>&1 \
| foo2hp -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
$COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
-J "$LPJOB" -U "$USER" \
diff --git a/foo2lava-wrapper.1in b/foo2lava-wrapper.1in
index 6433995..78c8498 100644
--- a/foo2lava-wrapper.1in
+++ b/foo2lava-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2lava-wrapper 1 "${MODpage}" "foo2lava-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2lava-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -204,7 +36,6 @@ Print in color (else monochrome).
Color correction mode [0].
.TS
n l .
-0 Best compromise
1 Photos (using m2300w CRDs)
2 Photos and text (using m2300w CRDs)
3 Graphics and text (using m2300w CRDs)
@@ -239,6 +70,7 @@ recycled 27
.BI \-p\0 paper
Paper size code to send to printer [2].
.TS
+box;
| n l | n l.
1 executive 25 A5
2 letter 26 A4
@@ -379,6 +211,7 @@ foo2lava-wrapper -c testpage.ps > testpage.zc
.SH SEE ALSO
.BR foo2lava (1),
.BR lavadecode (1)
+.BR opldecode (1)
.SH "AUTHOR"
Rick Richardson <rick.richardson@comcast.net>
.br
diff --git a/foo2lava-wrapper.in b/foo2lava-wrapper.in
index 8414feb..2647148 100755
--- a/foo2lava-wrapper.in
+++ b/foo2lava-wrapper.in
@@ -18,7 +18,7 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2lava-wrapper.in,v 1.21 2007/07/12 15:43:14 rick Exp $'
+VERSION='$Id: foo2lava-wrapper.in,v 1.36 2009/01/21 07:52:13 rick Exp $'
#
# Printer Notes:
@@ -56,6 +56,9 @@ Usage:
Normal Options:
-c Print in color (else monochrome)
+-C colormode Colormode [$COLORMODE]
+ 1=Photos, 2=Photo and text, 3=Graphics and text
+ 10=ICM color profile (using -G *.icm file)
-d duplex Duplex code to send to printer [$DUPLEX]
1=off, 2=longedge, 3=shortedge
-m media Media code to send to printer [$MEDIA]
@@ -148,8 +151,8 @@ nup() {
#
# N.B. := operator used here, when :- would be better, because "ash"
# doesn't have :-
-if gs8 -v >/dev/null 2>&1; then
- GSBIN=${GSBIN:-gs8}
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
else
GSBIN=${GSBIN:-gs}
fi
@@ -158,19 +161,10 @@ CMDLINE="$*"
DEBUG=0
DUPLEX=1
COLOR=
-COLORMODE=0
+COLORMODE=default
MODEL=0
-# What mode to use if the user wants us to pick the "best" mode
-case `$GSBIN --version` in
-7*) DEFAULTCOLORMODE=10
- DEFAULTCOLORMODE=2
- DEFAULTCOLORMODE=10
- ;;
-*) DEFAULTCOLORMODE=2
- DEFAULTCOLORMODE=10
- ;;
-esac
QUALITY=1
+QUALITY=wts
MEDIA=0
COPIES=1
PAPER=2
@@ -184,13 +178,27 @@ BC=
AIB=
NOPLANES=
COLOR2MONO=
-GAMMAFILE=
+GAMMAFILE=default
INTENT=0
GSOPTS=
EXTRAPAD=
SAVETONER=
NUP_ORIENT=
GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+7*) DEFAULTCOLORMODE=10
+ DEFAULTCOLORMODE=2
+ DEFAULTCOLORMODE=10
+ ;;
+8.1*)
+ QUALITY=1
+ DEFAULTCOLORMODE=10
+ ;;
+*) DEFAULTCOLORMODE=2
+ DEFAULTCOLORMODE=10
+ ;;
+esac
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
do
case $opt in
@@ -230,7 +238,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2lava -V; exit 0;;
+ V) echo "$VERSION"; foo2lava -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -253,6 +261,22 @@ if [ $# -ge 1 ]; then
exec < $1
fi
+
+#
+# Select the ghostscript device to use
+#
+if [ "" = "$COLOR" ]; then
+ GSDEV=-sDEVICE=pbmraw
+else
+ GSDEV=-sDEVICE=bitcmyk
+fi
+case "$GAMMAFILE" in
+default)
+ GAMMAFILE=km2530-jconner-d50.icm
+ ;;
+none) GAMMAFILE=;;
+esac
+
#
case "$QUALITY" in
0)
@@ -262,7 +286,10 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
@@ -361,27 +388,33 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
+ ;;
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
xmm=`dc -e "$XDIM 25.4 * 36 + 72/p"`
XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
- ;;
- esac
ymm=`dc -e "$YDIM 25.4 * 36 + 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
PAPER=101; paper=letter;
@@ -445,6 +478,7 @@ Custom*)
;;
*) error "Unimplemented paper code $PAPER";;
esac
+# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps
PAPERSIZE="-sPAPERSIZE=$paper";
case "$RES" in
@@ -461,6 +495,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -475,18 +512,42 @@ create_crd() {
#
ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
if [ -x $ICC2PS ]; then
- $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
- || error "Problem converting .ICM file to Postscript"
- cat > $ICCTMP.usecie.ps <<-EOF
- %!PS-Adobe-3.0
- <</UseCIEColor true>>setpagedevice
+ case "$GAMMAFILE" in
+ none.icm | */none.icm)
+ ;;
+ *)
+ $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
+ || error "Problem converting .ICM file to Postscript"
+ ;;
+ esac
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
+ cat > $ICCTMP.usecie.ps <<-EOF
+ %!PS-Adobe-3.0
+ <</UseCIEColor true>>setpagedevice
EOF
- cat > $ICCTMP.selcrd.ps <<-EOF
- /Current /ColorRendering findresource setcolorrendering
+ if [ "$QUALITY" = wts ]; then
+ cat >> $ICCTMP.usecie.ps <<-EOF
+ << /UseWTS true >> setuserparams
+ <<
+ /AccurateScreens true
+ /HalftoneType 1
+ /HalftoneName (Round Dot Screen) cvn
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
+ /Frequency 137
+ /Angle 37
+ >> sethalftone
+ EOF
+ fi
+ cat > $ICCTMP.selcrd.ps <<-EOF
+ /Current /ColorRendering findresource setcolorrendering
EOF
- GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps"
+ case "$GAMMAFILE" in
+ none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
+ *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
+ esac
else
- GAMMFILE=
+ GAMMFILE=
fi
}
@@ -501,7 +562,7 @@ if [ "" = "$COLOR" ]; then
GAMMAFILE=
else
case "$COLORMODE" in
- 0) COLORMODE=$DEFAULTCOLORMODE;;
+ default) COLORMODE=$DEFAULTCOLORMODE;;
esac
fi
@@ -512,8 +573,10 @@ case "$RES" in
2400x600) SCREEN=screen2400.ps;;
esac
+PSTOPS_OPTS="-n"
+
case "$COLORMODE" in
-"")
+0|"")
# Monochrome
;;
10|icm)
@@ -521,6 +584,9 @@ case "$COLORMODE" in
AIB=-A
BC=-B
case "$GAMMAFILE" in
+ none.icm | */none.icm)
+ create_crd
+ ;;
*.icm|*.ICM|*.icc|*.ICC)
#
# Its really an .ICM file, not a gamma file.
@@ -536,9 +602,6 @@ case "$COLORMODE" in
GAMMAFILE=
fi
;;
- none)
- GAMMAFILE=
- ;;
esac
;;
1|photo)
@@ -583,13 +646,17 @@ case "$COLORMODE" in
;;
esac
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
if [ "" != "$COLOR" ]; then
if [ "" = "$AIB" -a "" = "$BC" ]; then
# Faster, but can't handle AllIsBlack or BlackClears
- GSDEV=-sDEVICE=pksmraw
+ : #GSDEV=-sDEVICE=pksmraw
else
# Can't handle different size pages
- GSDEV=-sDEVICE=bitcmyk
+ : #GSDEV=-sDEVICE=bitcmyk
fi
fi
@@ -612,9 +679,10 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
| foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
-z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
-J "$LPJOB" -U "$USER" \
diff --git a/foo2lava.1in b/foo2lava.1in
index cc43e8e..a0e323e 100644
--- a/foo2lava.1in
+++ b/foo2lava.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2lava 1 "${MODpage}" "foo2lava ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2lava Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, LAVAFLOW) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -233,6 +65,7 @@ recycled 27
.BI \-p\0 paper
Paper code to send to printer [2].
.TS
+box;
| n l | n l.
1 executive 25 A5
2 letter 26 A4
diff --git a/foo2lava.c b/foo2lava.c
index 4c54f41..a640e41 100644
--- a/foo2lava.c
+++ b/foo2lava.c
@@ -13,6 +13,7 @@ such as these:
Model 1:
- Konica Minolta magicolor 2480 MF B/W and color
+ NOTE: Copies is unimplented!
AUTHORS
It also uses Markus Kuhn's jbig-kit compression library (included, but
@@ -49,7 +50,7 @@ yourself.
*/
-static char Version[] = "$Id: foo2lava.c,v 1.26 2007/07/19 02:44:31 rick Exp $";
+static char Version[] = "$Id: foo2lava.c,v 1.33 2008/09/22 22:38:52 rick Exp $";
#include <stdio.h>
#include <stdlib.h>
@@ -63,6 +64,15 @@ static char Version[] = "$Id: foo2lava.c,v 1.26 2007/07/19 02:44:31 rick Exp $";
#endif
#include "jbig.h"
+typedef enum
+{
+ DMDUPLEX_OFF = 1,
+ DMDUPLEX_LONGEDGE = 2,
+ DMDUPLEX_SHORTEDGE = 3,
+ DMDUPLEX_MANUALLONG = 4,
+ DMDUPLEX_MANUALSHORT= 5
+} DMDUPLEX;
+
/*
* Command line options
*/
@@ -409,9 +419,9 @@ write_plane(int planeNum, BIE_CHAIN **root, FILE *fp)
switch (planeNum)
{
- case 3: x = 0x00FFFF; break;
+ case 1: x = 0x00FFFF; break;
case 2: x = 0xFF00FF; break;
- case 1: x = 0xFFFF00; break;
+ case 3: x = 0xFFFF00; break;
}
fprintf(fp, "RasterObject.Planes=%06X,0,0,0,0,0,0;", x);
@@ -478,24 +488,27 @@ write_plane(int planeNum, BIE_CHAIN **root, FILE *fp)
free_chain(*root);
- switch (planeNum)
+ if (Model == MODEL_2530DL)
{
- case 0: case 4:
- fprintf(fp, "\033*x%dK", Dots[3]);
- fprintf(fp, "\033*x%dW", TotalDots - Dots[3]);
- break;
- case 3:
- fprintf(fp, "\033*x%dY", Dots[0]);
- fprintf(fp, "\033*x%dU", TotalDots - Dots[0]);
- break;
- case 2:
- fprintf(fp, "\033*x%dM", Dots[1]);
- fprintf(fp, "\033*x%dV", TotalDots - Dots[1]);
- break;
- case 1:
- fprintf(fp, "\033*x%dC", Dots[2]);
- fprintf(fp, "\033*x%dZ", TotalDots - Dots[2]);
- break;
+ switch (planeNum)
+ {
+ case 0: case 4:
+ fprintf(fp, "\033*x%dK", Dots[3]);
+ fprintf(fp, "\033*x%dW", TotalDots - Dots[3]);
+ break;
+ case 1:
+ fprintf(fp, "\033*x%dC", Dots[0]);
+ fprintf(fp, "\033*x%dZ", TotalDots - Dots[0]);
+ break;
+ case 2:
+ fprintf(fp, "\033*x%dM", Dots[1]);
+ fprintf(fp, "\033*x%dV", TotalDots - Dots[1]);
+ break;
+ case 3:
+ fprintf(fp, "\033*x%dY", Dots[2]);
+ fprintf(fp, "\033*x%dU", TotalDots - Dots[2]);
+ break;
+ }
}
return 0;
@@ -608,19 +621,33 @@ write_page(BIE_CHAIN **root, BIE_CHAIN **root2,
start_page(root, nbie, ofp);
- if (root3)
- write_plane(3, root3, ofp);
- if (root2)
- write_plane(2, root2, ofp);
- if (root)
+ switch (Model)
{
- if (OutputStartPlane)
- write_plane(nbie == 1 ? 4 : 1, root, ofp);
- else
- write_plane(nbie == 1 ? 0 : 1, root, ofp);
+ case MODEL_2530DL:
+ if (root3) write_plane(3, root3, ofp);
+ if (root2) write_plane(2, root2, ofp);
+ if (root)
+ {
+ if (OutputStartPlane)
+ write_plane(nbie == 1 ? 4 : 1, root, ofp);
+ else
+ write_plane(nbie == 1 ? 0 : 1, root, ofp);
+ }
+ if (root4) write_plane(4, root4, ofp);
+ break;
+ case MODEL_2480MF:
+ if (root)
+ {
+ if (OutputStartPlane)
+ write_plane(nbie == 1 ? 4 : 1, root, ofp);
+ else
+ write_plane(nbie == 1 ? 0 : 1, root, ofp);
+ }
+ if (root2) write_plane(2, root2, ofp);
+ if (root3) write_plane(3, root3, ofp);
+ if (root4) write_plane(4, root4, ofp);
+ break;
}
- if (root4)
- write_plane(4, root4, ofp);
end_page(ofp);
return 0;
@@ -726,7 +753,7 @@ start_doc(FILE *fp)
fprintf(fp, "\033&l%dS", Duplex-1);
fprintf(fp, "\033&l%dG", 0);
fprintf(fp, "\033&u%dD", ResX);
- fprintf(fp, "\033&l%dX", 1);
+ fprintf(fp, "\033&l%dX", Copies);
fprintf(fp, "\033&x%dX", 1);
break;
case MODEL_2480MF:
@@ -1119,7 +1146,7 @@ cmyk_pages(FILE *ifp, FILE *ofp)
goto done;
++PageNum;
- if (Duplex == 2 && (PageNum & 1) == 0)
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
if ((PageNum & 1) == 0 && EvenPages)
@@ -1293,9 +1320,9 @@ pksm_pages(FILE *ifp, FILE *ofp)
}
}
- if (Duplex == 2 && (PageNum & 1) == 0)
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(plane[i], plane[i] + bpl * h - 1, Mirror1);
- if (Duplex == 4 && (PageNum & 1) == 0)
+ if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
rotate_bytes_180(plane[i], plane[i] + bpl * h - 1, Mirror1);
}
@@ -1379,12 +1406,12 @@ pbm_pages(FILE *ifp, FILE *ofp)
error(1, "Premature EOF(pbm) on input stream\n");
++PageNum;
- if (Duplex == 2 && (PageNum & 1) == 0)
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
if ((PageNum & 1) == 0 && EvenPages)
{
- if (Duplex == 4)
+ if (Duplex == DMDUPLEX_MANUALLONG)
rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
SeekRec[SeekIndex].b = ftell(EvenPages);
pbm_page(buf, w, h, EvenPages);
@@ -1435,13 +1462,13 @@ parse_xy(char *str, int *xp, int *yp)
if (!str || str[0] == 0) return -1;
- *xp = strtoul(str, &p, 0);
+ *xp = strtoul(str, &p, 10);
if (str == p) return -2;
while (*p && (*p < '0' || *p > '9'))
++p;
str = p;
if (str[0] == 0) return -3;
- *yp = strtoul(str, &p, 0);
+ *yp = strtoul(str, &p, 10);
if (str == p) return -4;
return (0);
}
@@ -1564,7 +1591,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (getenv("DEVICE_URL"))
+ if (getenv("DEVICE_URI"))
IsCUPS = 1;
if (0)//Model == MODEL_HP1020)
@@ -1580,8 +1607,8 @@ main(int argc, char *argv[])
switch (Duplex)
{
- case 4:
- case 5:
+ case DMDUPLEX_MANUALLONG:
+ case DMDUPLEX_MANUALSHORT:
EvenPages = tmpfile();
break;
}
diff --git a/foo2oak-wrapper.1in b/foo2oak-wrapper.1in
index 9062baf..cca1425 100644
--- a/foo2oak-wrapper.1in
+++ b/foo2oak-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2oak-wrapper 1 "${MODpage}" "foo2oak-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2oak-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, OAKT) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -184,7 +16,8 @@ foo2oak-wrapper \- Convert Postscript into an OAKT printer stream
is a Foomatic compatible printer wrapper for the \fBfoo2oak\fP printer driver.
This script reads a Postscript \fIps-file\fP or standard input
and converts it to Oak Technology OAKT printer format
-for driving the HP Color LaserJet 1500 laser printer
+for driving the HP Color LaserJet 1500 laser printer,
+Kyocera KM-1636/KM-2035 copiers,
and other OAKT-based printers.
.P
This script can be used in a standalone fashion, but is intended to
@@ -205,20 +38,48 @@ Print in color (else monochrome).
.BI \-m\0 media
Media code to send to printer [1].
.TS
-| n l | n l .
-1 standard 259 letterhead
-2 transparency 261 thickstock
-3 glossy 262 postcard
-257 envelope 263 labels
+l l l
+l n n.
+_
+Media HP CLJ 1500 KM-1635
+ -z0 -z1
+_
+autoselect 0 0
+plain 1 1
+preprinted 2 2
+letterhead 3 3
+transparency 4 4
+prepunched 5 5
+labels 6 6
+bond 7 7
+recycled 8 8
+color 9 9
+cardstock 10 10
+envelope 11 11
+light 13 na
+tough 14 na
+vellum na 15
+rough na 16
+thick na 19
+highqual na 20
.TE
.TP
.BI \-p\0 paper
Paper size code to send to printer [1].
.TS
+box;
| n l | n l.
-1 letter 9 A4
-5 legal 11 A5
-7 executive 13 B5
+1 letter 3 ledger
+5 legal 6 statement
+7 executive 8 A3
+9 A4 11 A5
+12 B4 13 B5jis
+14 folio 19 env9
+20 env10 27 envDL
+28 envC5 30 envC4
+37 envMonarch 257 A6
+258 B6 259 B5iso
+260 env6
.TE
.TP
.BI \-n\0 copies
@@ -278,6 +139,10 @@ l l.
2 only send X clipping amount
3 send both X and Y clipping amounts
.TE
+.TP
+.BI \-z\0 model
+Model is 0 for the HP Color LaserJet 1500,
+and 1 for the Kyocera KM-1635/KM-2035 copiers. The default is 0.
.SS Color Tweaking Options
These are the options used to control the quality of color output.
Color correction is currently a WORK IN PROGRESS.
diff --git a/foo2oak-wrapper.in b/foo2oak-wrapper.in
index ce735ce..38d6432 100644
--- a/foo2oak-wrapper.in
+++ b/foo2oak-wrapper.in
@@ -18,7 +18,15 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2oak-wrapper.in,v 1.28 2007/06/11 00:48:32 rick Exp $'
+VERSION='$Id: foo2oak-wrapper.in,v 1.45 2009/01/11 12:21:46 rick Exp $'
+
+#
+# Printer Notes:
+#
+# HP Color LaserJet 1500: -z0 (mirror bytes)
+#
+# Kyocera Mita KM-1635: -z1 (rotate 90)
+#
PROGNAME="$0"
BASENAME=`basename $PROGNAME`
@@ -30,7 +38,7 @@ PATH=$PATH:/sw/bin:/opt/local/bin
# Log the command line, for debugging and problem reports
#
if [ -x /usr/bin/logger ]; then
- logger -t "$BASENAME" -p lpr.info -- "foo2oak-wrapper $@" </dev/null
+ logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
fi
usage() {
@@ -49,8 +57,12 @@ Normal Options:
0=auto 1=plain 2=preprinted 3=letterhead 4=graytrans
5=prepunched 6=labels 7=bond 8=recycled 9=color
10=cardstock 11=heavy 12=envelope 13=light 14=tough
+ 15=vellum 16=rough 19=thick 20=highqual
-p paper Paper code [$PAPER]
- 1=letter, 5=legal, 7=executive, 9=A4, 11=A5, 13=B5jis
+ 1=letter, 3=ledger, 5=legal, 6=statement, 7=executive,
+ 8=A3, 9=A4, 11=A5, 12=B4, 13=B5jis, 14=folio, 19=env9,
+ 20=env10, 27=envDL, 28=envC5, 30=envC4, 37=envMonarch,
+ 257=A6, 258=B6, 259=B5iso, 260=env6
-n copies Number of copies [$COPIES]
-r <xres>x<yres> Set device resolution in pixels/inch [$RES]
-s source Source code to send to printer [$SOURCE]
@@ -65,6 +77,7 @@ Printer Tweaking Options:
-l <xoff>x<yoff> Set offset of lower right printable in pixels [varies]
-L mask Send logical clipping values from -u/-l in ZjStream [3]
0=no, 1=Y, 2=X, 3=XY
+-z model Model: 0=HP CLJ 1500, 1=KM-1635/KM-2035 [$MODEL]
Color Tweaking Options:
-g gsopts Additional options to pass to Ghostscript, such as
@@ -122,13 +135,26 @@ nup() {
#
# Process the options
#
+
+# Try to use a local copy of GhostScript 8.54, if available. Otherwise,
+# fallback to whatever the Linux distro has installed (usually 7.07)
+#
+# N.B. := operator used here, when :- would be better, because "ash"
+# doesn't have :-
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
+else
+ GSBIN=${GSBIN:-gs}
+fi
+
BPP=1
-GSBIN=gs
CMDLINE="$*"
DEBUG=0
DUPLEX=1
COLOR=
-QUALITY=1
+COLORMODE=default
+MODEL=0
+QUALITY=wts
MEDIA=1
COPIES=1
PAPER=1
@@ -141,12 +167,23 @@ CLIP_LOG=
BC=
AIB=
COLOR2MONO=
-GAMMAFILE=
+GAMMAFILE=default
INTENT=0
GSOPTS=
-GSDEV=-sDEVICE=pbmraw
NUP_ORIENT=
-while getopts "1:23456789o:b:cd:g:l:u:L:m:n:p:q:r:s:ABS:D:G:I:Vh?" opt
+GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+7*) DEFAULTCOLORMODE=10
+ ;;
+8.1*)
+ DEFAULTCOLORMODE=10
+ QUALITY=1
+ ;;
+*) DEFAULTCOLORMODE=10
+ ;;
+esac
+while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:z:ABS:D:G:I:Vh?" opt
do
case $opt in
b) BPP=$OPTARG;;
@@ -159,11 +196,13 @@ do
q) QUALITY="$OPTARG";;
r) RES="$OPTARG";;
s) SOURCE="$OPTARG";;
+ z) MODEL="$OPTARG";;
l) CLIP_LR="-l $OPTARG";;
u) CLIP_UL="-u $OPTARG";;
L) CLIP_LOG="-L $OPTARG";;
A) AIB=-A;;
B) BC=-B;;
+ C) COLORMODE="$OPTARG";;
S) COLOR2MONO="-S$OPTARG";;
D) DEBUG="$OPTARG";;
G) GAMMAFILE="$OPTARG";;
@@ -180,7 +219,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2oak -V; exit 0;;
+ V) echo "$VERSION"; foo2oak -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -198,7 +237,7 @@ shift `expr $OPTIND - 1`
#
if [ $# -ge 1 ]; then
if [ "$LPJOB" = "" ]; then
- LPJOB="$1"
+ : # LPJOB="$1"
fi
exec < $1
fi
@@ -232,11 +271,23 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
#
+# Validate model code
+#
+case "$MODEL" in
+0) MIRROR=1; ROTATE90=0;;
+1) MIRROR=0; ROTATE90=1;;
+*) error "Unknown model code $MODEL";;
+esac
+
+#
# Validate media code
#
case "$MEDIA" in
@@ -244,7 +295,7 @@ case "$MEDIA" in
1|plain) MEDIA=1;;
2|preprinted) MEDIA=2;;
3|letterhead) MEDIA=3;;
-4|gratrans*) MEDIA=4;;
+4|transparency) MEDIA=4;;
5|prepunched) MEDIA=5;;
6|labels) MEDIA=6;;
7|bond) MEDIA=7;;
@@ -255,6 +306,11 @@ case "$MEDIA" in
12|envelope) MEDIA=12;;
13|light) MEDIA=13;;
14|tough) MEDIA=14;;
+
+15|vellum) MEDIA=15;;
+16|rough) MEDIA=16;;
+19|thick) MEDIA=19;;
+20|highqual) MEDIA=20;;
[0-9]*) ;;
*) error "Unknown media code $MEDIA";;
esac
@@ -264,7 +320,7 @@ esac
#
case "$SOURCE" in
1|tray1) SOURCE=1;;
-4|manual) SOURCE=4;;
+4|manual|mp) SOURCE=4;;
7|auto) SOURCE=7;;
[0-9]*) ;;
*) error "Unknown source code $SOURCE";;
@@ -326,57 +382,127 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
;;
- esac
- XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
- PAPER=1; paper=letter;
+ PAPER=296; paper=letter;
set_clipping 2 100 2 100
;;
1|letter) PAPER=1; paper=letter; XDIM="10200"; YDIM="6600"
set_clipping 140 100 140 100
;;
+3|ledger) PAPER=3; paper=ledger; XDIM="20400"; YDIM="6600"
+ set_clipping 140 100 140 100
+ ;;
5|legal) PAPER=5; paper=legal; XDIM="10200"; YDIM="8400"
set_clipping 140 100 140 100
;;
+6|statement) PAPER=6; paper=statement; XDIM="6600"; YDIM="5100"
+ set_clipping 140 100 140 100
+ ;;
7|executive) PAPER=7; paper=executive; XDIM="8700"; YDIM="6300"
set_clipping 140 100 140 100
;;
+8|a3|A3) PAPER=8; paper=a3; XDIM="19842"; YDIM="7014"
+ set_clipping 160 100 160 100
+ ;;
9|a4|A4) PAPER=9; paper=a4; XDIM="9920"; YDIM="7014"
set_clipping 160 100 160 100
;;
11|a5|A5) PAPER=11; paper=a5; XDIM="6992"; YDIM="4960"
set_clipping 140 100 140 100
;;
-13|b5jis|B5JIS) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070"
+12|b4|B4) PAPER=12; paper=b4; XDIM="12142"; YDIM="8598"
+ set_clipping 140 100 140 100
+ ;;
+13|b5jis|B5jis) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070"
+ set_clipping 140 100 140 100
+ ;;
+14|folio|Folio) PAPER=14; paper=folio; XDIM="9922"; YDIM="7796"
+ set_clipping 140 100 140 100
+ ;;
+19|env9|"env#9")
+ PAPER=19; paper=env9; XDIM="4650"; YDIM="5362"
+ set_clipping 140 100 140 100
+ ;;
+20|env10|"env#10")
+ PAPER=20; paper=env10; XDIM="4950"; YDIM="5700"
+ set_clipping 140 100 140 100
+ ;;
+27|envDL) PAPER=27; paper=envDL; XDIM="5200"; YDIM="5200"
+ set_clipping 140 100 140 100
+ ;;
+28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408"
+ set_clipping 140 100 140 100
+ ;;
+30|envC4) PAPER=30; paper=envC4; XDIM="10818"; YDIM="7654"
+ set_clipping 140 100 140 100
+ ;;
+#34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892"
+# set_clipping 140 100 140 100
+# ;;
+37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500"
+ set_clipping 140 100 140 100
+ ;;
+257|a6|A6) PAPER=257; paper=a6; XDIM="4961"; YDIM="3496"
+ set_clipping 140 100 140 100
+ ;;
+258|b6|B6) PAPER=258; paper=b6; XDIM="6048"; YDIM="4300"
+ set_clipping 140 100 140 100
+ ;;
+259|b5iso|B5iso)
+ PAPER=259; paper=b5iso; XDIM="8516"; YDIM="5906"
+ set_clipping 140 100 140 100
+ ;;
+260|env6|"env#6")
+ PAPER=260; paper=env6; XDIM="4356"; YDIM="3900"
set_clipping 140 100 140 100
;;
*) error "Unimplemented paper code $PAPER";;
esac
+# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps
PAPERSIZE="-sPAPERSIZE=$paper";
+
case "$RES" in
600x600) XDIM=`expr $XDIM / 2`;;
1200x600) ;;
2400x600) XDIM=`expr $XDIM \* 2`;;
esac
+if [ $ROTATE90 = 1 ]; then
+ tmp=$XDIM
+ XDIM=$YDIM
+ YDIM=$tmp
+ case "$RES" in
+ 600x600) YDIMpoints=`dc -e "6k $YDIM 600 / 72 *p"`;;
+ 1200x600) YDIMpoints=`dc -e "6k $YDIM 1200 / 72 *p"`;;
+ 2400x600) YDIMpoints=`dc -e "6k $YDIM 2400 / 72 *p"`;;
+ esac
+fi
DIM="${XDIM}x${YDIM}"
#
@@ -386,6 +512,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -400,16 +529,40 @@ create_crd() {
#
ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
if [ -x $ICC2PS ]; then
- $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
- || error "Problem converting .ICM file to Postscript"
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ ;;
+ *)
+ $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
+ || error "Problem converting .ICM file to Postscript"
+ ;;
+ esac
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
cat > $ICCTMP.usecie.ps <<-EOF
%!PS-Adobe-3.0
<</UseCIEColor true>>setpagedevice
EOF
+ if [ "$QUALITY" = wts ]; then
+ cat >> $ICCTMP.usecie.ps <<-EOF
+ << /UseWTS true >> setuserparams
+ <<
+ /AccurateScreens true
+ /HalftoneType 1
+ /HalftoneName (Round Dot Screen) cvn
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
+ /Frequency 137
+ /Angle 37
+ >> sethalftone
+ EOF
+ fi
cat > $ICCTMP.selcrd.ps <<-EOF
/Current /ColorRendering findresource setcolorrendering
EOF
- GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps"
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
+ *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
+ esac
else
GAMMFILE=
fi
@@ -420,151 +573,66 @@ if [ $DEBUG -gt 0 ]; then
else
ICCTMP=/tmp/icc$$
fi
-case "$GAMMAFILE" in
-*.icm|*.ICM|*.icc|*.ICC)
- #
- # Its really an .ICM file, not a gamma file.
- #
- # The file can be a full path name, or the name of a file in $SHARE/icm/
- #
- if [ "$COLOR" = "" ]; then
- GAMMAFILE=
- elif [ -r "$GAMMAFILE" ]; then
- create_crd
- elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
- GAMMAFILE="$SHARE/icm/$GAMMAFILE"
- create_crd
- else
- GAMMAFILE=
- fi
- ;;
-esac
-#
-# Use a Well Tempered Screen in quality mode 2.
-# from Karl Putland <karl@putland.linux-site.net>
-#
-# NOTE from Rick: Karl abandoned this approach.
-#
-create_wts() {
- #
- # Screen frequencies
- #
- C_FREQ="120"
- M_FREQ="123.33"
- Y_FREQ="126.85"
- K_FREQ="143.22"
-
- case "$RES" in
- 600x600) MUL=0.50;;
- 1200x600) MUL=0.75;;
- 2400x600) MUL=1.00;;
- *) MUL=0.50;;
+if [ "" = "$COLOR" ]; then
+ COLORMODE=
+ GAMMAFILE=
+else
+ case "$COLORMODE" in
+ default) COLORMODE=$DEFAULTCOLORMODE;;
+ esac
+ case "$GAMMAFILE" in
+ default) GAMMAFILE=hpclj2600n-1.icm;;
esac
+fi
- cat > $ICCTMP.wts.ps <<-EOF
- %!PS-Adobe-3.0
- << /UseWTS true >> setuserparams
- <<
- /HalftoneType 5
- /Cyan <<
- /AccurateScreens true
- /HalftoneType 1
- /SpotFunction {
- % 180 mul cos exch 180 mul cos add 2 div
- abs exch abs 2 dup add 0.75 le
- { 2 exp exch 2 exp add 1 exch sub }
- { 2 dup add 1.23 le
- { exch 0.76 mul add 1 exch sub }
- { 1 sub 2 exp exch 1 sub 2 exp add 1 sub }
- ifelse
- }
- ifelse
- }
- /TransferFunction {1 exp}
- /Frequency $C_FREQ $MUL mul
- /Angle 98
- >>
- /Magenta <<
- /AccurateScreens true
- /HalftoneType 1
- /SpotFunction {
- % 180 mul cos exch 180 mul cos add 2 div
- abs exch abs 2 dup add 0.75 le
- { 2 exp exch 2 exp add 1 exch sub }
- { 2 dup add 1.23 le
- { exch 0.76 mul add 1 exch sub }
- { 1 sub 2 exp exch 1 sub 2 exp add 1 sub }
- ifelse
- }
- ifelse
- }
- /TransferFunction {0.45 exp}
- /Frequency $M_FREQ $MUL mul
- /Angle 51.5
- >>
- /Yellow <<
- /AccurateScreens true
- /HalftoneType 1
- /SpotFunction {
- % 180 mul cos exch 180 mul cos add 2 div
- abs exch abs 2 dup add 0.75 le
- { 2 exp exch 2 exp add 1 exch sub }
- { 2 dup add 1.23 le
- { exch 0.76 mul add 1 exch sub }
- { 1 sub 2 exp exch 1 sub 2 exp add 1 sub }
- ifelse
- }
- ifelse
- }
- /TransferFunction {0.45 exp}
- /Frequency $Y_FREQ $MUL mul
- /Angle 27
- >>
- /Black <<
- /AccurateScreens true
- /HalftoneType 1
- /SpotFunction {
- % 180 mul cos exch 180 mul cos add 2 div
- abs exch abs 2 dup add 0.75 le
- { 2 exp exch 2 exp add 1 exch sub }
- { 2 dup add 1.23 le
- { exch 0.76 mul add 1 exch sub }
- { 1 sub 2 exp exch 1 sub 2 exp add 1 sub }
- ifelse
- }
- ifelse
- }
- /TransferFunction {0.60 exp}
- /Frequency $K_FREQ $MUL mul
- /Angle 75
- >>
- /Default <<
- /AccurateScreens true
- /HalftoneType 1
- /SpotFunction {
- % 180 mul cos exch 180 mul cos add 2 div
- abs exch abs 2 dup add 0.75 le
- { 2 exp exch 2 exp add 1 exch sub }
- { 2 dup add 1.23 le
- { exch 0.76 mul add 1 exch sub }
- { 1 sub 2 exp exch 1 sub 2 exp add 1 sub }
- ifelse
- }
- ifelse
- }
- /TransferFunction {0.45 exp}
- /Frequency $Y_FREQ $MUL mul
- /Angle 27
- >>
- >> sethalftone
- EOF
+PSTOPS_OPTS="-n"
+if [ $ROTATE90 = 1 ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -h $YDIMpoints -r"
+fi
- GAMMAFILE="$GAMMAFILE $ICCTMP.wts.ps"
-}
+case "$COLORMODE" in
+0|"")
+ # Monochrome
+ ;;
+10|icm)
+ # Use old ICM method
+ AIB=-A
+ BC=-B
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ create_crd
+ ;;
+ *.icm|*.ICM|*.icc|*.ICC)
+ #
+ # Its really an .ICM file, not a gamma file.
+ #
+ # The file can be a full path name, or the name of a file in $SHARE/icm/
+ #
+ if [ -r "$GAMMAFILE" ]; then
+ create_crd
+ elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
+ GAMMAFILE="$SHARE/icm/$GAMMAFILE"
+ create_crd
+ else
+ GAMMAFILE=
+ fi
+ ;;
+ esac
+esac
+
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
-if [ "$COLOR" != "" -a "$QUALITY" = 2 ]; then
- create_wts
+if [ "" != "$COLOR" ]; then
+ if [ "" = "$AIB" -a "" = "$BC" ]; then
+ # Faster, but can't handle AllIsBlack or BlackClears
+ GSDEV=-sDEVICE=pksmraw
+ else
+ # Can't handle different size pages
+ GSDEV=-sDEVICE=bitcmyk
+ fi
fi
#
@@ -586,23 +654,25 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null 2>/dev/null) 3>&1 \
-| dbgcmd foo2oak -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
- $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null 2>/dev/null) 3>&1 \
+| foo2oak -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
+ -M$MIRROR $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG \
-J "$LPJOB" -U "$USER" \
$BC $AIB $COLOR2MONO -D$DEBUG
#
# Log the command line, for debugging and problem reports
#
-if [ $DEBUG = 0 -a -x /usr/bin/logger ]; then
+if [ -x /usr/bin/logger ]; then
logger -t "$BASENAME" -p lpr.info -- \
- "gs $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS"
+ "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
logger -t "$BASENAME" -p lpr.info -- \
"foo2oak -r$RES -g$DIM -p$PAPER -m$MEDIA \
--n$COPIES -d$DUPLEX -s$SOURCE $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG \
+-n$COPIES -d$DUPLEX -s$SOURCE -M$MIRROR $COLOR -b$BPP \
+$CLIP_UL $CLIP_LR $CLIP_LOG \
$BC $AIB $COLOR2MONO"
fi
@@ -610,7 +680,7 @@ fi
# Remove cruft
#
if [ $DEBUG -eq 0 ]; then
- for i in crd.ps log usecie.ps selcrd.ps wts.ps
+ for i in crd.ps log usecie.ps selcrd.ps
do
file="$ICCTMP.$i"
[ -f $file ] && rm -f $file
diff --git a/foo2oak.1in b/foo2oak.1in
index a4383b1..45a520c 100644
--- a/foo2oak.1in
+++ b/foo2oak.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2oak 1 "${MODpage}" "foo2oak ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2oak Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, OAKT) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -190,7 +22,8 @@ OAKT printer stream
.B foo2oak
converts Ghostscript pbmraw or bitcmyk output formats to monochrome
or color OAKT streams,
-for driving the HP color Laserjet 1500 laser printer
+for driving the HP Color LaserJet 1500 laser printer,
+Kyocera KM-1636/KM-2035 copiers,
and other OAKT-based printers.
.SH COMMAND LINE OPTIONS
@@ -207,20 +40,47 @@ Set page dimensions in pixels [10200x6600].
.BI \-m\0 media
Media code to send to printer [1].
.TS
-| n l | n l .
-1 standard 259 letterhead
-2 transparency 261 thickstock
-3 glossy 262 postcard
-257 envelope 263 labels
+l l
+l n.
+_
+Media Code
+_
+autoselect 0
+plain 1
+preprinted 2
+letterhead 3
+transparency 4
+prepunched 5
+labels 6
+bond 7
+recycled 8
+color 9
+cardstock 10
+envelope 11
+light 13
+tough 14
+vellum 15
+rough 16
+thick 19
+highqual 20
.TE
.TP
.BI \-p\0 paper
Paper code to send to printer [1].
.TS
+box;
| n l | n l.
-1 letter 9 A4
-5 legal 11 A5
-7 executive 13 B5
+1 letter 3 ledger
+5 legal 6 statement
+7 executive 8 A3
+9 A4 11 A5
+12 B4 13 B5jis
+14 folio 19 env9
+20 env10 27 envDL
+28 envC5 30 envC4
+37 envMonarch 257 A6
+258 B6 259 B5iso
+260 env6
.TE
.TP
.BI \-n\0 copies
@@ -269,6 +129,10 @@ Turn off: conversion of C=1,M=1,Y=1 to pure black.
.TP
.BI \-B
Turn off: K=1 forces C,M,Y to 0.
+.TP
+.BI \-M\0 mirror
+Mirror bytes. Mirror is 0 for Kyocera KM-1635/KM-2035 and 1 for the
+HP Color LaserJet 1500. The default is 1.
.SS Debugging Options
These options are used for debugging \fBfoo2oak\fP.
.TP
diff --git a/foo2oak.c b/foo2oak.c
new file mode 100644
index 0000000..6a4151d
--- /dev/null
+++ b/foo2oak.c
@@ -0,0 +1,1889 @@
+/*
+
+GENERAL
+This program converts pbm (B/W) images, 2-bit pgm (grayscale), and
+1-bit- or 2-bit-per-pixel cmyk images (all produced by ghostscript)
+to Oak Technolgies JBIG format.
+
+With this utility, you can print to some HP printers, such as these:
+ - HP LaserJet 1500
+
+BUGS AND DEFICIENCIES
+ - Needs to do color correction
+ - Needs to support a better input color file format which includes
+ explicit page boundary indications.
+
+EXAMPLES
+
+AUTHORS
+Rick Richardson. It also uses Markus Kuhn's jbig-kit compression
+library (included, but also available at
+http://www.cl.cam.ac.uk/~mgk25/jbigkit/).
+
+You can contact the current author at mailto:rick.richardson@comcast.net
+
+LICENSE
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+If you want to use this program under different license conditions,
+then contact the author for an arrangement.
+
+It is possible that certain products which can be built using the jbig
+software module might form inventions protected by patent rights in
+some countries (e.g., by patents about arithmetic coding algorithms
+owned by IBM and AT&T in the USA). Provision of this software by the
+author does NOT include any licenses for any patents. In those
+countries where a patent license is required for certain applications
+of this software module, you will have to obtain such a license
+yourself.
+
+
+# ./usb_printerid /dev/usb/lp0
+GET_DEVICE_ID string:
+MFG:Hewlett-Packard;CMD:OAKRAS,DW-PCL;MDL:hp color LaserJet
+1500;CLS:PRINTER;DES:Hewlett-Packard color LaserJet
+1500;MEM:16MB;1284.4DL:4d,4e,1;MSZ:10000000;FDT:0;CAL:00020811213C568F02060C1825446BA800030914203F5B9901040C151E3E60AD;
+Status: 0x18
+
+*/
+
+/*
+ * TODO: Handle 2 bit mono and color output
+ */
+
+static char Version[] = "$Id: foo2oak.c,v 1.56 2008/05/03 14:30:40 rick Exp $";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include <time.h>
+#include "jbig.h"
+#include "oak.h"
+
+/*
+ * Command line options
+ */
+int Debug = 0;
+int ZeroTime = 0;
+int ResX = 600;
+int ResY = 600;
+int Bpp = 1;
+int PaperCode = OAK_PAPER_LETTER;
+int PageWidth = 600 * 8.5;
+int PageHeight = 600 * 11;
+int UpperLeftX = 0;
+int UpperLeftY = 0;
+int LowerRightX = 0;
+int LowerRightY = 0;
+int Copies = 1;
+int Duplex = 1;
+int SourceCode = OAK_SOURCE_AUTO;
+int MediaCode = OAK_MEDIA_AUTO;
+char *Username = NULL;
+char *Filename = NULL;
+int Mode = 0;
+ #define MODE_MONO 1
+ #define MODE_COLOR 2
+
+int Color2Mono = 0;
+int BlackClears = 1;
+int AllIsBlack = 1;
+
+int LogicalOffsetX = 0;
+int LogicalOffsetY = 0;
+
+#define LOGICAL_CLIP_X 2
+#define LOGICAL_CLIP_Y 1
+int LogicalClip = LOGICAL_CLIP_X | LOGICAL_CLIP_Y;
+
+int IsCUPS = 0;
+int Mirror = 1;
+
+/*
+ * I now believe this is a YMCK printer as far as plane output ordering goes.
+ */
+#define PL_C 2
+#define PL_M 1
+#define PL_Y 0
+#define PL_K 3
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" foo2oak [options] <pbmraw-file >OAKT-file\n"
+"\n"
+" Convert Ghostscript pbm format to a 1-bpp monochrome OAKT stream,\n"
+" for driving the HP LaserJet 1500 color laser printer\n"
+" and other OAKT-based black and white printers.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak\n"
+"\n"
+" foo2oak [options] <pgmraw-file >OAKT-file\n"
+"\n"
+" Convert Ghostscript pgm format to a 2-bpp monochrome OAKT stream,\n"
+" for driving the HP LaserJet 1500 color laser printer\n"
+" and other OAKT-based black and white printers.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -r600x600 -sDEVICE=pgmraw \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak\n"
+"\n"
+" foo2oak [options] <bitcmyk-file >OAKT-file\n"
+"\n"
+" Convert Ghostscript bitcmyk format to a 1-bpp color OAKT stream,\n"
+" for driving the HP LaserJet 1500 color laser printer.\n"
+" N.B. Color correction is expected to be performed by ghostscript.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak\n"
+"\n"
+"Normal Options:\n"
+"-b bits Bits per plane if autodetect doesn't work (1 or 2) [%d]\n"
+"-c Force color mode if autodetect doesn't work\n"
+//"-d duplex Duplex code to send to printer [%d]\n"
+//" 1=off, 2=longedge, 3=shortedge\n"
+"-g <xpix>x<ypix> Set page dimensions in pixels [%dx%d]\n"
+"-m media Media code to send to printer [%d]\n"
+" 0=auto 1=plain 2=preprinted 3=letterhead 4=transparency\n"
+" 5=prepunched 6=labels 7=bond 8=recycled 9=color\n"
+" 10=cardstock 11=heavy 12=envelope 13=light 14=tough\n"
+" 15=vellum 16=rough 19=thick 20=highqual\n"
+"-p paper Paper code to send to printer [%d]\n"
+" 1=letter, 3=ledger, 5=legal, 6=statement, 7=executive,\n"
+" 8=A3, 9=A4, 11=A5, 12=B4, 13=B5jis, 14=folio, 19=env9,\n"
+" 20=env10, 27=envDL, 28=envC5, 30=envC4, 37=envMonarch,\n"
+" 257=A6, 258=B6, 259=B5iso, 260=env6\n"
+"-n copies Number of copies [%d]\n"
+"-r <xres>x<yres> Set device resolution in pixels/inch [%dx%d]\n"
+"-s source Source code to send to printer [%d]\n"
+" 1=tray1 4=manual 7=auto\n"
+" Code numbers may vary with printer model\n"
+"-J filename Filename string to send to printer [%s]\n"
+"-U username Username string to send to printer [%s]\n"
+"\n"
+"Printer Tweaking Options:\n"
+"-u <xoff>x<yoff> Set offset of upper left printable in pixels [%dx%d]\n"
+"-l <xoff>x<yoff> Set offset of lower right printable in pixels [%dx%d]\n"
+"-L mask Send logical clipping values from -u/-l in ZjStream [%d]\n"
+" 0=no, 1=Y, 2=X, 3=XY\n"
+"-A Turn off: conversion of C=1,M=1,Y=1 to pure black\n"
+"-B Turn off: K=1 forces C,M,Y to 0\n"
+"-M mirror Mirror bytes (0=KM-1635/KM-2035, 1=HP CLJ 1500) [%d]\n"
+"\n"
+"Debugging Options:\n"
+"-S plane Output just a single color plane from a color print [all]\n"
+" %d=Cyan, %d=Magenta, %d=Yellow, %d=Black\n"
+"-D lvl Set Debug level [%d]\n"
+"-V Version %s\n"
+ // , Duplex
+ , Bpp
+ , PageWidth , PageHeight
+ , MediaCode
+ , PaperCode
+ , Copies
+ , ResX , ResY
+ , SourceCode
+ , Filename ? Filename : ""
+ , Username ? Username : ""
+ , UpperLeftX , UpperLeftY
+ , LowerRightX , LowerRightY
+ , LogicalClip
+ , Mirror
+ , PL_C, PL_M, PL_Y, PL_K
+ , Debug
+ , Version
+ );
+
+ exit(1);
+}
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+void
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+
+ if (fatal)
+ exit(fatal);
+}
+
+int
+parse_xy(char *str, int *xp, int *yp)
+{
+ char *p;
+
+ if (!str || str[0] == 0) return -1;
+
+ *xp = strtoul(str, &p, 10);
+ if (str == p) return -2;
+ while (*p && (*p < '0' || *p > '9'))
+ ++p;
+ str = p;
+ if (str[0] == 0) return -3;
+ *yp = strtoul(str, &p, 10);
+ if (str == p) return -4;
+ return (0);
+}
+
+/*
+ * bit mirroring arrays
+ */
+unsigned char Mirror1[256] =
+{
+ 0,128, 64,192, 32,160, 96,224, 16,144, 80,208, 48,176,112,240,
+ 8,136, 72,200, 40,168,104,232, 24,152, 88,216, 56,184,120,248,
+ 4,132, 68,196, 36,164,100,228, 20,148, 84,212, 52,180,116,244,
+ 12,140, 76,204, 44,172,108,236, 28,156, 92,220, 60,188,124,252,
+ 2,130, 66,194, 34,162, 98,226, 18,146, 82,210, 50,178,114,242,
+ 10,138, 74,202, 42,170,106,234, 26,154, 90,218, 58,186,122,250,
+ 6,134, 70,198, 38,166,102,230, 22,150, 86,214, 54,182,118,246,
+ 14,142, 78,206, 46,174,110,238, 30,158, 94,222, 62,190,126,254,
+ 1,129, 65,193, 33,161, 97,225, 17,145, 81,209, 49,177,113,241,
+ 9,137, 73,201, 41,169,105,233, 25,153, 89,217, 57,185,121,249,
+ 5,133, 69,197, 37,165,101,229, 21,149, 85,213, 53,181,117,245,
+ 13,141, 77,205, 45,173,109,237, 29,157, 93,221, 61,189,125,253,
+ 3,131, 67,195, 35,163, 99,227, 19,147, 83,211, 51,179,115,243,
+ 11,139, 75,203, 43,171,107,235, 27,155, 91,219, 59,187,123,251,
+ 7,135, 71,199, 39,167,103,231, 23,151, 87,215, 55,183,119,247,
+ 15,143, 79,207, 47,175,111,239, 31,159, 95,223, 63,191,127,255,
+};
+
+unsigned char Mirror2[256] =
+{
+ 0, 64,128,192, 16, 80,144,208, 32, 96,160,224, 48,112,176,240,
+ 4, 68,132,196, 20, 84,148,212, 36,100,164,228, 52,116,180,244,
+ 8, 72,136,200, 24, 88,152,216, 40,104,168,232, 56,120,184,248,
+ 12, 76,140,204, 28, 92,156,220, 44,108,172,236, 60,124,188,252,
+ 1, 65,129,193, 17, 81,145,209, 33, 97,161,225, 49,113,177,241,
+ 5, 69,133,197, 21, 85,149,213, 37,101,165,229, 53,117,181,245,
+ 9, 73,137,201, 25, 89,153,217, 41,105,169,233, 57,121,185,249,
+ 13, 77,141,205, 29, 93,157,221, 45,109,173,237, 61,125,189,253,
+ 2, 66,130,194, 18, 82,146,210, 34, 98,162,226, 50,114,178,242,
+ 6, 70,134,198, 22, 86,150,214, 38,102,166,230, 54,118,182,246,
+ 10, 74,138,202, 26, 90,154,218, 42,106,170,234, 58,122,186,250,
+ 14, 78,142,206, 30, 94,158,222, 46,110,174,238, 62,126,190,254,
+ 3, 67,131,195, 19, 83,147,211, 35, 99,163,227, 51,115,179,243,
+ 7, 71,135,199, 23, 87,151,215, 39,103,167,231, 55,119,183,247,
+ 11, 75,139,203, 27, 91,155,219, 43,107,171,235, 59,123,187,251,
+ 15, 79,143,207, 31, 95,159,223, 47,111,175,239, 63,127,191,255,
+};
+
+unsigned char Mirror4[256] =
+{
+ 0, 16, 32, 48, 64, 80, 96,112,128,144,160,176,192,208,224,240,
+ 1, 17, 33, 49, 65, 81, 97,113,129,145,161,177,193,209,225,241,
+ 2, 18, 34, 50, 66, 82, 98,114,130,146,162,178,194,210,226,242,
+ 3, 19, 35, 51, 67, 83, 99,115,131,147,163,179,195,211,227,243,
+ 4, 20, 36, 52, 68, 84,100,116,132,148,164,180,196,212,228,244,
+ 5, 21, 37, 53, 69, 85,101,117,133,149,165,181,197,213,229,245,
+ 6, 22, 38, 54, 70, 86,102,118,134,150,166,182,198,214,230,246,
+ 7, 23, 39, 55, 71, 87,103,119,135,151,167,183,199,215,231,247,
+ 8, 24, 40, 56, 72, 88,104,120,136,152,168,184,200,216,232,248,
+ 9, 25, 41, 57, 73, 89,105,121,137,153,169,185,201,217,233,249,
+ 10, 26, 42, 58, 74, 90,106,122,138,154,170,186,202,218,234,250,
+ 11, 27, 43, 59, 75, 91,107,123,139,155,171,187,203,219,235,251,
+ 12, 28, 44, 60, 76, 92,108,124,140,156,172,188,204,220,236,252,
+ 13, 29, 45, 61, 77, 93,109,125,141,157,173,189,205,221,237,253,
+ 14, 30, 46, 62, 78, 94,110,126,142,158,174,190,206,222,238,254,
+ 15, 31, 47, 63, 79, 95,111,127,143,159,175,191,207,223,239,255,
+};
+
+void
+mirror_bytes(unsigned char *sp, int bpl, unsigned char *mirror)
+{
+ unsigned char *ep = sp + bpl - 1;
+ unsigned char tmp;
+
+ while (sp < ep)
+ {
+ tmp = mirror[*sp];
+ *sp = mirror[*ep];
+ *ep = tmp;
+ ++sp;
+ --ep;
+ }
+ if (sp == ep)
+ *sp = mirror[*sp];
+}
+
+/*
+ * This creates a linked list of compressed data. The first item
+ * in the list is the BIH and is always 20 bytes in size. Each following
+ * item is 65536 bytes in length. The last item length is whatever remains.
+ */
+typedef struct _BIE_CHAIN{
+ unsigned char *data;
+ size_t len;
+ struct _BIE_CHAIN *next;
+} BIE_CHAIN;
+
+void
+free_chain(BIE_CHAIN *chain)
+{
+ BIE_CHAIN *next;
+ next = chain;
+ while ((chain = next))
+ {
+ next = chain->next;
+ if (chain->data)
+ free(chain->data);
+ free(chain);
+ }
+}
+
+void
+output_jbig(unsigned char *start, size_t len, void *cbarg)
+{
+ BIE_CHAIN *current, **root = (BIE_CHAIN **) cbarg;
+ int size = 65536; // Printer does strange things otherwise.
+
+ if ( (*root) == NULL)
+ {
+ (*root) = malloc(sizeof(BIE_CHAIN));
+ if (!(*root))
+ error(1, "Can't allocate space for chain\n");
+
+ (*root)->data = NULL;
+ (*root)->next = NULL;
+ (*root)->len = 0;
+ size = 20;
+ if (len != 20)
+ error(1, "First chunk must be BIH and 20 bytes long\n");
+ }
+
+ current = *root;
+ while (current->next)
+ current = current->next;
+
+ while (len > 0)
+ {
+ int amt, left;
+
+ if (!current->data)
+ {
+ current->data = malloc(size);
+ if (!current->data)
+ error(1, "Can't allocate space for compressed data\n");
+ }
+
+ left = size - current->len;
+ amt = (len > left) ? left : len;
+ memcpy(current->data + current->len, start, amt);
+ current->len += amt;
+ len -= amt;
+ start += amt;
+
+ if (current->len == size)
+ {
+ current->next = malloc(sizeof(BIE_CHAIN));
+ if (!current->next)
+ error(1, "Can't allocate space for chain\n");
+ current = current->next;
+ current->data = NULL;
+ current->next = NULL;
+ current->len = 0;
+ }
+ }
+}
+
+int
+oak_record(FILE *fp, int type, void *payload, int paylen)
+{
+ OAK_HDR hdr;
+ static char pad[] = "PAD_PAD_PAD_PAD_";
+ static int pageno = 0;
+
+ memcpy(hdr.magic, OAK_HDR_MAGIC, sizeof(hdr.magic));
+ hdr.type = type;
+ hdr.len = (sizeof(hdr) + paylen + 15) & ~0x0f;
+
+ fwrite(&hdr, 1, sizeof(hdr), fp);
+ if (payload && paylen)
+ fwrite(payload, 1, paylen, fp);
+ fwrite(pad, 1, hdr.len - (sizeof(hdr) + paylen), fp);
+
+ if (type == OAK_TYPE_START_PAGE)
+ {
+ ++pageno;
+ if (IsCUPS)
+ fprintf(stderr, "PAGE: %d %d\n", pageno, Copies);
+ }
+
+ return 0;
+}
+
+void
+start_doc(FILE *fp)
+{
+ OAK_OTHER recother;
+ OAK_TIME rectime;
+ OAK_FILENAME recfile;
+ time_t now;
+ struct tm *tm;
+
+ memset(&recother, 0, sizeof(recother));
+ recother.unk = 1; // TODO
+ strcpy(recother.string, "OTHER"); // TODO: Username????
+ oak_record(fp, OAK_TYPE_OTHER, &recother, sizeof(recother));
+
+ memset(&rectime, 0, sizeof(rectime));
+ time(&now);
+ if (ZeroTime)
+ now = 0;
+ strcpy(rectime.datetime, ctime(&now));
+ rectime.time_t = now;
+ tm = localtime(&now);
+ rectime.year = tm->tm_year + 1900;
+ rectime.tm_mon = tm->tm_mon;
+ rectime.tm_mday = tm->tm_mday;
+ rectime.tm_hour = tm->tm_hour;
+ rectime.tm_min = tm->tm_min;
+ rectime.tm_sec = tm->tm_sec;
+ oak_record(fp, OAK_TYPE_TIME, &rectime, sizeof(rectime));
+
+ memset(&recfile, 0, sizeof(recfile));
+ strcpy(recfile.string, Filename ? Filename : "stdin");
+ oak_record(fp, OAK_TYPE_FILENAME, &recfile, sizeof(recfile));
+
+#if 0
+ chunk_write(ZJT_START_DOC, nitems, size, fp);
+ item_uint32_write(ZJI_DMCOLLATE, 0, fp);
+ item_uint32_write(ZJI_DMDUPLEX, Duplex, fp);
+ item_uint32_write(ZJI_PAGECOUNT, 0, fp);
+ item_uint32_write(ZJI_QUANTITY, 1, fp);
+ // item_uint32_write(ZJI_QMS_FINEMODE,0, fp);
+ // item_uint32_write(ZJI_QMS_OUTBIN, 1, fp);
+
+ if (Username)
+ item_str_write(ZJI_MINOLTA_USERNAME, Username, fp);
+ if (Filename)
+ item_str_write(ZJI_MINOLTA_FILENAME, Filename, fp);
+#endif
+}
+
+void
+end_doc(FILE *fp)
+{
+ oak_record(fp, OAK_TYPE_END_DOC, NULL, 0);
+}
+
+void
+cmyk_planes(unsigned char *plane[4], unsigned char *raw, int w, int h)
+{
+ int rawbpl = (w + 1) / 2;
+ int bpl = (w + 7) / 8;
+ int i;
+ int x, y;
+ unsigned char byte;
+ unsigned char mask[8] = { 128, 64, 32, 16, 8, 4, 2, 1 };
+ int aib = AllIsBlack;
+ int bc = BlackClears;
+
+ for (i = 0; i < 4; ++i)
+ memset(plane[i], 0, bpl * h);
+
+ //
+ // Unpack the combined plane into individual color planes
+ //
+ // TODO: this can be speeded up using a 256 or 65536 entry lookup table
+ //
+ for (y = 0; y < h; ++y)
+ {
+ for (x = 0; x < w; ++x)
+ {
+ byte = raw[y*rawbpl + x/2];
+
+ if (aib && (byte & 0xE0) == 0xE0)
+ {
+ plane[PL_K][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x10)
+ {
+ plane[PL_K][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x80) plane[PL_C][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[PL_M][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[PL_Y][y*bpl + x/8] |= mask[x&7];
+ }
+ }
+ else
+ {
+ if (byte & 0x80) plane[PL_C][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[PL_M][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[PL_Y][y*bpl + x/8] |= mask[x&7];
+ }
+
+ ++x;
+ if (aib && (byte & 0x0E) == 0x0E)
+ {
+ plane[PL_K][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x1)
+ {
+ plane[PL_K][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x8) plane[PL_C][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[PL_M][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[PL_Y][y*bpl + x/8] |= mask[x&7];
+ }
+ }
+ else
+ {
+ if (byte & 0x8) plane[PL_C][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[PL_M][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[PL_Y][y*bpl + x/8] |= mask[x&7];
+ }
+ }
+ }
+}
+
+void
+pgm_subplanes(unsigned char *subplane[2], unsigned char *raw, int w, int h)
+{
+ int bpl = (w + 7) / 8;
+ int x, y;
+ unsigned char byte;
+ unsigned char ormask[8] = { 128, 64, 32, 16, 8, 4, 2, 1 };
+ unsigned char andmask[8] = { 0x7f, ~64, ~32, ~16, ~8, ~4, ~2, ~1 };
+ double *carry0, *carry1, *carrytmp;
+ double sum;
+ static int dir = 1;
+ int xs, xe;
+static int cnt[4];
+int tot = 0;
+
+ // TODO: convert this to scaled integer arithmetic
+
+ carry0 = (double *) calloc((w+2), sizeof(*carry0));
+ if (!carry0)
+ error(1, "Could not allocate space for carries\n");
+ carry1 = (double *) calloc((w+2), sizeof(*carry0));
+ if (!carry1)
+ error(1, "Could not allocate space for carries\n");
+ ++carry0; ++carry1;
+ for (y = 0; y < h; ++y)
+ {
+ if (dir > 0)
+ { dir = -1; xs = w-1; xe = -1; }
+ else
+ { dir = 1; xs = 0; xe = w; }
+ for (x = xs; x != xe; x += dir)
+ {
+ byte = 255 - raw[y*w + x];
+ sum = byte + carry0[x];
+
+++tot;
+ if (byte == 255 || sum >= 255)
+ { // Full black
+++cnt[2];
+ byte = 255;
+ subplane[1][y*bpl + x/8] |= ormask[x&7];
+ subplane[0][y*bpl + x/8] &= andmask[x&7];
+ }
+ else if (sum >= (70.0/100)*255)
+ { // Dark gray
+++cnt[3];
+ byte = 255;
+ subplane[1][y*bpl + x/8] |= ormask[x&7];
+ subplane[0][y*bpl + x/8] |= ormask[x&7];
+ }
+ else if (sum > 0)
+ { // Light gray
+++cnt[1];
+ byte = (40.0/100)*255;
+ subplane[1][y*bpl + x/8] &= andmask[x&7];
+ subplane[0][y*bpl + x/8] |= ormask[x&7];
+ }
+ else
+ { // Full white
+++cnt[0];
+ byte = 0;
+ subplane[1][y*bpl + x/8] &= andmask[x&7];
+ subplane[0][y*bpl + x/8] &= andmask[x&7];
+ }
+
+ // Compute the carry that must be distributed
+ sum -= byte;
+ carry0[x+dir] += (sum*7)/16.0;
+ carry1[x-dir] += (sum*3)/16.0;
+ carry1[x ] += (sum*5)/16.0;
+ carry1[x+dir] += (sum*1)/16.0;
+ }
+ // Advance carry buffers
+ carrytmp = carry0; carry0 = carry1; carry1 = carrytmp;
+ memset(carry1-1, 0, (w+2) * sizeof(*carry1));
+ }
+debug(1, "%d %d %d %d %d\n", tot, cnt[3], cnt[2], cnt[1], cnt[0]);
+
+ free(--carry0); free(--carry1);
+}
+
+void
+cups_planes(unsigned char *plane[4][2], unsigned char *raw, int w, int h)
+{
+ int bpl = (w + 7) / 8;
+ int i, sub;
+ int x, y;
+ unsigned char byte;
+ unsigned char mask[8] = { 128, 64, 32, 16, 8, 4, 2, 1 };
+ int aib = AllIsBlack;
+ int bc = BlackClears;
+
+ // Whitewash all planes
+ for (i = 0; i < 4; ++i)
+ for (sub = 0; sub < 2; ++sub)
+ memset(plane[i][sub], 0, bpl * h);
+
+ //
+ // Unpack the combined plane into individual color planes
+ //
+ // TODO: this can be speeded up using a 256 or 65536 entry lookup table
+ //
+ for (y = 0; y < h; ++y)
+ {
+ for (x = 0; x < w; ++x)
+ {
+ byte = raw[y*w + x];
+
+ if (aib && (byte & 0xfc) == 0xfc)
+ {
+ plane[PL_K][1][y*bpl + x/8] |= mask[x&7];
+ plane[PL_K][0][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (bc && (byte & 0x03) == 0x03)
+ {
+ plane[PL_K][1][y*bpl + x/8] |= mask[x&7];
+ plane[PL_K][0][y*bpl + x/8] |= mask[x&7];
+ }
+ else
+ {
+ if (byte & 128) plane[PL_C][1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 64) plane[PL_C][0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 32) plane[PL_M][1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 16) plane[PL_M][0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 8) plane[PL_Y][1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 4) plane[PL_Y][0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 2) plane[PL_K][1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 1) plane[PL_K][0][y*bpl + x/8] |= mask[x&7];
+ }
+ }
+ }
+}
+
+long JbgOptions[5] =
+{
+ /* Order */
+ JBG_ILEAVE | JBG_SMID,
+ /* Options */
+ JBG_DELAY_AT | JBG_LRLTWO | JBG_TPDON | JBG_TPBON,
+ /* L0 */
+ 128,
+ /* MX */
+ 16,
+ /* MY */
+ 0
+};
+
+void
+iswap32(void *p)
+{
+ char *cp = (char *) p;
+ char tmp;
+ tmp = cp[0];
+ cp[0] = cp[3];
+ cp[3] = tmp;
+ tmp = cp[1];
+ cp[1] = cp[2];
+ cp[2] = tmp;
+}
+
+static void
+fill_image_plane_unknown(OAK_IMAGE_PLANE *ip)
+{
+ int i;
+
+ for (i = 0; i < 16; ++i)
+ ip->unk[i] = i;
+}
+
+int
+cmyk_page(unsigned char *raw, int w, int h, FILE *ofp)
+{
+ WORD endpage_arg;
+ DWORD source_arg;
+ OAK_MEDIA recmedia;
+ OAK_COPIES reccopies;
+ OAK_PAPER recpaper;
+ OAK_IMAGE_MONO recmono;
+ OAK_IMAGE_COLOR reccolor;
+
+ int p, p0, p3;
+ int y;
+ int bpl = (w+7)/8;
+ unsigned char *plane[4];
+
+ debug(1, "cmyk_page: w=%d, h=%d, bitbpl=%d\n", w, h, bpl);
+
+ if (Color2Mono)
+ p0 = p3 = Color2Mono - 1;
+ else
+ { p0 = 0; p3 = 3; }
+ for (p = p0; p <= p3 ; ++p)
+ {
+ plane[p] = malloc(bpl * h);
+ if (!plane[p]) error(3, "Cannot allocate space for bit plane\n");
+ }
+
+ cmyk_planes(plane, raw, w, h);
+
+ oak_record(ofp, OAK_TYPE_START_PAGE, NULL, 0);
+
+ // TODO: page parms
+ source_arg = SourceCode;
+ oak_record(ofp, OAK_TYPE_SOURCE, &source_arg, sizeof(source_arg));
+
+ recmedia.media = MediaCode;
+ recmedia.unk8[0] = 2; // TODO
+ recmedia.unk8[1] = 0; // TODO
+ recmedia.unk8[2] = 0; // TODO
+ memset(recmedia.string, ' ', sizeof(recmedia.string));
+ strcpy(recmedia.string, ""); // TODO
+ oak_record(ofp, OAK_TYPE_MEDIA, &recmedia, sizeof(recmedia));
+
+ reccopies.copies = Copies;
+ reccopies.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_COPIES, &reccopies, sizeof(reccopies));
+
+ recpaper.paper = PaperCode;
+ recpaper.w1200 = PageWidth * 1200 / ResX;
+ recpaper.h1200 = PageHeight * 1200 / ResY;
+ recpaper.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_PAPER, &recpaper, sizeof(recpaper));
+
+ // image header (32/33)
+ if (p0 == p3)
+ {
+ recmono.plane.unk0 = 0;
+ recmono.plane.unk1 = 0;
+ recmono.plane.w = w; // TODO
+ recmono.plane.h = h; // TODO
+ recmono.plane.resx = ResX;
+ recmono.plane.resy = ResY;
+ recmono.plane.nbits = 1;
+ fill_image_plane_unknown(&recmono.plane);
+ oak_record(ofp, OAK_TYPE_IMAGE_MONO, &recmono, sizeof(recmono));
+ }
+ else
+ {
+ for (p = p0; p <= p3; ++p)
+ {
+ reccolor.plane[p].unk0 = 0;
+ reccolor.plane[p].unk1 = 0;
+ reccolor.plane[p].w = w; // TODO
+ reccolor.plane[p].h = h; // TODO
+ reccolor.plane[p].resx = ResX;
+ reccolor.plane[p].resy = ResY;
+ reccolor.plane[p].nbits = 1;
+ fill_image_plane_unknown(&reccolor.plane[p]);
+ }
+ oak_record(ofp, OAK_TYPE_IMAGE_COLOR, &reccolor, sizeof(reccolor));
+ }
+
+ oak_record(ofp, OAK_TYPE_START_IMAGE, NULL, 0);
+
+ //
+ // Mirror the bits in the image
+ //
+ // TODO: combine this operation with cmyk_planes
+ //
+ if (Mirror)
+ for (p = p0; p <= p3; ++p)
+ for (y = 0; y < h; ++y)
+ mirror_bytes(plane[p] + y*bpl, bpl, Mirror1);
+
+ //
+ // Output the image stripes
+ //
+ #define N 256
+ for (y = 0; y < h; y += N)
+ {
+ struct jbg_enc_state se;
+ unsigned char *bitmaps[1];
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ OAK_IMAGE_DATA recdata;
+ int chainlen;
+ int padlen;
+ static char pad[] = "PAD_PAD_PAD_PAD_";
+
+ int lines = (h-y) > N ? N : (h-y);
+
+ for (p = p0; p <= p3; ++p)
+ {
+ bitmaps[0] = plane[p] + y * ((w+7)/8);
+ chain = NULL;
+
+ memset(&recdata.bih, 0, sizeof(recdata.bih));
+ recdata.datalen = 0;
+ recdata.padlen = 0;
+ recdata.unk1C = 0; // TODO
+ recdata.y = y;
+ recdata.plane = p;
+ recdata.subplane = 0;
+
+ if (lines < N)
+ JbgOptions[2] = lines;
+ else
+ JbgOptions[2] = N;
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1, "Program error: missing BIH at start of chain\n");
+ chainlen = 0;
+ for (current = chain->next; current; current = current->next)
+ chainlen += current->len;
+
+ // Copy in the BIH
+ memcpy(&recdata.bih, chain->data, sizeof(recdata.bih));
+
+ // Oak is little-endian, but JBIG-kit is big-endian
+ iswap32(&recdata.bih.xd);
+ iswap32(&recdata.bih.yd);
+ iswap32(&recdata.bih.l0);
+
+ recdata.datalen = chainlen;
+ recdata.padlen = (recdata.datalen + 15) & ~0x0f;
+ oak_record(ofp, OAK_TYPE_IMAGE_DATA, &recdata, sizeof(recdata));
+ for (current = chain->next; current; current = current->next)
+ fwrite(current->data, 1, current->len, ofp);
+ padlen = recdata.padlen - recdata.datalen;
+ fwrite(pad, 1, padlen, ofp);
+
+ free_chain(chain);
+ }
+ }
+
+ for (p = p0; p <= p3; ++p)
+ free(plane[p]);
+
+ oak_record(ofp, OAK_TYPE_END_IMAGE, NULL, 0);
+
+ endpage_arg = 1; // Color
+ oak_record(ofp, OAK_TYPE_END_PAGE, &endpage_arg, sizeof(endpage_arg));
+
+ return 0;
+}
+
+int
+pbm_page(unsigned char *buf, int w, int h, FILE *ofp)
+{
+ WORD endpage_arg;
+ DWORD source_arg;
+ OAK_MEDIA recmedia;
+ OAK_COPIES reccopies;
+ OAK_PAPER recpaper;
+ OAK_IMAGE_MONO recmono;
+
+ int y;
+ int bpl = (w+7)/8;
+
+ oak_record(ofp, OAK_TYPE_START_PAGE, NULL, 0);
+
+ // TODO: page parms
+ source_arg = SourceCode;
+ oak_record(ofp, OAK_TYPE_SOURCE, &source_arg, sizeof(source_arg));
+
+ recmedia.media = MediaCode;
+ recmedia.unk8[0] = 2; // TODO
+ recmedia.unk8[1] = 0; // TODO
+ recmedia.unk8[2] = 0; // TODO
+ memset(recmedia.string, ' ', sizeof(recmedia.string));
+ strcpy(recmedia.string, ""); // TODO
+ oak_record(ofp, OAK_TYPE_MEDIA, &recmedia, sizeof(recmedia));
+
+ reccopies.copies = Copies;
+ reccopies.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_COPIES, &reccopies, sizeof(reccopies));
+
+ recpaper.paper = PaperCode;
+ recpaper.w1200 = PageWidth * 1200 / ResX;
+ recpaper.h1200 = PageHeight * 1200 / ResY;
+ recpaper.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_PAPER, &recpaper, sizeof(recpaper));
+
+ // image header (32/33)
+ recmono.plane.unk0 = 0;
+ recmono.plane.unk1 = 1;
+ recmono.plane.w = w; // TODO
+ recmono.plane.h = h; // TODO
+ recmono.plane.resx = ResX;
+ recmono.plane.resy = ResY;
+ recmono.plane.nbits = 1;
+ fill_image_plane_unknown(&recmono.plane);
+ oak_record(ofp, OAK_TYPE_IMAGE_MONO, &recmono, sizeof(recmono));
+
+ oak_record(ofp, OAK_TYPE_START_IMAGE, NULL, 0);
+
+ //
+ // Mirror the bits in the image
+ //
+ if (Mirror)
+ for (y = 0; y < h; ++y)
+ mirror_bytes(buf + y*bpl, bpl, Mirror1);
+
+ //
+ // Output the image stripes
+ //
+ #define N 256
+ for (y = 0; y < h; y += N)
+ {
+ struct jbg_enc_state se;
+ unsigned char *bitmaps[1];
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ OAK_IMAGE_DATA recdata;
+ int chainlen;
+ int padlen;
+ static char pad[] = "PAD_PAD_PAD_PAD_";
+
+ int lines = (h-y) > N ? N : (h-y);
+
+ bitmaps[0] = buf + y * ((w+7)/8);
+ chain = NULL;
+
+ memset(&recdata.bih, 0, sizeof(recdata.bih));
+ recdata.datalen = 0;
+ recdata.padlen = 0;
+ recdata.unk1C = 0; // TODO
+ recdata.y = y;
+ recdata.plane = 3; //K
+ recdata.subplane = 0;
+
+ if (lines < N)
+ JbgOptions[2] = lines;
+ else
+ JbgOptions[2] = N;
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1, "Program error: missing BIH at start of chain\n");
+ chainlen = 0;
+ for (current = chain->next; current; current = current->next)
+ chainlen += current->len;
+
+ // Copy in the BIH
+ memcpy(&recdata.bih, chain->data, sizeof(recdata.bih));
+
+ // Oak is little-endian, but JBIG-kit is big-endian
+ iswap32(&recdata.bih.xd);
+ iswap32(&recdata.bih.yd);
+ iswap32(&recdata.bih.l0);
+
+ recdata.datalen = chainlen;
+ recdata.padlen = (recdata.datalen + 15) & ~0x0f;
+ oak_record(ofp, OAK_TYPE_IMAGE_DATA, &recdata, sizeof(recdata));
+ for (current = chain->next; current; current = current->next)
+ fwrite(current->data, 1, current->len, ofp);
+ padlen = recdata.padlen - recdata.datalen;
+ fwrite(pad, 1, padlen, ofp);
+ free_chain(chain);
+ }
+
+ oak_record(ofp, OAK_TYPE_END_IMAGE, NULL, 0);
+
+ endpage_arg = 0; // Mono
+ oak_record(ofp, OAK_TYPE_END_PAGE, &endpage_arg, sizeof(endpage_arg));
+
+ return 0;
+}
+
+int
+pgm_page(unsigned char *raw, int w, int h, FILE *ofp)
+{
+ WORD endpage_arg;
+ DWORD source_arg;
+ OAK_MEDIA recmedia;
+ OAK_COPIES reccopies;
+ OAK_PAPER recpaper;
+ OAK_IMAGE_MONO recmono;
+
+ int sub;
+ int y;
+ int bpl = (w+7)/8;
+ unsigned char *subplane[2];
+
+ for (sub = 0; sub < 2 ; ++sub)
+ {
+ subplane[sub] = malloc(bpl * h);
+ if (!subplane[sub]) error(3, "Cannot allocate space for subplane\n");
+ }
+
+ pgm_subplanes(subplane, raw, w, h);
+
+ oak_record(ofp, OAK_TYPE_START_PAGE, NULL, 0);
+
+ // TODO: page parms
+ source_arg = SourceCode;
+ oak_record(ofp, OAK_TYPE_SOURCE, &source_arg, sizeof(source_arg));
+
+ recmedia.media = MediaCode;
+ recmedia.unk8[0] = 2; // TODO
+ recmedia.unk8[1] = 0; // TODO
+ recmedia.unk8[2] = 0; // TODO
+ memset(recmedia.string, ' ', sizeof(recmedia.string));
+ strcpy(recmedia.string, ""); // TODO
+ oak_record(ofp, OAK_TYPE_MEDIA, &recmedia, sizeof(recmedia));
+
+ reccopies.copies = Copies;
+ reccopies.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_COPIES, &reccopies, sizeof(reccopies));
+
+ recpaper.paper = PaperCode;
+ recpaper.w1200 = PageWidth * 1200 / ResX;
+ recpaper.h1200 = PageHeight * 1200 / ResY;
+ recpaper.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_PAPER, &recpaper, sizeof(recpaper));
+
+ // image header (32/33)
+ recmono.plane.unk0 = 0;
+ recmono.plane.unk1 = 0;
+ recmono.plane.w = w;
+ recmono.plane.h = h;
+ recmono.plane.resx = ResX;
+ recmono.plane.resy = ResY;
+ recmono.plane.nbits = 2;
+ fill_image_plane_unknown(&recmono.plane);
+ oak_record(ofp, OAK_TYPE_IMAGE_MONO, &recmono, sizeof(recmono));
+
+ oak_record(ofp, OAK_TYPE_START_IMAGE, NULL, 0);
+
+ //
+ // Mirror the bits in the image
+ //
+ // TODO: combine this operation with pgm_subplanes
+ //
+ if (Mirror)
+ for (sub = 0; sub < 2; ++sub)
+ for (y = 0; y < h; ++y)
+ mirror_bytes(subplane[sub] + y*bpl, bpl, Mirror1);
+
+ //
+ // Output the image stripes
+ //
+ #define N 256
+ for (y = 0; y < h; y += N)
+ {
+ struct jbg_enc_state se;
+ unsigned char *bitmaps[1];
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ OAK_IMAGE_DATA recdata;
+ int chainlen;
+ int padlen;
+ static char pad[] = "PAD_PAD_PAD_PAD_";
+
+ int lines = (h-y) > N ? N : (h-y);
+
+ for (sub = 0; sub < 2; ++sub)
+ {
+ bitmaps[0] = subplane[sub] + y * ((w+7)/8);
+ chain = NULL;
+
+ memset(&recdata.bih, 0, sizeof(recdata.bih));
+ recdata.datalen = 0;
+ recdata.padlen = 0;
+ recdata.unk1C = 0; // TODO
+ recdata.y = y;
+ recdata.plane = 3; //K
+ recdata.subplane = sub;
+
+ if (lines < N)
+ JbgOptions[2] = lines;
+ else
+ JbgOptions[2] = N;
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1, "Program error: missing BIH at start of chain\n");
+ chainlen = 0;
+ for (current = chain->next; current; current = current->next)
+ chainlen += current->len;
+
+ // Copy in the BIH
+ memcpy(&recdata.bih, chain->data, sizeof(recdata.bih));
+
+ // Oak is little-endian, but JBIG-kit is big-endian
+ iswap32(&recdata.bih.xd);
+ iswap32(&recdata.bih.yd);
+ iswap32(&recdata.bih.l0);
+
+ recdata.datalen = chainlen;
+ recdata.padlen = (recdata.datalen + 15) & ~0x0f;
+ oak_record(ofp, OAK_TYPE_IMAGE_DATA, &recdata, sizeof(recdata));
+ for (current = chain->next; current; current = current->next)
+ fwrite(current->data, 1, current->len, ofp);
+ padlen = recdata.padlen - recdata.datalen;
+ fwrite(pad, 1, padlen, ofp);
+
+ free_chain(chain);
+ }
+ }
+
+ for (sub = 0; sub < 2; ++sub)
+ free(subplane[sub]);
+
+ oak_record(ofp, OAK_TYPE_END_IMAGE, NULL, 0);
+
+ endpage_arg = 0;
+ oak_record(ofp, OAK_TYPE_END_PAGE, &endpage_arg, sizeof(endpage_arg));
+
+ return 0;
+}
+
+int
+cups_page(unsigned char *raw, int w, int h, FILE *ofp)
+{
+ WORD endpage_arg;
+ DWORD source_arg;
+ OAK_MEDIA recmedia;
+ OAK_COPIES reccopies;
+ OAK_PAPER recpaper;
+ OAK_IMAGE_MONO recmono;
+ OAK_IMAGE_COLOR reccolor;
+
+ int p, p0, p3;
+ int sub;
+ int y;
+ int bpl = (w+7)/8;
+ unsigned char *plane[4][2];
+
+ if (Color2Mono)
+ p0 = p3 = Color2Mono - 1;
+ else
+ { p0 = 0; p3 = 3; }
+ for (p = p0; p <= p3 ; ++p)
+ {
+ for (sub = 0; sub < 2 ; ++sub)
+ {
+ plane[p][sub] = malloc(bpl * h);
+ if (!plane[p][sub])
+ error(3, "Cannot allocate space for bit plane\n");
+ }
+ }
+
+ cups_planes(plane, raw, w, h);
+
+ oak_record(ofp, OAK_TYPE_START_PAGE, NULL, 0);
+
+ // TODO: page parms
+ source_arg = SourceCode;
+ oak_record(ofp, OAK_TYPE_SOURCE, &source_arg, sizeof(source_arg));
+
+ recmedia.media = MediaCode;
+ recmedia.unk8[0] = 2; // TODO
+ recmedia.unk8[1] = 0; // TODO
+ recmedia.unk8[2] = 0; // TODO
+ memset(recmedia.string, ' ', sizeof(recmedia.string));
+ strcpy(recmedia.string, ""); // TODO
+ oak_record(ofp, OAK_TYPE_MEDIA, &recmedia, sizeof(recmedia));
+
+ reccopies.copies = Copies;
+ reccopies.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_COPIES, &reccopies, sizeof(reccopies));
+
+ recpaper.paper = PaperCode;
+ recpaper.w1200 = PageWidth * 1200 / ResX;
+ recpaper.h1200 = PageHeight * 1200 / ResY;
+ recpaper.unk = 0; // TODO
+ oak_record(ofp, OAK_TYPE_PAPER, &recpaper, sizeof(recpaper));
+
+ // image header (32/33)
+ if (p0 == p3)
+ {
+ recmono.plane.unk0 = 0;
+ recmono.plane.unk1 = 0;
+ recmono.plane.w = w; // TODO
+ recmono.plane.h = h; // TODO
+ recmono.plane.resx = ResX;
+ recmono.plane.resy = ResY;
+ recmono.plane.nbits = 2;
+ fill_image_plane_unknown(&recmono.plane);
+ oak_record(ofp, OAK_TYPE_IMAGE_MONO, &recmono, sizeof(recmono));
+ }
+ else
+ {
+ for (p = p0; p <= p3; ++p)
+ {
+ reccolor.plane[p].unk0 = 0;
+ reccolor.plane[p].unk1 = 0;
+ reccolor.plane[p].w = w; // TODO
+ reccolor.plane[p].h = h; // TODO
+ reccolor.plane[p].resx = ResX;
+ reccolor.plane[p].resy = ResY;
+ reccolor.plane[p].nbits = 2;
+ fill_image_plane_unknown(&reccolor.plane[p]);
+ }
+ oak_record(ofp, OAK_TYPE_IMAGE_COLOR, &reccolor, sizeof(reccolor));
+ }
+
+ oak_record(ofp, OAK_TYPE_START_IMAGE, NULL, 0);
+
+ //
+ // Mirror the bits in the image
+ //
+ // TODO: combine this operation with cups_planes
+ //
+ if (Mirror)
+ for (p = p0; p <= p3; ++p)
+ for (sub = 0; sub < 2; ++sub)
+ for (y = 0; y < h; ++y)
+ mirror_bytes(plane[p][sub] + y*bpl, bpl, Mirror1);
+
+ //
+ // Output the image stripes
+ //
+ #define N 256
+ for (y = 0; y < h; y += N)
+ {
+ struct jbg_enc_state se;
+ unsigned char *bitmaps[1];
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ OAK_IMAGE_DATA recdata;
+ int chainlen;
+ int padlen;
+ static char pad[] = "PAD_PAD_PAD_PAD_";
+
+ int lines = (h-y) > N ? N : (h-y);
+
+ for (p = p0; p <= p3; ++p)
+ {
+ for (sub = 0; sub < 2; ++sub)
+ {
+ bitmaps[0] = plane[p][sub] + y * ((w+7)/8);
+ chain = NULL;
+
+ memset(&recdata.bih, 0, sizeof(recdata.bih));
+ recdata.datalen = 0;
+ recdata.padlen = 0;
+ recdata.unk1C = 0; // TODO
+ recdata.y = y;
+ recdata.plane = p;
+ recdata.subplane = sub;
+
+ if (lines < N)
+ JbgOptions[2] = lines;
+ else
+ JbgOptions[2] = N;
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1, "Program error: missing BIH at start of chain\n");
+ chainlen = 0;
+ for (current = chain->next; current; current = current->next)
+ chainlen += current->len;
+
+ // Copy in the BIH
+ memcpy(&recdata.bih, chain->data, sizeof(recdata.bih));
+
+ // Oak is little-endian, but JBIG-kit is big-endian
+ iswap32(&recdata.bih.xd);
+ iswap32(&recdata.bih.yd);
+ iswap32(&recdata.bih.l0);
+
+ recdata.datalen = chainlen;
+ recdata.padlen = (recdata.datalen + 15) & ~0x0f;
+ oak_record(ofp, OAK_TYPE_IMAGE_DATA, &recdata, sizeof(recdata));
+ for (current = chain->next; current; current = current->next)
+ fwrite(current->data, 1, current->len, ofp);
+ padlen = recdata.padlen - recdata.datalen;
+ fwrite(pad, 1, padlen, ofp);
+
+ free_chain(chain);
+ }
+ }
+ }
+
+ for (p = p0; p <= p3; ++p)
+ for (sub = 0; sub < 2; ++sub)
+ free(plane[p][sub]);
+
+ oak_record(ofp, OAK_TYPE_END_IMAGE, NULL, 0);
+
+ endpage_arg = 0;
+ oak_record(ofp, OAK_TYPE_END_PAGE, &endpage_arg, sizeof(endpage_arg));
+
+ return 0;
+}
+
+int
+read_and_clip_image(unsigned char *buf,
+ int rawBpl, int rightBpl, int pixelsPerByte,
+ int bpl, int h, FILE *ifp)
+{
+ unsigned char *rowbuf, *rowp;
+ int y;
+ int rc;
+
+ debug(1, "read_and_clip_image: rawBpl=%d, rightBpl=%d, pixelsePerByte=%d\n",
+ rawBpl, rightBpl, pixelsPerByte);
+ debug(1, "read_and_clip_image: bpl=%d, h=%d\n", bpl, h);
+ debug(1, "read_and_clip_image: clipleft=%d data=%d clipright=%d\n",
+ UpperLeftX/pixelsPerByte, bpl, rightBpl - bpl);
+
+ rowbuf = malloc(rawBpl);
+ if (!rowbuf)
+ error(1, "Can't allocate row buffer\n");
+
+ // Clip top rows
+ if (UpperLeftY)
+ {
+ for (y = 0; y < UpperLeftY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc == 0)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(1) on input at y=%d\n", y);
+ }
+ }
+
+ // Copy the rows that we want to image
+ rowp = buf;
+ for (y = 0; y < h; ++y, rowp += bpl)
+ {
+ // Clip left pixel *bytes*
+ if (UpperLeftX)
+ {
+ rc = fread(rowbuf, UpperLeftX / pixelsPerByte, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(2) on input at y=%d\n", y);
+ }
+
+ rc = fread(rowp, bpl, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY && !UpperLeftX)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(3) on input at y=%d\n", y);
+
+ // Clip right pixels
+ if (rightBpl != bpl)
+ {
+ rc = fread(rowbuf, rightBpl - bpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(4) on input at y=%d\n", y);
+ }
+ }
+
+ // Clip bottom rows
+ if (LowerRightY)
+ {
+ for (y = 0; y < LowerRightY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(5) on input at y=%d\n", y);
+ }
+ }
+
+ free(rowbuf);
+ return (0);
+
+eof:
+ free(rowbuf);
+ return (EOF);
+}
+
+int
+cmyk_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int rc;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ rawW = PageWidth;
+ rawH = PageHeight;
+ rawBpl = (PageWidth + 1) / 2;
+
+ // We only clip multiples of 2 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 1;
+ UpperLeftX &= ~1;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 1) / 2;
+ rightBpl = (rawW - UpperLeftX + 1) / 2;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Unable to allocate page buffer of %d x %d = %d bytes\n",
+ rawW, rawH, rawBpl * rawH);
+
+ for (;;)
+ {
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 2, bpl, h, ifp);
+ if (rc == EOF)
+ goto done;
+
+ cmyk_page(buf, w, h, ofp);
+ }
+
+done:
+ free(buf);
+ return 0;
+}
+
+#if 0
+ #include <ctype.h>
+#else
+ static int
+ isdigit(int c)
+ {
+ return (c >= '0' && c <= '9');
+ }
+#endif
+
+static unsigned long
+getint(FILE *fp)
+{
+ int c;
+ unsigned long i;
+
+ while ((c = getc(fp)) != EOF && !isdigit(c))
+ if (c == '#')
+ while ((c = getc(fp)) != EOF && !(c == 13 || c == 10)) ;
+ if (c != EOF)
+ {
+ ungetc(c, fp);
+ fscanf(fp, "%lu", &i);
+ }
+ return i;
+}
+
+void
+skip_to_nl(FILE *fp)
+{
+ for (;;)
+ {
+ int c;
+ c = getc(fp);
+ if (c == EOF)
+ error(1, "Premature EOF on input stream\n");
+ if (c == '\n')
+ return;
+ }
+}
+
+int
+pbm_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int c1, c2;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int rc;
+ int first = 1;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ for (;;)
+ {
+ if (first)
+ first = 0; // P4 already eaten in main
+ else
+ {
+ c1 = getc(ifp);
+ if (c1 == EOF)
+ break;
+ c2 = getc(ifp);
+ if (c1 != 'P' || c2 != '4')
+ error(1, "Not a pbmraw data stream\n");
+ }
+
+ skip_to_nl(ifp);
+
+ rawW = getint(ifp);
+ rawH = getint(ifp);
+ skip_to_nl(ifp);
+
+ rawBpl = (rawW + 7) / 8;
+
+ // We only clip multiples of 8 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 7;
+ UpperLeftX &= ~7;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ rightBpl = (rawW - UpperLeftX + 7) / 8;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Can't allocate page buffer\n");
+
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 8, bpl, h, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pbm) on input stream\n");
+
+ pbm_page(buf, w, h, ofp);
+
+ free(buf);
+ }
+ return (0);
+}
+
+int
+pgm_pages(FILE *ifp, FILE *ofp, int first)
+{
+ unsigned char *buf;
+ int c1, c2;
+ int rawW, rawH, maxVal;
+ int rawBpl, rightBpl;
+ int w, h, bpl;
+ int rc;
+
+ for (;;)
+ {
+ if (first)
+ first = 0; // P5 already eaten in main
+ else
+ {
+ c1 = getc(ifp);
+ if (c1 == EOF)
+ break;
+ c2 = getc(ifp);
+ if (c1 != 'P' || c2 != '5')
+ error(1, "Not a pgmraw data stream\n");
+ }
+
+ skip_to_nl(ifp);
+
+ rawW = getint(ifp);
+ rawH = getint(ifp);
+ maxVal = getint(ifp);
+ skip_to_nl(ifp);
+ if (maxVal != 255)
+ error(1, "Don't know how to handle pgm maxVal '%d'\n", maxVal);
+
+ rawBpl = rawW;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = w;
+ rightBpl = rawW - UpperLeftX;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Can't allocate page buffer\n");
+
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 1, bpl, h, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pgm) on input stream\n");
+
+ pgm_page(buf, w, h, ofp);
+
+ free(buf);
+ }
+ return (0);
+}
+
+int
+cups_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int bpc;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int rc;
+ char hdr[512];
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ // 00000000: 74 53 61 52 00 00 00 00 00 00 00 00 00 00 00 00 | tSaR
+ // 00000170: 00 00 00 00 00 00 00 00 ec 13 00 00 c8 19 00 00
+ // 00000180: 00 00 00 00 02 00 00 00 02 00 00 00 ec 13 00 00
+
+ if (fread(hdr, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF reading magic number\n");
+ if (memcmp(hdr, "tSaR", 4) != 0 && memcmp(hdr, "RaSt", 4) != 0)
+ error(1, "Illegal magic number\n");
+ if (fread(hdr, 0x178-4, 1, ifp) != 1)
+ error(1, "Preamture EOF skipping start of CUPS header\n");
+
+ if (fread(&rawW, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF reading width\n");
+ if (fread(&rawH, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF reading height\n");
+
+ if (fread(&hdr, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF skipping mediaType\n");
+
+ if (fread(&bpc, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF reading height\n");
+ if (bpc != 2)
+ error(1, "Illegal number of bits per color (%d)\n", bpc);
+
+ if (fread(&hdr, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF skipping bitPerPixel\n");
+
+ if (fread(&rawBpl, 4, 1, ifp) != 1)
+ error(1, "Preamture EOF reading height\n");
+
+ if (fread(&hdr, 6*4, 1, ifp) != 1)
+ error(1, "Preamture EOF skipping end of CUPS header\n");
+
+ debug(1, "%d x %d, %d\n", rawW, rawH, rawBpl);
+
+ // We only clip multiples of 1 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 0;
+ UpperLeftX &= ~0;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 0) / 1;
+ rightBpl = (rawW - UpperLeftX + 0) / 1;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Unable to allocate page buffer of %d x %d = %d bytes\n",
+ rawW, rawH, rawBpl * rawH);
+
+ for (;;)
+ {
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 1, bpl, h, ifp);
+ if (rc == EOF)
+ goto done;
+
+ cups_page(buf, w, h, ofp);
+ }
+
+done:
+ free(buf);
+ return 0;
+}
+
+void
+do_one(FILE *in)
+{
+ int mode;
+
+ mode = getc(in);
+ if (mode == 't')
+ {
+ ungetc(mode, in);
+ cups_pages(in, stdout);
+ }
+ else if (mode != 'P' || Mode == MODE_COLOR)
+ {
+ ungetc(mode, in);
+ cmyk_pages(in, stdout);
+ }
+ else
+ {
+ mode = getc(in);
+ if (mode == '4')
+ pbm_pages(in, stdout);
+ else if (mode == '5')
+ pgm_pages(in, stdout, 1);
+ else
+ error(1, "Not a bitcmyk, cups, pbm, or pgm file!\n");
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+
+ while ( (c = getopt(argc, argv,
+ "b:cd:g:n:m:p:r:s:u:l:L:ABJ:M:S:U:D:V?h")) != EOF)
+ switch (c)
+ {
+ case 'b': Bpp = atoi(optarg);
+ if (Bpp != 1 && Bpp != 2)
+ error(1, "Illegal value '%s' for -b\n", optarg);
+ break;
+ case 'c': Mode = MODE_COLOR; break;
+ case 'S': Color2Mono = atoi(optarg);
+ Mode = MODE_COLOR;
+ if (Color2Mono < 0 || Color2Mono > 4)
+ error(1, "Illegal value '%s' for -C\n", optarg);
+ break;
+ case 'd': Duplex = atoi(optarg); break;
+ case 'g': if (parse_xy(optarg, &PageWidth, &PageHeight))
+ error(1, "Illegal format '%s' for -g\n", optarg);
+ if (PageWidth < 0 || PageWidth > 1000000)
+ error(1, "Illegal X value '%s' for -g\n", optarg);
+ if (PageHeight < 0 || PageHeight > 1000000)
+ error(1, "Illegal Y value '%s' for -g\n", optarg);
+ break;
+ case 'm': MediaCode = atoi(optarg); break;
+ case 'n': Copies = atoi(optarg); break;
+ case 'p': PaperCode = atoi(optarg); break;
+ case 'r': if (parse_xy(optarg, &ResX, &ResY))
+ error(1, "Illegal format '%s' for -r\n", optarg);
+ break;
+ case 's': SourceCode = atoi(optarg); break;
+ case 'u':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &UpperLeftX, &UpperLeftY))
+ error(1, "Illegal format '%s' for -u\n", optarg);
+ break;
+ case 'l':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &LowerRightX, &LowerRightY))
+ error(1, "Illegal format '%s' for -l\n", optarg);
+ break;
+ case 'L': LogicalClip = atoi(optarg);
+ if (LogicalClip < 0 || LogicalClip > 3)
+ error(1, "Illegal value '%s' for -L\n", optarg);
+ break;
+ case 'M': Mirror = atoi(optarg); break;
+ case 'A': AllIsBlack = !AllIsBlack; break;
+ case 'B': BlackClears = !BlackClears; break;
+ case 'J': if (optarg[0]) Filename = optarg; break;
+ case 'U': if (optarg[0]) Username = optarg; break;
+ case 'D': Debug = atoi(optarg);
+ if (Debug == 12345678)
+ {
+ // Hack to force time to zero for regression tests
+ ZeroTime = 1;
+ Debug = 0;
+ }
+ break;
+ case 'V': printf("%s\n", Version); exit(0);
+ default: usage(); exit(1);
+ }
+
+ if (UpperLeftX < 0 || UpperLeftX >= PageWidth)
+ error(1, "Illegal X value '%d' for -u\n", UpperLeftX);
+ if (UpperLeftY < 0 || UpperLeftY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -u\n", UpperLeftY);
+ if (LowerRightX < 0 || LowerRightX >= PageWidth)
+ error(1, "Illegal X value '%d' for -l\n", LowerRightX);
+ if (LowerRightY < 0 || LowerRightY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -l\n", LowerRightY);
+
+ argc -= optind;
+ argv += optind;
+
+ if (getenv("DEVICE_URI"))
+ IsCUPS = 1;
+
+ start_doc(stdout);
+
+ if (argc == 0)
+ {
+ do_one(stdin);
+ }
+ else
+ {
+ int i;
+
+ for (i = 0; i < argc; ++i)
+ {
+ FILE *ifp;
+
+ ifp = fopen(argv[i], "r");
+ if (!ifp)
+ error(1, "Can't open '%s' for reading\n", argv[i]);
+ do_one(ifp);
+ fclose(ifp);
+ }
+ }
+ end_doc(stdout);
+ exit(0);
+}
diff --git a/foo2qpdl-wrapper.1in b/foo2qpdl-wrapper.1in
index c9580e2..2c136d9 100644
--- a/foo2qpdl-wrapper.1in
+++ b/foo2qpdl-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2qpdl-wrapper 1 "${MODpage}" "foo2qpdl-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2qpdl-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -184,7 +16,8 @@ foo2qpdl-wrapper \- Convert Postscript into a QPDL printer stream
is a Foomatic compatible printer wrapper for the \fBfoo2qpdl\fP printer driver.
This script reads a Postscript \fIps-file\fP or standard input
and converts it to Samsung/Xerox QPDL printer format
-for driving the Samsung CLP-300, CLP-600, CLX-3160
+for driving the
+Samsung CLP-300, CLX-2160, CLX-3160, CLP-315, CLX-3175, CLP-600, CLP-610,
and Xerox Phaser 6110
QPDL printers.
.P
@@ -200,6 +33,14 @@ print job that are usually controlled on a per job basis.
.BI \-c
Print in color (else monochrome).
.TP
+.BI \-C\0 colormode
+Color correction mode [0].
+.TS
+n l .
+1 CRD
+10 ICM color profile (using -G *.icm file)
+.TE
+.TP
.BI \-d\0 duplex
Duplex code to send to printer [1].
.TS
@@ -233,6 +74,7 @@ archive 12
.BI \-p\0 paper
Paper size code to send to printer [0].
.TS
+box;
| n l | n l.
0 letter 1 legal
2 A4 3 executive
@@ -301,6 +143,9 @@ l l.
2 only send X clipping amount
3 send both X and Y clipping amounts
.TE
+.TP
+.BI \-z\0 model
+Model: 0=CLP-300/CLX-2160/CLX-3160, 1=CLP-600, 2=CLP-315/CLP-610/CLX-3175
.SS Color Tweaking Options
These are the options used to control the quality of color output.
Color correction is currently a WORK IN PROGRESS.
diff --git a/foo2qpdl-wrapper.in b/foo2qpdl-wrapper.in
index a857d46..6b2e878 100755
--- a/foo2qpdl-wrapper.in
+++ b/foo2qpdl-wrapper.in
@@ -18,15 +18,20 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2qpdl-wrapper.in,v 1.15 2007/06/11 00:48:32 rick Exp $'
+VERSION='$Id: foo2qpdl-wrapper.in,v 1.37 2009/01/21 07:52:13 rick Exp $'
#
# Printer Notes:
#
-# Samsung CLP-300
-# Samsung CLP-600
-# Samsung CLX-3160
-# Xerox Phaser 6110
+# Samsung CLP-300: -z0, ICM
+# Samsung CLP-315: -z2, ICM
+# Samsung CLP-600: -z1, CRD, need ICM for black text
+# Samsung CLP-610: -z2, CRD, need ICM for black text
+# Samsung CLX-2160: -z0, ICM
+# Samsung CLX-3160: -z0, ICM
+# Samsung CLX-3175: -z2, ICM
+# Xerox Phaser 6110: -z0, ICM
+# Xerox Phaser 6110MFP: -z0, ICM
#
PROGNAME="$0"
@@ -53,14 +58,20 @@ Usage:
Normal Options:
-c Print in color (else monochrome)
+-C colormode Colormode [$COLORMODE]
+ 1=CRD
+ 10=ICM color profile (using -G *.icm file)
-d duplex Duplex code to send to printer [$DUPLEX]
1=off, 2=longedge, 3=shortedge
-m media Media code to send to printer [$MEDIA]
- 1=standard, 2=transparency, 3=glossy, 257=envelope,
- 259=letterhead, 261=thickstock, 262=postcard, 263=labels
+ 0=plain, 1=thick, 2=thin. 3=bond, 4=color, 5=card,
+ 6=labels, 7=envelope, 8=preprinted, 9=cotton,
+ 10=recycled, 11=transparency, 12=archive
-p paper Paper code [$PAPER]
- 0=letter, 5=legal, 7=executive, 9=A4, 11=A5, 13=B5
- 20=env#10, 27=envDL 28=envC5 34=envB5 37=envMonarch
+ 0=letter, 1=legal, A4=2, 3=executive, 6=env#10,
+ 7=envMonarch, 8=envC5, 9=envDL, 11=B5jis, 12=B5iso,
+ 16=A5, 17=A6, 23=envC6, 24=folio, 25=env6.75, 26=env#9,
+ 28=oficio
-n copies Number of copies [$COPIES]
-r <xres>x<yres> Set device resolution in pixels/inch [$RES]
-s source Source code to send to printer [$SOURCE]
@@ -79,7 +90,10 @@ Printer Tweaking Options:
-P Do not output START_PLANE codes. May be needed by some
monochrome-only printers.
-X padlen Add extra zero padding to the end of BID segments [16]
--z model Model: 0=CLP-300 1=CLP-600
+-z model Printer Model [$MODEL]
+ 0=CLP-300/CLX-2160/CLX-3160
+ 1=CLP-600
+ 2=CLP-315/CLP-610/CLX-3175
Color Tweaking Options:
-g gsopts Additional options to pass to Ghostscript, such as
@@ -143,8 +157,8 @@ nup() {
#
# N.B. := operator used here, when :- would be better, because "ash"
# doesn't have :-
-if gs8 -v >/dev/null 2>&1; then
- GSBIN=${GSBIN:-gs8}
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
else
GSBIN=${GSBIN:-gs}
fi
@@ -182,6 +196,10 @@ case `$GSBIN --version` in
7*) DEFAULTCOLORMODE=10
DEFAULTCOLORMODE=1
;;
+8.1*)
+ DEFAULTCOLORMODE=1
+ QUALITY=1
+ ;;
*) DEFAULTCOLORMODE=1
;;
esac
@@ -224,7 +242,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2qpdl -V; exit 0;;
+ V) echo "$VERSION"; foo2qpdl -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -256,10 +274,10 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
;;
wts)
- GSOPTS="-dCOLORSCREEN $GSOPTS"
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
@@ -267,7 +285,7 @@ esac
# Validate model code
#
case "$MODEL" in
-0|1) ;;
+0|1|2) ;;
*) error "Unknown model code $MODEL";;
esac
@@ -361,29 +379,37 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
;;
- esac
- XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
PAPER=21; paper=letter;
- set_clipping 2 100 2 100
+ # Doesn't work on a real printer - smudges.
+ # set_clipping 2 100 2 100
+ set_clipping 150 100 150 100
;;
0|letter) PAPER=0; paper=letter; XDIM="10200"; YDIM="6600"
set_clipping 150 100 150 100
@@ -403,7 +429,7 @@ Custom*)
11|b5jis|B5jis) PAPER=11; paper=b5; XDIM="8598"; YDIM="6070"
set_clipping 150 100 150 100
;;
-24|folio) PAPER=24; paper=folio; XDIM="10200"; YDIM="7800"
+24|folio) PAPER=24; paper=folio; XDIM="9922"; YDIM="7796"
set_clipping 150 100 150 100
;;
26|"env#9") PAPER=26; paper=env9; XDIM="4496"; YDIM="5324"
@@ -455,6 +481,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -478,6 +507,7 @@ create_crd() {
;;
esac
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
cat > $ICCTMP.usecie.ps <<-EOF
%!PS-Adobe-3.0
<</UseCIEColor true>>setpagedevice
@@ -520,12 +550,16 @@ else
case "$COLORMODE" in
default) COLORMODE=$DEFAULTCOLORMODE;;
esac
+ case "$GAMMAFILE" in
+ default) GAMMAFILE=samclp300-0.icm;;
+ esac
fi
CRDBASE="$PREFIX/share/foo2qpdl/crd"
case "$MODEL" in
0) model=CLP-300;;
1) model=CLP-600;;
+ 2) model=CLP-600;;
esac
case "$RES" in
600x600) SCREEN=$model-600x600cms2;;
@@ -533,6 +567,8 @@ case "$RES" in
1200x1200) SCREEN=$model-1200x1200cms2;;
esac
+PSTOPS_OPTS="-n"
+
case "$COLORMODE" in
0|"")
# Monochrome
@@ -588,6 +624,10 @@ case "$COLORMODE" in
;;
esac
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
if [ "" != "$COLOR" ]; then
if [ "" = "$AIB" -a "" = "$BC" ]; then
# Faster, but can't handle AllIsBlack or BlackClears
@@ -617,12 +657,12 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
-sed 's#^[^/]*cupsPSLevel2#false#' | \
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
| foo2qpdl -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
- $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
+ -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
-J "$LPJOB" -U "$USER" \
$BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG
@@ -634,7 +674,7 @@ if [ -x /usr/bin/logger ]; then
"$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
logger -t "$BASENAME" -p lpr.info -- \
"foo2qpdl -r$RES -g$DIM -p$PAPER -m$MEDIA \
--n$COPIES -d$DUPLEX -s$SOURCE $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
+-n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
$SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"
fi
diff --git a/foo2qpdl.1in b/foo2qpdl.1in
index 2ffa49e..8b55a31 100644
--- a/foo2qpdl.1in
+++ b/foo2qpdl.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2qpdl 1 "${MODpage}" "foo2qpdl ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2qpdl Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, QPDL) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -190,7 +22,7 @@ QPDL printer stream
.B foo2qpdl
converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome
or color QPDL streams,
-for driving the Samsung CLP-300, CLP-600, CLX-3160
+for driving the Samsung CLP-300, CLX-2160, CLP-600, CLX-3160, CLP-610
and the Xerox Phaser 6110
QPDL printers.
@@ -238,6 +70,7 @@ archive 12
.BI \-p\0 paper
Paper code to send to printer [0].
.TS
+box;
| n l | n l.
0 letter 1 legal
2 A4 3 executive
@@ -299,6 +132,9 @@ AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only.
.TP
.BI \-B
BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only.
+.TP
+.BI \-z\0 model
+Model: 0=CLP-300/CLX-2160/CLX-3160, 1=CLP-600, 2=CLP-315/CLP-610/CLX-3175
.SS Debugging Options
These options are used for debugging \fBfoo2qpdl\fP.
.TP
diff --git a/foo2qpdl.c b/foo2qpdl.c
index fcb8eb8..8c0cfe8 100644
--- a/foo2qpdl.c
+++ b/foo2qpdl.c
@@ -6,11 +6,15 @@ This program converts pbm (B/W) images and 1-bit-per-pixel cmyk images
is some information about the ZJS format at http://ddk.zeno.com.
With this utility, you can print to some HP printers, such as these:
- - Samsung CLP-300
- - Samsung CLP-600
- - Samsung CLX-3160 (printer only)
- - Xerox Phaser 6110
- - Xerox Phaser 6110MFP (printer only)
+ - Samsung CLP-300 -z0
+ - Samsung CLP-600 -z1
+ - Samsung CLP-315 -z2
+ - Samsung CLP-610 -z2
+ - Samsung CLX-2160 (printer only) (like CLP-300)
+ - Samsung CLX-3160 (printer only) (like CLP-300)
+ - Samsung CLX-3175 (printer only) (like CLP-315)
+ - Xerox Phaser 6110 (like CLP-300)
+ - Xerox Phaser 6110MFP (printer only) (like CLP-300)
AUTHORS
This program began life as Robert Szalai's 'pbmtozjs' program. It
@@ -52,7 +56,7 @@ yourself.
*/
-static char Version[] = "$Id: foo2qpdl.c,v 1.20 2007/07/15 14:31:56 rick Exp $";
+static char Version[] = "$Id: foo2qpdl.c,v 1.39 2008/12/31 12:52:25 rick Exp $";
#include <stdio.h>
#include <stdlib.h>
@@ -72,6 +76,7 @@ int ResX = 1200;
int ResY = 600;
int Bpp = 1;
int PaperCode = 0; //DMPAPER_LETTER;
+ #define DMPAPER_CUSTOM 21
int PageWidth = 1200 * 8.5;
int PageHeight = 600 * 11;
int UpperLeftX = 0;
@@ -87,6 +92,11 @@ char *Filename = NULL;
int Mode = 1;
#define MODE_MONO 1
#define MODE_COLOR 2
+int Model = 0;
+ #define MODEL_CLP300 0
+ #define MODEL_CLP600 1
+ #define MODEL_CLP610 2
+ #define MODEL_LAST 2
int Color2Mono = 0;
int BlackClears = 0;
@@ -162,11 +172,14 @@ usage(void)
" 1=off, 2=longedge, 3=shortedge\n"
"-g <xpix>x<ypix> Set page dimensions in pixels [%dx%d]\n"
"-m media Media code to send to printer [%d]\n"
-" 1=standard 2=transparency 3=glossy 257=envelope\n"
-" 259=letterhead 261=thickstock 262=postcard 263=labels\n"
-"-p paper Paper code to send to printer [%d]\n"
-" 1=letter, 5=legal 7=executive 9=A4 11=A5 13=B5\n"
-" 20=env#10, 27=envDL 28=envC5 34=envB5 37=envMonarch\n"
+" 0=plain, 1=thick, 2=thin. 3=bond, 4=color, 5=card,\n"
+" 6=labels, 7=envelope, 8=preprinted, 9=cotton,\n"
+" 10=recycled, 11=transparency, 12=archive\n"
+"-p paper Paper code [%d]\n"
+" 0=letter, 1=legal, A4=2, 3=executive, 6=env#10,\n"
+" 7=envMonarch, 8=envC5, 9=envDL, 11=B5jis, 12=B5iso,\n"
+" 16=A5, 17=A6, 23=envC6, 24=folio, 25=env6.75, 26=env#9,\n"
+" 28=oficio\n"
"-n copies Number of copies [%d]\n"
"-r <xres>x<yres> Set device resolution in pixels/inch [%dx%d]\n"
"-s source Source code to send to printer [%d]\n"
@@ -187,6 +200,10 @@ usage(void)
"-P Do not output START_PLANE codes. May be needed by some\n"
" some black and white only printers.\n"
"-X padlen Add extra zero padding to the end of BID segments [%d]\n"
+"-z model Model [%d]\n"
+" 0=CLP-300/CLX-2160/CLX-3160\n"
+" 1=CLP-600\n"
+" 2=CLP-315/CLP-610/CLX-3175\n"
"\n"
"Debugging Options:\n"
"-S plane Output just a single color plane from a color print [all]\n"
@@ -206,6 +223,7 @@ usage(void)
, LowerRightX , LowerRightY
, LogicalClip
, ExtraPad
+ , Model
, Debug
, Version
);
@@ -371,6 +389,66 @@ free_chain(BIE_CHAIN *chain)
}
}
+/*
+ * This creates a linked list of compressed data. The first item
+ * in the list is the BIH and is always 20 bytes in size. Each following
+ * item is 65536 bytes in length. The last item length is whatever remains.
+ */
+void
+output_jbig(unsigned char *start, size_t len, void *cbarg)
+{
+ BIE_CHAIN *current, **root = (BIE_CHAIN **) cbarg;
+ int size = 0x80000; // Printer does strange things otherwise.
+
+ if ( (*root) == NULL)
+ {
+ (*root) = malloc(sizeof(BIE_CHAIN));
+ if (!(*root))
+ error(1, "Can't allocate space for chain\n");
+
+ (*root)->data = NULL;
+ (*root)->next = NULL;
+ (*root)->len = 0;
+ size = 20;
+ if (len != 20)
+ error(1, "First chunk must be BIH and 20 bytes long\n");
+ }
+
+ current = *root;
+ while (current->next)
+ current = current->next;
+
+ while (len > 0)
+ {
+ int amt, left;
+
+ if (!current->data)
+ {
+ current->data = malloc(size);
+ if (!current->data)
+ error(1, "Can't allocate space for compressed data\n");
+ }
+
+ left = size - current->len;
+ amt = (len > left) ? left : len;
+ memcpy(current->data + current->len, start, amt);
+ current->len += amt;
+ len -= amt;
+ start += amt;
+
+ if (current->len == size)
+ {
+ current->next = malloc(sizeof(BIE_CHAIN));
+ if (!current->next)
+ error(1, "Can't allocate space for chain\n");
+ current = current->next;
+ current->data = NULL;
+ current->next = NULL;
+ current->len = 0;
+ }
+ }
+}
+
int
write_plane(int pn, BIE_CHAIN **root, FILE *ofp)
{
@@ -433,22 +511,9 @@ write_plane(int pn, BIE_CHAIN **root, FILE *ofp)
}
void
-start_page(BIE_CHAIN **root, int nbie, FILE *ofp)
+start_page_init(FILE *ofp)
{
- BIE_CHAIN *current = *root;
- unsigned long w, h;
- int i, pn;
- int cksum;
int valw, valh;
- static int pageno = 0;
-
- /* error handling */
- if (!current)
- error(1, "There is no JBIG!\n");
- if (!current->next)
- error(1, "There is no or wrong JBIG header!\n");
- if (current->len != 20 )
- error(1,"wrong BIH length\n");
/* RECTYPE: 0x0 */
fprintf(ofp, "%c", 0);
@@ -464,53 +529,108 @@ start_page(BIE_CHAIN **root, int nbie, FILE *ofp)
else
fprintf(ofp, "%c", SourceCode);
fprintf(ofp, "%c", 0);
- if ((PageNum & 1) == 0 && EvenPages)
+ switch (Duplex)
{
+ case DMDUPLEX_OFF:
fprintf(ofp, "%c", 0);
- fprintf(ofp, "%c", 1);
- }
- else
- {
fprintf(ofp, "%c", 0);
+ break;
+ case DMDUPLEX_LONGEDGE:
+ case DMDUPLEX_SHORTEDGE:
+ fprintf(ofp, "%c", 1);
fprintf(ofp, "%c", 0);
+ break;
+ case DMDUPLEX_MANUALLONG:
+ case DMDUPLEX_MANUALSHORT:
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ fprintf(ofp, "%c", 0);
+ fprintf(ofp, "%c", 1);
+ }
+ else
+ {
+ fprintf(ofp, "%c", 0);
+ fprintf(ofp, "%c", 0);
+ }
+ break;
}
fprintf(ofp, "%c", 0);
- fprintf(ofp, "%c", 2);
+ if (Model == MODEL_CLP610)
+ fprintf(ofp, "%c", 5);
+ else
+ fprintf(ofp, "%c", 2);
fprintf(ofp, "%c%c", 1, ResX / 100);
- /* startpage, jbig_bih, jbig_bid, jbig_end, endpage */
- w = (((long) current->data[ 4] << 24)
- | ((long) current->data[ 5] << 16)
- | ((long) current->data[ 6] << 8)
- | (long) current->data[ 7]);
- h = (((long) current->data[ 8] << 24)
- | ((long) current->data[ 9] << 16)
- | ((long) current->data[10] << 8)
- | (long) current->data[11]);
-
- // pn goes from 4, 1, 2, 3
- for (pn = 4, i = 0; i < nbie; ++i)
+ if (Model == MODEL_CLP610)
{
- /* RECTYPE: 0xC */
- fprintf(ofp, "%c", 12);
- fprintf(ofp, "%c", 0);
- fprintf(ofp, "%c%c", (char) ((w/8)>>8), (char) (w/8));
- fprintf(ofp, "%c%c", 0, 128);
- fprintf(ofp, "%c", pn);
+ /* RECTYPE: 0x13 */
fprintf(ofp, "%c", 0x13);
- be32_write(ofp, 20+36);
+ fprintf(ofp, "%c%c%c", 0, 0, 0);
+ fprintf(ofp, "%c%c", 0x23, 0x15);
+ fprintf(ofp, "%c%c%c%c", 0, 0, 0, 0);
+ fprintf(ofp, "%c%c%c%c", 0, 0, 0, 0);
+ fprintf(ofp, "%c", 0);
+ }
+}
- cksum = be32_write(ofp, 0x39abcdef);
- cksum += be32_write(ofp, 20);
- cksum += be32_write(ofp, 0);
- cksum += be32_write(ofp, 0);
- cksum += be32_write(ofp, 0);
- cksum += be32_write(ofp, 0);
- cksum += be32_write(ofp, 0);
- cksum += be32_write(ofp, 0);
- cksum += write_cksum(current->data, 20, ofp);
- be32_write(ofp, cksum);
- if (++pn == 5) pn = 1;
+void
+start_page(BIE_CHAIN **root, int nbie, FILE *ofp)
+{
+ BIE_CHAIN *current = *root;
+ unsigned long w, h;
+ int i, pn;
+ int cksum;
+ static int pageno = 0;
+
+ /* error handling */
+ if (!current)
+ error(1, "There is no JBIG!\n");
+ if (!current->next)
+ error(1, "There is no or wrong JBIG header!\n");
+ if (current->len != 20 )
+ error(1,"wrong BIH length\n");
+
+ start_page_init(ofp);
+
+ if (Model == MODEL_CLP610)
+ error(1, "start_page: Model CLP-610 is uses start_page_banded!\n");
+
+ if (Model != MODEL_CLP610)
+ {
+ /* startpage, jbig_bih, jbig_bid, jbig_end, endpage */
+ w = (((long) current->data[ 4] << 24)
+ | ((long) current->data[ 5] << 16)
+ | ((long) current->data[ 6] << 8)
+ | (long) current->data[ 7]);
+ h = (((long) current->data[ 8] << 24)
+ | ((long) current->data[ 9] << 16)
+ | ((long) current->data[10] << 8)
+ | (long) current->data[11]);
+
+ // pn goes from 4, 1, 2, 3
+ for (pn = 4, i = 0; i < nbie; ++i)
+ {
+ /* RECTYPE: 0xC */
+ fprintf(ofp, "%c", 12);
+ fprintf(ofp, "%c", 0);
+ fprintf(ofp, "%c%c", (char) ((w/8)>>8), (char) (w/8));
+ fprintf(ofp, "%c%c", 0, 128);
+ fprintf(ofp, "%c", pn);
+ fprintf(ofp, "%c", 0x13);
+ be32_write(ofp, 20+36);
+
+ cksum = be32_write(ofp, 0x39abcdef);
+ cksum += be32_write(ofp, 20);
+ cksum += be32_write(ofp, 0);
+ cksum += be32_write(ofp, 0);
+ cksum += be32_write(ofp, 0);
+ cksum += be32_write(ofp, 0);
+ cksum += be32_write(ofp, 0);
+ cksum += be32_write(ofp, 0);
+ cksum += write_cksum(current->data, 20, ofp);
+ be32_write(ofp, cksum);
+ if (++pn == 5) pn = 1;
+ }
}
++pageno;
@@ -527,6 +647,102 @@ end_page(FILE *ofp)
}
int
+width2unk(int w)
+{
+ int u;
+
+ u = (26.0/6655.0) * w + 65;
+ return u;
+}
+
+int
+write_page_banded(int nbie, unsigned char *bm[4], int w, int h, int pn,
+ FILE *ofp)
+{
+ int y;
+ int firstbih = 1;
+ int stripe;
+ static int pageno = 0;
+ #define NBAND 128
+
+ start_page_init(ofp);
+
+ for (pn = 0; pn < nbie; ++pn)
+ {
+ stripe = 0;
+ for (y = 0; y < h; y += NBAND)
+ {
+ struct jbg_enc_state se;
+ unsigned char *bitmaps[1];
+ BIE_CHAIN *chain;
+ BIE_CHAIN *current;
+ int len;
+ int cksum;
+
+ int lines = (h-y) > NBAND ? NBAND : (h-y);
+
+ bitmaps[0] = bm[pn] + y * ((w+7)/8);
+ chain = NULL;
+
+ if (lines < NBAND)
+ JbgOptions[2] = lines;
+ else
+ JbgOptions[2] = NBAND;
+ JbgOptions[1] = JBG_DELAY_AT | JBG_LRLTWO;
+ jbg_enc_init(&se, w, lines, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ if (chain->len != 20)
+ error(1, "Program error: missing BIH at start of chain\n");
+
+ if (firstbih)
+ {
+ /* RECTYPE: 0x14 - BIH */
+ fprintf(ofp, "%c", 0x14);
+ fwrite(chain->data, 20, 1, ofp);
+ fprintf(ofp, "%c%c%c", 0, 0, 1);
+ /* UNK: maybe horiz. margin?
+ * Values: 78 for 3in to 104 for 8.5in
+ */
+ fprintf(ofp, "%c", width2unk(w));
+ firstbih = 0;
+ }
+
+ current = chain->next;
+ if (!current)
+ error(1, "No data in chain!\n");
+
+ len = current->len;
+
+ fprintf(ofp, "%c", 12);
+ fprintf(ofp, "%c", stripe);
+ ++stripe;
+ fprintf(ofp, "%c%c", (char) ((w/8)>>8), (char) (w/8));
+ fprintf(ofp, "%c%c", 0, 128);
+ if (nbie == 1)
+ fprintf(ofp, "%c", 4);
+ else
+ fprintf(ofp, "%c", pn+1);
+ fprintf(ofp, "%c", 0x15);
+ be32_write(ofp, len+4);
+
+ cksum = write_cksum(current->data, len, ofp);
+
+ be32_write(ofp, cksum);
+ free_chain(chain);
+ }
+ }
+
+ ++pageno;
+ end_page(ofp);
+
+ return 0;
+}
+
+int
write_page(BIE_CHAIN **root, BIE_CHAIN **root2,
BIE_CHAIN **root3, BIE_CHAIN **root4, FILE *ofp)
{
@@ -552,66 +768,6 @@ write_page(BIE_CHAIN **root, BIE_CHAIN **root2,
return 0;
}
-/*
- * This creates a linked list of compressed data. The first item
- * in the list is the BIH and is always 20 bytes in size. Each following
- * item is 65536 bytes in length. The last item length is whatever remains.
- */
-void
-output_jbig(unsigned char *start, size_t len, void *cbarg)
-{
- BIE_CHAIN *current, **root = (BIE_CHAIN **) cbarg;
- int size = 0x80000; // Printer does strange things otherwise.
-
- if ( (*root) == NULL)
- {
- (*root) = malloc(sizeof(BIE_CHAIN));
- if (!(*root))
- error(1, "Can't allocate space for chain\n");
-
- (*root)->data = NULL;
- (*root)->next = NULL;
- (*root)->len = 0;
- size = 20;
- if (len != 20)
- error(1, "First chunk must be BIH and 20 bytes long\n");
- }
-
- current = *root;
- while (current->next)
- current = current->next;
-
- while (len > 0)
- {
- int amt, left;
-
- if (!current->data)
- {
- current->data = malloc(size);
- if (!current->data)
- error(1, "Can't allocate space for compressed data\n");
- }
-
- left = size - current->len;
- amt = (len > left) ? left : len;
- memcpy(current->data + current->len, start, amt);
- current->len += amt;
- len -= amt;
- start += amt;
-
- if (current->len == size)
- {
- current->next = malloc(sizeof(BIE_CHAIN));
- if (!current->next)
- error(1, "Can't allocate space for chain\n");
- current = current->next;
- current->data = NULL;
- current->next = NULL;
- current->len = 0;
- }
- }
-}
-
void
start_doc(FILE *ofp)
{
@@ -642,11 +798,17 @@ start_doc(FILE *ofp)
switch (Duplex)
{
case DMDUPLEX_LONGEDGE:
+ fprintf(ofp, "@PJL SET DUPLEX=ON\r\n");
+ fprintf(ofp, "@PJL SET BINDING=LONGEDGE\r\n");
+ break;
case DMDUPLEX_MANUALLONG:
fprintf(ofp, "@PJL SET DUPLEX=MANUAL\r\n");
fprintf(ofp, "@PJL SET BINDING=LONGEDGE\r\n");
break;
case DMDUPLEX_SHORTEDGE:
+ fprintf(ofp, "@PJL SET DUPLEX=ON\r\n");
+ fprintf(ofp, "@PJL SET BINDING=SHORTEDGE\r\n");
+ break;
case DMDUPLEX_MANUALSHORT:
fprintf(ofp, "@PJL SET DUPLEX=MANUAL\r\n");
fprintf(ofp, "@PJL SET BINDING=SHORTEDGE\r\n");
@@ -773,36 +935,63 @@ cmyk_page(unsigned char *raw, int w, int h, FILE *ofp)
}
cmyk_planes(plane, raw, RealWidth, h);
- for (i = 0; i < 4; ++i)
+
+ if (Model == MODEL_CLP610)
{
- if (Debug >= 9)
+ unsigned char *bm[4];
+
+ if (Color2Mono)
{
- FILE *dfp;
- char fname[256];
- sprintf(fname, "xxxplane%d", i);
- dfp = fopen(fname, "w");
- if (dfp)
+ bm[0] = plane[Color2Mono-1];
+ write_page_banded(1, bm, w, h, 3, ofp);
+ }
+ else if (AnyColor)
+ {
+ bm[0] = plane[0];
+ bm[1] = plane[0];
+ bm[2] = plane[0];
+ bm[3] = plane[0];
+ write_page_banded(4, plane, w, h, 3, ofp);
+ }
+ else
+ {
+ bm[0] = plane[3];
+ write_page_banded(1, bm, w, h, 3, ofp);
+ }
+ }
+ else
+ {
+ for (i = 0; i < 4; ++i)
+ {
+ if (Debug >= 9)
{
- fwrite(plane[i], bpl*h, 1, dfp);
- fclose(dfp);
+ FILE *dfp;
+ char fname[256];
+ sprintf(fname, "xxxplane%d", i);
+ dfp = fopen(fname, "w");
+ if (dfp)
+ {
+ fwrite(plane[i], bpl*h, 1, dfp);
+ fclose(dfp);
+ }
}
- }
- *bitmaps[i] = plane[i];
+ *bitmaps[i] = plane[i];
- jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
- jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
- h, JbgOptions[3], JbgOptions[4]);
- jbg_enc_out(&se[i]);
- jbg_enc_free(&se[i]);
- }
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ h, JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
- if (Color2Mono)
- write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
- else if (AnyColor)
- write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
- else
- write_page(&chain[3], NULL, NULL, NULL, ofp);
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+ }
for (i = 0; i < 4; ++i)
free(plane[i]);
@@ -821,26 +1010,52 @@ pksm_page(unsigned char *plane[4], int w, int h, FILE *ofp)
w = (w + 127) & ~127;
debug(1, "w = %d\n", w);
- for (i = 0; i < 4; ++i)
- chain[i] = NULL;
-
- for (i = 0; i < 4; ++i)
+ if (Model == MODEL_CLP610)
{
- *bitmaps[i] = plane[i];
+ unsigned char *bm[4];
- jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
- jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
- h, JbgOptions[3], JbgOptions[4]);
- jbg_enc_out(&se[i]);
- jbg_enc_free(&se[i]);
+ if (Color2Mono)
+ {
+ bm[0] = plane[Color2Mono-1];
+ write_page_banded(1, bm, w, h, 3, ofp);
+ }
+ else if (AnyColor)
+ {
+ bm[0] = plane[0];
+ bm[1] = plane[0];
+ bm[2] = plane[0];
+ bm[3] = plane[0];
+ write_page_banded(4, plane, w, h, 3, ofp);
+ }
+ else
+ {
+ bm[0] = plane[3];
+ write_page_banded(1, bm, w, h, 3, ofp);
+ }
}
-
- if (Color2Mono)
- write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
- else if (AnyColor)
- write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
else
- write_page(&chain[3], NULL, NULL, NULL, ofp);
+ {
+ for (i = 0; i < 4; ++i)
+ chain[i] = NULL;
+
+ for (i = 0; i < 4; ++i)
+ {
+ *bitmaps[i] = plane[i];
+
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ h, JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
+
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+ }
return 0;
}
@@ -873,13 +1088,20 @@ pbm_page(unsigned char *buf, int w, int h, FILE *ofp)
*bitmaps = buf;
- jbg_enc_init(&se, w, h, 1, bitmaps, output_jbig, &chain);
- jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
- h, JbgOptions[3], JbgOptions[4]);
- jbg_enc_out(&se);
- jbg_enc_free(&se);
-
- write_page(&chain, NULL, NULL, NULL, ofp);
+ if (Model == MODEL_CLP610)
+ write_page_banded(1, bitmaps, w, h, 3, ofp);
+ else
+ {
+ if (0 && PaperCode == DMPAPER_CUSTOM)
+ h++;
+ jbg_enc_init(&se, w, h, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ h, JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ write_page(&chain, NULL, NULL, NULL, ofp);
+ }
return 0;
}
@@ -1005,8 +1227,10 @@ cmyk_pages(FILE *ifp, FILE *ofp)
goto done;
++PageNum;
+ #if 0
if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
+ #endif
if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
@@ -1185,8 +1409,10 @@ pksm_pages(FILE *ifp, FILE *ofp)
}
}
+ #if 0
if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(plane[i], plane[i] + bpl16 * h - 1, Mirror1);
+ #endif
if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
rotate_bytes_180(plane[i], plane[i] + bpl16 * h - 1, Mirror1);
}
@@ -1250,12 +1476,14 @@ pbm_pages(FILE *ifp, FILE *ofp)
UpperLeftX &= ~7;
w = rawW - UpperLeftX - LowerRightX;
+ // w = (w + 255) & ~255;
h = rawH - UpperLeftY - LowerRightY;
bpl = (w + 7) / 8;
rightBpl = (rawW - UpperLeftX + 7) / 8;
bpl16 = (bpl + 15) & ~15;
- debug(1, "bpl=%d bpl16=%d\n", bpl, bpl16);
+ debug(1, "rawW=%d rawBpl=%d w=%d bpl=%d bpl16=%d rightBpl=%d\n",
+ rawW, rawBpl, w, bpl, bpl16, rightBpl);
buf = malloc(bpl16 * h);
if (!buf)
@@ -1266,8 +1494,10 @@ pbm_pages(FILE *ifp, FILE *ofp)
error(1, "Premature EOF(pbm) on input stream\n");
++PageNum;
+ #if 0
if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
+ #endif
if ((PageNum & 1) == 0 && EvenPages)
{
@@ -1316,13 +1546,13 @@ parse_xy(char *str, int *xp, int *yp)
if (!str || str[0] == 0) return -1;
- *xp = strtoul(str, &p, 0);
+ *xp = strtoul(str, &p, 10);
if (str == p) return -2;
while (*p && (*p < '0' || *p > '9'))
++p;
str = p;
if (str[0] == 0) return -3;
- *yp = strtoul(str, &p, 0);
+ *yp = strtoul(str, &p, 10);
if (str == p) return -4;
return (0);
}
@@ -1369,7 +1599,7 @@ main(int argc, char *argv[])
int i, j;
while ( (c = getopt(argc, argv,
- "cd:g:n:m:p:r:s:tu:l:L:ABPJ:S:U:X:D:V?h")) != EOF)
+ "cd:g:n:m:p:r:s:tu:l:z:L:ABPJ:S:U:X:D:V?h")) != EOF)
switch (c)
{
case 'c': Mode = MODE_COLOR; break;
@@ -1406,6 +1636,10 @@ main(int argc, char *argv[])
if (parse_xy(optarg, &LowerRightX, &LowerRightY))
error(1, "Illegal format '%s' for -l\n", optarg);
break;
+ case 'z': Model = atoi(optarg);
+ if (Model < 0 || Model > MODEL_LAST)
+ error(1, "Illegal value '%s' for -z\n", optarg);
+ break;
case 'L': LogicalClip = atoi(optarg);
if (LogicalClip < 0 || LogicalClip > 3)
error(1, "Illegal value '%s' for -L\n", optarg);
@@ -1433,7 +1667,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (getenv("DEVICE_URL"))
+ if (getenv("DEVICE_URI"))
IsCUPS = 1;
Bpp = ResX / 600;
@@ -1446,8 +1680,6 @@ main(int argc, char *argv[])
switch (Duplex)
{
- case DMDUPLEX_LONGEDGE:
- case DMDUPLEX_SHORTEDGE:
case DMDUPLEX_MANUALLONG:
case DMDUPLEX_MANUALSHORT:
EvenPages = tmpfile();
diff --git a/foo2slx-wrapper.1in b/foo2slx-wrapper.1in
new file mode 100644
index 0000000..bff113d
--- /dev/null
+++ b/foo2slx-wrapper.1in
@@ -0,0 +1,196 @@
+'\" t
+.TH foo2slx-wrapper 1 "${MODpage}" "foo2slx-wrapper ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+foo2slx-wrapper \- Convert Postscript into a SLX printer stream
+.SH SYNOPSIS
+.B foo2slx-wrapper
+.RI [ options "] [" ps-file ]
+.SH DESCRIPTION
+.B foo2slx-wrapper
+is a Foomatic compatible printer wrapper for the \fBfoo2slx\fP printer driver.
+This script reads a Postscript \fIps-file\fP or standard input
+and converts it to Software Imaging K.K. SLX printer format
+for driving the Lexmark C500 network color laser printer
+and other SLX-based printers.
+.P
+This script can be used in a standalone fashion, but is intended to
+be called from a printer spooler system which uses the Foomatic
+printer database.
+
+.SH COMMAND LINE OPTIONS
+.SS Normal Options
+These are the options used to select the parameters of a
+print job that are usually controlled on a per job basis.
+.TP
+.BI \-c
+Print in color (else monochrome).
+.TP
+.BI \-m\0 media
+Media code to send to printer [0].
+.TS
+l l l
+l n n.
+_
+Media SLX
+_
+plain 0
+transparency 1
+labels 2
+thick1 3
+envelope1 4
+thin 5
+thick2 6
+envelope2 7
+middle 8
+special 9
+.TE
+.TP
+.BI \-p\0 paper
+Paper size code to send to printer [6].
+.TS
+box;
+| n l | n l.
+6 letter 2 A4
+9 legal 4 B5
+8 executive 5 B5iso
+10 env #10 11 env DL
+.TE
+.TP
+.BI \-n\0 copies
+Number of copies [1].
+.TP
+.BI \-r\0 xres x yres
+Set device resolution in pixels/inch [1200x600].
+.TP
+.BI \-s\0 source
+Source (Input Slot) code to send to printer [0].
+.TS
+box;
+| n l | n l.
+0 auto 1 cassette1
+.TE
+.TP
+.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18"
+Print in N-up. Requires the \fBpsutils\fP package.
+.TP
+.BI \-o\0 orient
+Orientation used for N-up.
+.TS
+l l l.
+Portrait -op (normal)
+Landscape -ol (rotated 90 degrees anticlockwise)
+Seascape -os (rotated 90 degrees clockwise)
+.TE
+.SS Printer Tweaking Options
+These are the options used to customize the operation of \fBfoo2slx\fP
+for a particular printer.
+.TP
+.BI \-u\0 xoff x yoff
+Set the offset of the start of the printable region from the
+upper left corner, in pixels [varies with paper size].
+The defaults should work on the 2200DL and 2300DL, and have not
+been tested on any other printers.
+.TP
+.BI \-l\0 xoff x yoff
+Set the offset of the end of the printable region from the
+lower right corner, in pixels [varies with paper size].
+The defaults should work on the 2200DL and 2300DL, and have not
+been tested on any other printers.
+.TP
+.BI \-L\0 mask
+Send the logical clipping values from -u/-l in the ZjStream.
+\fBfoo2slx-wrapper\fP always runs Ghostscript with the ideal page dimensions,
+so that the scale of the image is correct,
+regardless whether or not the printer has unprintable regions.
+This option is used to move the position of the clipped image
+back to where it belongs on the page. The default is to send
+the amount which was clipped by -u and -l, and should be
+good in most cases.
+.TS
+l l.
+0 don't send any logical clipping amounts
+1 only send Y clipping amount
+2 only send X clipping amount
+3 send both X and Y clipping amounts
+.TE
+.SS Color Tweaking Options
+These are the options used to control the quality of color output.
+Color correction is currently a WORK IN PROGRESS.
+.TP
+.BI \-g\0 gsopts
+Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq,
+etc. This option may appear more than once.
+.TP
+.BI \-G\0 profile.icm
+Convert \fIprofile.icm\fP to a Postscript color rendering
+dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and
+adjust the printer colors by using the Postscript \fBsetcolorrendering\fP
+operator. (WORK IN PROGRESS).
+.TP
+.BI \-G\0 gamma-file.ps
+Prepend \fIgamma-file.ps\fP to the Postscript input to perform
+color correction using the \fBsetcolortransfer\fP Postscript operator.
+For example, the file might contain:
+.br
+{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer
+.TP
+.BI \-I\0 intent
+Select profile intent from the ICM file.
+0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute.
+Default is 0 (perceptual).
+.SS Debugging Options
+These options are used for debugging \fBfoo2slx\fP and its wrapper.
+.TP
+.BI \-S\0 plane
+Output just a single color plane from a color print and print it
+on the black plane. The default is to output all color planes.
+.TS
+l l.
+1 Cyan
+2 Magenta
+3 Yellow
+4 Black
+.TE
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Create a monochrome ZjStream from a Postscript document,
+examine it, and then print it using a RAW print queue:
+
+.RS
+.nf
+foo2slx-wrapper testpage.ps > testpage.zm
+slxdecode < testpage.zm
+lpr -P raw testpage.zm
+.fi
+.RE
+.P
+Create a color ZjStream stream from a Postscript document:
+
+.RS
+.nf
+foo2slx-wrapper -c testpage.ps > testpage.zc
+.fi
+.RE
+
+.SH FILES
+.BR /usr/bin/foo2slx-wrapper
+.SH SEE ALSO
+.BR foo2slx (1),
+.BR slxdecode (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLSLX}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2slx-wrapper.in b/foo2slx-wrapper.in
new file mode 100755
index 0000000..3b132b4
--- /dev/null
+++ b/foo2slx-wrapper.in
@@ -0,0 +1,694 @@
+#!/bin/sh
+
+#* Copyright (C) 2003-2006 Rick Richardson
+#*
+#* This program is free software; you can redistribute it and/or modify
+#* it under the terms of the GNU General Public License as published by
+#* the Free Software Foundation; either version 2 of the License, or
+#* (at your option) any later version.
+#*
+#* This program is distributed in the hope that it will be useful,
+#* but WITHOUT ANY WARRANTY; without even the implied warranty of
+#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#* GNU General Public License for more details.
+#*
+#* You should have received a copy of the GNU General Public License
+#* along with this program; if not, write to the Free Software
+#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#*
+#* Authors: Rick Richardson <rick.richardson@comcast.net>
+
+VERSION='$Id: foo2slx-wrapper.in,v 1.12 2007/12/27 06:52:45 rick Exp $'
+
+#
+# Printer Notes:
+#
+# Lexmark C500 -
+#
+
+PROGNAME="$0"
+BASENAME=`basename $PROGNAME`
+PREFIX=/usr
+SHARE=$PREFIX/share/foo2slx
+PATH=$PATH:/sw/bin:/opt/local/bin
+
+#
+# Log the command line, for debugging and problem reports
+#
+if [ -x /usr/bin/logger ]; then
+ logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
+fi
+
+usage() {
+ cat <<EOF
+Usage:
+ $BASENAME [options] [ps-file]
+
+ Foomatic printer wrapper for the foo2slx printer driver.
+ This script reads a Postscript ps-file or standard input
+ and converts it to Software Imaging K.K. SLX printer format.
+
+Normal Options:
+-c Print in color (else monochrome)
+-m media Media code to send to printer [$MEDIA]
+ 0=plain, 1=transparency, 2=labels, 3=thick1, 4=envelope1,
+ 5=thin, 6=thick2, 7=envelope2, 8=middle, 9=special
+-p paper Paper code [$PAPER]
+ 2=a4, 4=b5, 5=b5iso, 6=letter, 8=executive, 9=legal,
+ 10=env#10, 11=envDL
+-n copies Number of copies [$COPIES]
+-r <xres>x<yres> Set device resolution in pixels/inch [$RES]
+-s source Source code to send to printer [$SOURCE]
+ 0=auto, 1=cassette1
+ Code numbers may vary with printer model.
+-2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18
+ Print with N-up (requires psutils)
+-o orient For N-up: -op is portrait, -ol is landscape, -os is seascape.
+
+Printer Tweaking Options:
+-u <xoff>x<yoff> Set offset of upper left printable in pixels [varies]
+-l <xoff>x<yoff> Set offset of lower right printable in pixels [varies]
+-L mask Send logical clipping values from -u/-l in ZjStream [3]
+ 0=no, 1=Y, 2=X, 3=XY
+
+Color Tweaking Options:
+-g gsopts Additional options to pass to Ghostscript, such as
+ -dDITHERPPI=nnn, etc. May appear more than once. []
+-G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and
+ adjust colors using the setcolorrendering PS operator.
+ $SHARE/icm/ will be searched for profile.icm.
+-I intent Select profile intent from ICM file [$INTENT]
+ 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute
+-G gamma-file.ps Prepend gamma-file to the Postscript input to perform
+ color correction using the setcolortransfer PS operator.
+
+Debugging Options:
+-S plane Output just a single color plane from a color print [all]
+ 1=Cyan, 2=Magenta, 3=Yellow, 4=Black
+-D lvl Set Debug level [$DEBUG]
+-V $VERSION
+EOF
+
+ exit 1
+}
+
+#
+# Report an error and exit
+#
+error() {
+ echo "$BASENAME: $1" >&2
+ exit 1
+}
+
+dbgcmd() {
+ if [ $DEBUG -ge 1 ]; then
+ echo "$@" >&2
+ fi
+ "$@"
+}
+
+#
+# N-up-ify the job. Requires psnup from psutils package
+#
+nup() {
+ case "$NUP" in
+ [2368]|1[0458])
+ tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q
+ ;;
+ [49]|1[26])
+ tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q
+ ;;
+ *)
+ error "Illegal call to nup()."
+ ;;
+ esac
+}
+
+#
+# Process the options
+#
+
+# Try to use a local copy of GhostScript 8.54, if available. Otherwise,
+# fallback to whatever the Linux distro has installed (usually 7.07)
+#
+# N.B. := operator used here, when :- would be better, because "ash"
+# doesn't have :-
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
+else
+ GSBIN=${GSBIN:-gs}
+fi
+
+CMDLINE="$*"
+DEBUG=0
+DUPLEX=1
+COLOR=
+COLORMODE=default
+MODEL=0
+QUALITY=wts
+MEDIA=0
+COPIES=1
+PAPER=6
+RES=600x600
+SOURCE=0
+NUP=
+CLIP_UL=
+CLIP_LR=
+CLIP_LOG=
+BC=
+AIB=
+NOPLANES=
+COLOR2MONO=
+GAMMAFILE=default
+INTENT=0
+GSOPTS=
+EXTRAPAD=
+SAVETONER=
+NUP_ORIENT=
+GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+7*) DEFAULTCOLORMODE=10
+ ;;
+8.1*)
+ DEFAULTCOLORMODE=10
+ QUALITY=1
+ ;;
+*) DEFAULTCOLORMODE=10
+ ;;
+esac
+while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
+do
+ case $opt in
+ b) GSBIN="$OPTARG";;
+ c) COLOR=-c;;
+ d) DUPLEX="$OPTARG";;
+ g) GSOPTS="$GSOPTS $OPTARG";;
+ m) MEDIA="$OPTARG";;
+ n) COPIES="$OPTARG";;
+ p) PAPER="$OPTARG";;
+ q) QUALITY="$OPTARG";;
+ r) RES="$OPTARG";;
+ s) SOURCE="$OPTARG";;
+ t) SAVETONER="-t";;
+ z) MODEL="$OPTARG";;
+ l) CLIP_LR="-l $OPTARG";;
+ u) CLIP_UL="-u $OPTARG";;
+ L) CLIP_LOG="-L $OPTARG";;
+ A) AIB=-A;;
+ B) BC=-B;;
+ C) COLORMODE="$OPTARG";;
+ S) COLOR2MONO="-S$OPTARG";;
+ D) DEBUG="$OPTARG";;
+ G) GAMMAFILE="$OPTARG";;
+ I) INTENT="$OPTARG";;
+ P) NOPLANES=-P;;
+ X) EXTRAPAD="-X $OPTARG";;
+ [234689]) NUP="$opt";;
+ [57]) error "Can't find acceptable layout for $opt-up";;
+ 1) case "$OPTARG" in
+ [024568]) NUP="1$OPTARG";;
+ *) error "Can't find acceptable layout for 1$OPTARG-up";;
+ esac
+ ;;
+ o) case "$OPTARG" in
+ l*) NUP_ORIENT=-l;;
+ s*) NUP_ORIENT=-r;;
+ p*|*) NUP_ORIENT=;;
+ esac;;
+ V) echo "$VERSION"; foo2slx -V; foo2zjs-pstops -V; exit 0;;
+ h|\?)
+ if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
+ echo "Illegal command:"
+ echo " $0 $CMDLINE"
+ echo
+ fi
+ usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+#
+# If there is an argument left, take it as the file to print.
+# Else, the input comes from stdin.
+#
+if [ $# -ge 1 ]; then
+ if [ "$LPJOB" = "" ]; then
+ : # LPJOB="$1"
+ fi
+ exec < $1
+fi
+
+#
+case "$QUALITY" in
+0)
+ GSOPTS="-dCOLORSCREEN $GSOPTS"
+ ;;
+1)
+ GSOPTS="-dCOLORSCREEN $GSOPTS"
+ ;;
+2)
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
+ ;;
+esac
+
+#
+# Validate model code
+#
+case "$MODEL" in
+0|1) ;;
+*) error "Unknown model code $MODEL";;
+esac
+
+#
+# Validate media code
+#
+case "$MEDIA" in
+0|plain|standard) MEDIA=0;;
+1|transparency) MEDIA=1;;
+2|labels) MEDIA=2;;
+9|special) MEDIA=9;;
+5|thin) MEDIA=5;;
+8|middle) MEDIA=8;;
+3|thick1) MEDIA=3;;
+6|thick2) MEDIA=6;;
+4|envelope1) MEDIA=4;;
+7|envelope2) MEDIA=7;;
+[0-9]*) ;;
+*) error "Unknown media code $MEDIA";;
+esac
+
+#
+# Validate source (InputSlot) code
+#
+case "$SOURCE" in
+1|cassette1) SOURCE=1;;
+0|auto) SOURCE=0;;
+[0-9]*) ;;
+*) error "Unknown source code $SOURCE";;
+esac
+
+#
+# Validate Duplex code
+#
+case "$DUPLEX" in
+1|off|none) DUPLEX=1;;
+2|long*) DUPLEX=2;;
+3|short*) DUPLEX=3;;
+[0-9]*) ;;
+*) error "Unknown duplex code $DUPLEX";;
+esac
+
+#
+# Validate Resolution
+#
+case "$RES" in
+600x600) ;;
+1200x600) ;;
+*) error "Illegal resolution $RES";;
+esac
+
+#
+# Figure out the paper dimensions in pixels/inch, and set the
+# default clipping region. Unfortunately, this is a trouble
+# area for ZjStream printers. Various versions of ZjS print
+# engines react differently when asked to print into their
+# unprintable regions.
+#
+set_clipping() {
+ ulx=$1; uly=$2
+ lrx=$3; lry=$4
+
+ # Set clipping region if it isn't already set
+ if [ "$CLIP_UL" = "" ]; then
+ case "$RES" in
+ 600x600) ulx=`expr $ulx / 2`;;
+ 2400x600) ulx=`expr $ulx \* 2`;;
+ esac
+ CLIP_UL="-u ${ulx}x${uly}"
+ fi
+ if [ "$CLIP_LR" = "" ]; then
+ case "$RES" in
+ 600x600) lrx=`expr $lrx / 2`;;
+ 2400x600) lrx=`expr $lrx \* 2`;;
+ esac
+ CLIP_LR="-l ${lrx}x${lry}"
+ fi
+}
+
+case "$PAPER" in
+Custom*)
+ #%%BeginFeature: *CustomPageSize True
+ #216
+ #360
+ #0
+ #0
+ #0
+ #pop pop pop pop pop
+
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
+ cat >$TMPFILE
+ exec <$TMPFILE
+
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
+ ;;
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
+ ;;
+ esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
+ YDIM=`dc -e "$YDIM 600* 72/p"`
+ PAPER=255; paper=letter;
+ MEDIA=4
+ set_clipping 2 100 2 100
+ ;;
+6|letter) PAPER=6; paper=letter; XDIM="10200"; YDIM="6600"
+ case "$MODEL" in
+ 0) set_clipping 204 102 204 106;;
+ 1) set_clipping 192 96 192 96;;
+ # 1) set_clipping 96 96 288 96;;
+ esac
+ ;;
+2|a4|A4) PAPER=2; paper=a4; XDIM="9920"; YDIM="7016"
+ case "$MODEL" in
+ 0) set_clipping 200 100 200 100 ;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+13|a5|A5) PAPER=13; paper=a5; XDIM="6992"; YDIM="4960"
+ case "$MODEL" in
+ 0) set_clipping 200 100 200 100;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+4|b5|B5) PAPER=4; paper=b5; XDIM="8598"; YDIM="6070"
+ case "$MODEL" in
+ 0) set_clipping 207 107 207 107;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+5|b5iso) PAPER=5; paper=b5iso; XDIM="8220"; YDIM="6024"
+ case "$MODEL" in
+ 0) set_clipping 207 107 207 107;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+8|executive) PAPER=8; paper=executive; XDIM="8700"; YDIM="6300"
+ case "$MODEL" in
+ 0) set_clipping 206 102 206 102;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+9|legal) PAPER=9; paper=legal; XDIM="10200"; YDIM="8400"
+ case "$MODEL" in
+ 0) set_clipping 204 102 204 106;;
+ 1) set_clipping 192 96 192 96;;
+ esac
+ ;;
+10|"env#10") PAPER=10; paper=env10; XDIM="4950"; YDIM="5700"
+ case "$MODEL" in
+ 0) set_clipping 171 78 171 78;;
+ 1) set_clipping 171 78 171 78;;
+ esac
+ ;;
+11|envDL) PAPER=11; paper=envDL; XDIM="5200"; YDIM="5200"
+ case "$MODEL" in
+ 0) set_clipping 176 84 176 84;;
+ 1) set_clipping 176 84 176 84;;
+ esac
+ ;;
+
+28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408"
+ case "$MODEL" in
+ 0) set_clipping 170 80 169 80;;
+ 1) set_clipping 170 80 169 80;;
+ esac
+ ;;
+34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892"
+ case "$MODEL" in
+ 0) set_clipping 174 74 174 74;;
+ 1) set_clipping 174 74 174 74;;
+ esac
+ ;;
+37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500"
+ case "$MODEL" in
+ 0) set_clipping 174 78 173 78;;
+ 1) set_clipping 174 78 173 78;;
+ esac
+ ;;
+*) error "Unimplemented paper code $PAPER";;
+esac
+# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps
+PAPERSIZE="-sPAPERSIZE=$paper";
+
+case "$RES" in
+600x600) XDIM=`expr $XDIM / 2`;;
+1200x600) ;;
+esac
+DIM="${XDIM}x${YDIM}"
+
+#
+# Filter thru psnup if N-up printing has been requested
+#
+case $NUP in
+[234689]|1[024568]) PREFILTER="nup";;
+*) PREFILTER=cat;;
+esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
+
+#
+# Overload -G. If the file name ends with ".icm" or ".ICM"
+# then convert the ICC color profile to a Postscript CRD,
+# then prepend it to the users job. Select the intent
+# using the -I option.
+#
+
+create_crd() {
+ #
+ # Create a Postscript CRD
+ #
+ ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
+ if [ -x $ICC2PS ]; then
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ ;;
+ *)
+ $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
+ || error "Problem converting .ICM file to Postscript"
+ ;;
+ esac
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
+ cat > $ICCTMP.usecie.ps <<-EOF
+ %!PS-Adobe-3.0
+ <</UseCIEColor true>>setpagedevice
+ EOF
+ if [ "$QUALITY" = wts ]; then
+ cat >> $ICCTMP.usecie.ps <<-EOF
+ << /UseWTS true >> setuserparams
+ <<
+ /AccurateScreens true
+ /HalftoneType 1
+ /HalftoneName (Round Dot Screen) cvn
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
+ /Frequency 137
+ /Angle 37
+ >> sethalftone
+ EOF
+ fi
+ cat > $ICCTMP.selcrd.ps <<-EOF
+ /Current /ColorRendering findresource setcolorrendering
+ EOF
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
+ *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
+ esac
+ else
+ GAMMFILE=
+ fi
+}
+
+if [ $DEBUG -gt 0 ]; then
+ ICCTMP=/tmp/icc
+else
+ ICCTMP=/tmp/icc$$
+fi
+
+if [ "" = "$COLOR" ]; then
+ COLORMODE=
+ GAMMAFILE=
+else
+ case "$COLORMODE" in
+ default) COLORMODE=$DEFAULTCOLORMODE;;
+ esac
+ case "$GAMMAFILE" in
+ default) GAMMAFILE=lexRPCA2000.icm;;
+ esac
+fi
+
+CRDBASE="$PREFIX/share/foo2slx/crd"
+case "$RES" in
+ 600x600) SCREEN=screen1200.ps;;
+ 1200x600) SCREEN=screen1200.ps;;
+esac
+
+PSTOPS_OPTS="-n"
+
+case "$COLORMODE" in
+0|"")
+ # Monochrome
+ ;;
+10|icm)
+ # Use old ICM method
+ AIB=-A
+ BC=-B
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ create_crd
+ ;;
+ *.icm|*.ICM|*.icc|*.ICC)
+ #
+ # Its really an .ICM file, not a gamma file.
+ #
+ # The file can be a full path name, or the name of a file in $SHARE/icm/
+ #
+ if [ -r "$GAMMAFILE" ]; then
+ create_crd
+ elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then
+ GAMMAFILE="$SHARE/icm/$GAMMAFILE"
+ create_crd
+ else
+ GAMMAFILE=
+ fi
+ ;;
+ esac
+ ;;
+1|photo)
+ # Photo
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+2|graphics)
+ # Photo and Text
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+3|text)
+ # Graphic and Text
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+4|tonersave)
+ # Reduced toner
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd"
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+*.crd)
+ GAMMAFILE="$CRDBASE/prolog.ps"
+ if [ -f $COLORMODE ]; then
+ GAMMAFILE="$GAMMAFILE $COLORMODE"
+ elif [ -f $CRDBASE/$COLORMODE ]; then
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"
+ else
+ error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"
+ fi
+ GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"
+ ;;
+*)
+ error "Unknown color method '$COLORMODE'"
+ ;;
+esac
+
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
+if [ "" != "$COLOR" ]; then
+ if [ "" = "$AIB" -a "" = "$BC" ]; then
+ # Faster, but can't handle AllIsBlack or BlackClears
+ GSDEV=-sDEVICE=pksmraw
+ else
+ # Can't handle different size pages
+ GSDEV=-sDEVICE=bitcmyk
+ fi
+fi
+
+#
+# Figure out USERNAME
+#
+if [ "$LPUSER" != "" ]; then
+ USER="$LPUSER@$LPHOST"
+else
+ USER=""
+fi
+
+#
+# Main Program, just cobble together the pipeline and run it
+#
+# The malarky with file descriptors 1 and 3 is to avoid a bug in
+# (some versions?) of Ghostscript where Postscript's stdout gets
+# intermingled with the printer drivers output, resulting in
+# corrupted image data.
+#
+GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+
+foo2zjs-pstops $PSTOPS_OPTS | \
+$PREFILTER \
+| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
+| foo2slx -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
+ -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
+ -J "$LPJOB" -U "$USER" \
+ $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG
+
+#
+# Log the command line, for debugging and problem reports
+#
+if [ -x /usr/bin/logger ]; then
+ logger -t "$BASENAME" -p lpr.info -- \
+ "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
+ logger -t "$BASENAME" -p lpr.info -- \
+ "foo2slx -r$RES -g$DIM -p$PAPER -m$MEDIA \
+-n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
+$SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"
+fi
+
+#
+# Remove cruft
+#
+if [ $DEBUG -eq 0 ]; then
+ for i in crd.ps log usecie.ps selcrd.ps
+ do
+ file="$ICCTMP.$i"
+ [ -f $file ] && rm -f $file
+ done
+ [ -f "$TMPFILE" ] && rm -f $TMPFILE
+fi
+
+exit 0
diff --git a/foo2slx.1in b/foo2slx.1in
new file mode 100644
index 0000000..a441c17
--- /dev/null
+++ b/foo2slx.1in
@@ -0,0 +1,163 @@
+'\" t
+.TH foo2slx 1 "${MODpage}" "foo2slx ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+foo2slx \- Convert Ghostscript pbmraw or bitcmyk format into a
+SLX printer stream
+.SH SYNOPSIS
+.B foo2slx
+.RI [ options "] <" pbmraw-file " >" slx-file
+.sp 1
+.B foo2slx
+.RI [ options "] <" bitcmyk-file " >" slx-file
+.sp 1
+.B foo2slx
+.RI [ options "] <" pksmraw-file " >" slx-file
+.SH DESCRIPTION
+.B foo2slx
+converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome
+or color SLX streams,
+for driving the Lexmark C500 network color laser printer
+and other SLZ-based printers. The SLX stream is a variant of ZjStream
+produced by Software Imaging K.K.
+
+.SH COMMAND LINE OPTIONS
+.SS Normal Options
+These are the options used to select the parameters of a
+print job that are usually controlled on a per job basis.
+.TP
+.BI \-c
+Force color mode if autodetect doesn't work.
+.TP
+.BI \-g\0 xpix x ypix
+Set page dimensions in pixels [10200x6600].
+.TP
+.BI \-m\0 media
+Media code to send to printer [0].
+.TS
+l l l
+l n n.
+_
+Media SLX
+_
+plain 0
+transparency 1
+labels 2
+thick1 3
+envelope1 4
+thin 5
+thick2 6
+envelope2 7
+middle 8
+special 9
+.TE
+.TP
+.BI \-p\0 paper
+Paper code to send to printer [6].
+.TS
+box;
+| n l | n l.
+6 letter 2 A4
+9 legal 4 B5
+8 executive 5 B5iso
+10 env #10 11 env DL
+.TE
+.TP
+.BI \-n\0 copies
+Number of copies [1].
+.TP
+.BI \-r\0 xres x yres
+Set device resolution in pixels/inch [1200x600].
+.TP
+.BI \-s\0 source
+Source (InputSlot) code to send to printer [0].
+.TS
+| n l | n l.
+0 auto 1 cassette1
+.TE
+.SS Printer Tweaking Options
+These are the options used to customize the operation of \fBfoo2slx\fP
+for a particular printer.
+.TP
+.BI \-u\0 xoff x yoff
+Set the offset of the start of the printable region from the
+upper left corner, in pixels [0x0].
+.TP
+.BI \-l\0 xoff x yoff
+Set the offset of the end of the printable region from the
+lower right corner, in pixels [0x0].
+.TP
+.BI \-L\0 mask
+Send logical clipping amounts implied by -u/-l in the ZjStream [3].
+.TS
+l l.
+0 don't send any logical clipping amounts
+1 only send Y clipping amount
+2 only send X clipping amount
+3 send both X and Y clipping amounts
+.TE
+.TP
+.BI \-A
+AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only.
+.TP
+.BI \-B
+BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only.
+.TP
+.SS Debugging Options
+These options are used for debugging \fBfoo2slx\fP.
+.TP
+.BI \-S\0 plane
+Output just a single color plane from a color print and print it
+on the black plane. The default is to output all color planes.
+.TS
+l l.
+1 Cyan
+2 Magenta
+3 Yellow
+4 Black
+.TE
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Create a black and white SLX stream:
+
+.RS
+.nf
+gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \
+ -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \
+ -sOutputFile=- - < testpage.ps \
+| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zm
+.fi
+.RE
+.P
+Create a color SLX stream:
+
+.RS
+.nf
+gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \
+ -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \
+ -sOutputFile=- - < testpage.ps \
+| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zc
+.fi
+.RE
+
+.SH FILES
+.BR /usr/bin/foo2slx
+.SH SEE ALSO
+.BR foo2slx-wrapper (1),
+.BR slxdecode (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLSLX}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2slx.c b/foo2slx.c
new file mode 100644
index 0000000..35c73cb
--- /dev/null
+++ b/foo2slx.c
@@ -0,0 +1,1546 @@
+/*
+
+GENERAL
+This program converts pbm (B/W) images and 1-bit-per-pixel cmyk images
+(both produced by ghostscript) to Software Imaging K.K. SLX-stream format.
+
+With this utility, you can print to some Lexmark printers, such as these:
+ - Lexmark C500 B/W and Color
+
+AUTHORS
+This program began life as"foo2zjs' and was converted to drive
+Lexmark C500 printers.
+
+You can contact the current author at mailto:rick.richardson@comcast.net
+
+LICENSE
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at
+your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+If you want to use this program under different license conditions,
+then contact the author for an arrangement.
+
+It is possible that certain products which can be built using the jbig
+software module might form inventions protected by patent rights in
+some countries (e.g., by patents about arithmetic coding algorithms
+owned by IBM and AT&T in the USA). Provision of this software by the
+author does NOT include any licenses for any patents. In those
+countries where a patent license is required for certain applications
+of this software module, you will have to obtain such a license
+yourself.
+
+*/
+
+static char Version[] = "$Id: foo2slx.c,v 1.20 2007/12/13 15:30:50 rick Exp $";
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+#include "jbig.h"
+#include "slx.h"
+
+/*
+ * Command line options
+ */
+int Debug = 0;
+int ResX = 1200;
+int ResY = 600;
+int Bpp = 1;
+int PaperCode = DMPAPER_LETTER;
+int PageWidth = 1200 * 8.5;
+int PageHeight = 600 * 11;
+int UpperLeftX = 0;
+int UpperLeftY = 0;
+int LowerRightX = 0;
+int LowerRightY = 0;
+int Copies = 1;
+int Duplex = DMDUPLEX_OFF;
+int SourceCode = DMBIN_AUTO;
+int MediaCode = DMMEDIA_STANDARD;
+char *Username = NULL;
+char *Filename = NULL;
+int Mode = 0;
+ #define MODE_MONO 1
+ #define MODE_COLOR 2
+int Model = 0;
+ #define MODEL_2300DL 0
+ #define MODEL_HP1020 1
+ #define MODEL_LAST 1
+
+int Color2Mono = 0;
+int BlackClears = 0;
+int AllIsBlack = 0;
+int OutputStartPlane = 1;
+int ExtraPad = 0;
+
+int LogicalOffsetX = 0;
+int LogicalOffsetY = 0;
+
+#define LOGICAL_CLIP_X 2
+#define LOGICAL_CLIP_Y 1
+int LogicalClip = LOGICAL_CLIP_X | LOGICAL_CLIP_Y;
+int SaveToner = 0;
+int PageNum = 0;
+int RealWidth;
+int EconoMode = 0;
+
+int IsCUPS = 0;
+
+FILE *EvenPages = NULL;
+typedef struct
+{
+ off_t b, e;
+} SEEKREC;
+SEEKREC SeekRec[2000];
+int SeekIndex = 0;
+off_t SeekMedia;
+
+long JbgOptions[5] =
+{
+ /* Order */
+ // JBG_ILEAVE | JBG_SMID,
+ 0,
+ /* Options */
+ // JBG_DELAY_AT | JBG_LRLTWO | JBG_TPDON | JBG_TPBON | JBG_DPON,
+ JBG_DELAY_AT | JBG_TPBON,
+ /* L0 */
+ 128,
+ /* MX */
+ 0, //16,
+ /* MY */
+ 0
+};
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" foo2slx [options] <pbmraw-file >slx-file\n"
+"\n"
+" Convert Ghostscript pbmraw format to a monochrome SLX stream,\n"
+" for driving the Lexmark C500 network color laser printer\n"
+" and other SLX-based and Lexmark black and white printers.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zm\n"
+"\n"
+" foo2slx [options] <bitcmyk-file >slx-file\n"
+" foo2slx [options] <pksmraw-file >slx-file\n"
+"\n"
+" Convert Ghostscript bitcmyk or pksmraw format to a color SLX stream,\n"
+" for driving the Lexmark C500 network color laser printer.\n"
+" N.B. Color correction is expected to be performed by ghostscript.\n"
+"\n"
+" gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \\ \n"
+" -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \\ \n"
+" -sOutputFile=- - < testpage.ps \\ \n"
+" | foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zc\n"
+"\n"
+"Normal Options:\n"
+"-c Force color mode if autodetect doesn't work\n"
+// "-d duplex Duplex code to send to printer [%d]\n"
+// " 1=off, 2=longedge, 3=shortedge\n"
+// " 4=manual longedge, 5=manual shortedge\n"
+"-g <xpix>x<ypix> Set page dimensions in pixels [%dx%d]\n"
+"-m media Media code to send to printer [%d]\n"
+" 0=plain, 1=transparency, 2=labels, 3=thick1, 4=envelope1\n"
+" 5=thin, 6=thick2, 7=envelope2, 8=middle, 9=special\n"
+"-p paper Paper code to send to printer [%d]\n"
+" 2=a4, 4=b5, 5=b5iso, 6=letter, 8=executive, 9=legal,\n"
+" 10=env#10, 11=envDL\n"
+"-n copies Number of copies [%d]\n"
+"-r <xres>x<yres> Set device resolution in pixels/inch [%dx%d]\n"
+"-s source Source code to send to printer [%d]\n"
+" 1=upper 2=lower 4=manual 7=auto\n"
+" Code numbers may vary with printer model\n"
+// "-t Draft mode. Every other pixel is white.\n"
+// "-J filename Filename string to send to printer [%s]\n"
+// "-U username Username string to send to printer [%s]\n"
+"\n"
+"Printer Tweaking Options:\n"
+"-u <xoff>x<yoff> Set offset of upper left printable in pixels [%dx%d]\n"
+"-l <xoff>x<yoff> Set offset of lower right printable in pixels [%dx%d]\n"
+"-L mask Send logical clipping values from -u/-l in ZjStream [%d]\n"
+" 0=no, 1=Y, 2=X, 3=XY\n"
+"-A AllIsBlack: convert C=1,M=1,Y=1 to just K=1\n"
+"-B BlackClears: K=1 forces C,M,Y to 0\n"
+" -A, -B work with bitcmyk input only\n"
+// "-P Do not output START_PLANE codes. May be needed by some\n"
+// " some black and white only printers.\n"
+// "-X padlen Add extra zero padding to the end of BID segments [%d]\n"
+// "-z model Model: 0=2300DL 1=hp1020 [%d]\n"
+"\n"
+"Debugging Options:\n"
+"-S plane Output just a single color plane from a color print [all]\n"
+" 1=Cyan, 2=Magenta, 3=Yellow, 4=Black\n"
+"-D lvl Set Debug level [%d]\n"
+"-V Version %s\n"
+ // , Duplex
+ , PageWidth , PageHeight
+ , MediaCode
+ , PaperCode
+ , Copies
+ , ResX , ResY
+ , SourceCode
+ // , Filename ? Filename : ""
+ // , Username ? Username : ""
+ , UpperLeftX , UpperLeftY
+ , LowerRightX , LowerRightY
+ , LogicalClip
+ // , ExtraPad
+ // , Model
+ , Debug
+ , Version
+ );
+
+ exit(1);
+}
+
+/*
+ * Mirror1: bits 01234567 become 76543210
+ */
+unsigned char Mirror1[256] =
+{
+ 0,128, 64,192, 32,160, 96,224, 16,144, 80,208, 48,176,112,240,
+ 8,136, 72,200, 40,168,104,232, 24,152, 88,216, 56,184,120,248,
+ 4,132, 68,196, 36,164,100,228, 20,148, 84,212, 52,180,116,244,
+ 12,140, 76,204, 44,172,108,236, 28,156, 92,220, 60,188,124,252,
+ 2,130, 66,194, 34,162, 98,226, 18,146, 82,210, 50,178,114,242,
+ 10,138, 74,202, 42,170,106,234, 26,154, 90,218, 58,186,122,250,
+ 6,134, 70,198, 38,166,102,230, 22,150, 86,214, 54,182,118,246,
+ 14,142, 78,206, 46,174,110,238, 30,158, 94,222, 62,190,126,254,
+ 1,129, 65,193, 33,161, 97,225, 17,145, 81,209, 49,177,113,241,
+ 9,137, 73,201, 41,169,105,233, 25,153, 89,217, 57,185,121,249,
+ 5,133, 69,197, 37,165,101,229, 21,149, 85,213, 53,181,117,245,
+ 13,141, 77,205, 45,173,109,237, 29,157, 93,221, 61,189,125,253,
+ 3,131, 67,195, 35,163, 99,227, 19,147, 83,211, 51,179,115,243,
+ 11,139, 75,203, 43,171,107,235, 27,155, 91,219, 59,187,123,251,
+ 7,135, 71,199, 39,167,103,231, 23,151, 87,215, 55,183,119,247,
+ 15,143, 79,207, 47,175,111,239, 31,159, 95,223, 63,191,127,255,
+};
+
+/*
+ * Mirror2: bits 01234567 become 67452301
+ */
+unsigned char Mirror2[256] =
+{
+ 0, 64,128,192, 16, 80,144,208, 32, 96,160,224, 48,112,176,240,
+ 4, 68,132,196, 20, 84,148,212, 36,100,164,228, 52,116,180,244,
+ 8, 72,136,200, 24, 88,152,216, 40,104,168,232, 56,120,184,248,
+ 12, 76,140,204, 28, 92,156,220, 44,108,172,236, 60,124,188,252,
+ 1, 65,129,193, 17, 81,145,209, 33, 97,161,225, 49,113,177,241,
+ 5, 69,133,197, 21, 85,149,213, 37,101,165,229, 53,117,181,245,
+ 9, 73,137,201, 25, 89,153,217, 41,105,169,233, 57,121,185,249,
+ 13, 77,141,205, 29, 93,157,221, 45,109,173,237, 61,125,189,253,
+ 2, 66,130,194, 18, 82,146,210, 34, 98,162,226, 50,114,178,242,
+ 6, 70,134,198, 22, 86,150,214, 38,102,166,230, 54,118,182,246,
+ 10, 74,138,202, 26, 90,154,218, 42,106,170,234, 58,122,186,250,
+ 14, 78,142,206, 30, 94,158,222, 46,110,174,238, 62,126,190,254,
+ 3, 67,131,195, 19, 83,147,211, 35, 99,163,227, 51,115,179,243,
+ 7, 71,135,199, 23, 87,151,215, 39,103,167,231, 55,119,183,247,
+ 11, 75,139,203, 27, 91,155,219, 43,107,171,235, 59,123,187,251,
+ 15, 79,143,207, 31, 95,159,223, 47,111,175,239, 63,127,191,255,
+};
+
+/*
+ * Mirror4: bits 01234567 become 45670123
+ */
+unsigned char Mirror4[256] =
+{
+ 0, 16, 32, 48, 64, 80, 96,112,128,144,160,176,192,208,224,240,
+ 1, 17, 33, 49, 65, 81, 97,113,129,145,161,177,193,209,225,241,
+ 2, 18, 34, 50, 66, 82, 98,114,130,146,162,178,194,210,226,242,
+ 3, 19, 35, 51, 67, 83, 99,115,131,147,163,179,195,211,227,243,
+ 4, 20, 36, 52, 68, 84,100,116,132,148,164,180,196,212,228,244,
+ 5, 21, 37, 53, 69, 85,101,117,133,149,165,181,197,213,229,245,
+ 6, 22, 38, 54, 70, 86,102,118,134,150,166,182,198,214,230,246,
+ 7, 23, 39, 55, 71, 87,103,119,135,151,167,183,199,215,231,247,
+ 8, 24, 40, 56, 72, 88,104,120,136,152,168,184,200,216,232,248,
+ 9, 25, 41, 57, 73, 89,105,121,137,153,169,185,201,217,233,249,
+ 10, 26, 42, 58, 74, 90,106,122,138,154,170,186,202,218,234,250,
+ 11, 27, 43, 59, 75, 91,107,123,139,155,171,187,203,219,235,251,
+ 12, 28, 44, 60, 76, 92,108,124,140,156,172,188,204,220,236,252,
+ 13, 29, 45, 61, 77, 93,109,125,141,157,173,189,205,221,237,253,
+ 14, 30, 46, 62, 78, 94,110,126,142,158,174,190,206,222,238,254,
+ 15, 31, 47, 63, 79, 95,111,127,143,159,175,191,207,223,239,255,
+};
+
+void
+rotate_bytes_180(unsigned char *sp, unsigned char *ep, unsigned char *mirror)
+{
+ unsigned char tmp;
+
+ while (sp < ep)
+ {
+ tmp = mirror[*sp];
+ *sp = mirror[*ep];
+ *ep = tmp;
+ ++sp;
+ --ep;
+ }
+ if (sp == ep)
+ *sp = mirror[*sp];
+}
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ setvbuf(stderr, (char *) NULL, _IOLBF, BUFSIZ);
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+void
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+
+ if (fatal)
+ exit(fatal);
+}
+
+static void
+chunk_write_rsvd(unsigned long type, unsigned int rsvd,
+ unsigned long items, unsigned long size, FILE *fp)
+{
+ SL_HEADER chunk;
+
+ chunk.type = be32(type);
+ chunk.items = be32(items);
+ chunk.size = be32(sizeof(SL_HEADER) + size);
+ chunk.reserved = be16(rsvd);
+ chunk.signature = 0xa5a5;
+ fwrite(&chunk, 1, sizeof(SL_HEADER), fp);
+}
+
+static void
+chunk_write(unsigned long type, unsigned long items, unsigned long size,
+ FILE *fp)
+{
+ chunk_write_rsvd(type, 0, items, size, fp);
+}
+
+static void
+item_uint32_write(unsigned short item, unsigned long value, FILE *fp)
+{
+ SL_ITEM_UINT32 item_uint32;
+
+ item_uint32.header.size = be32(sizeof(SL_ITEM_UINT32));
+ item_uint32.header.item = be16(item);
+ item_uint32.header.type = SLIT_UINT32;
+ item_uint32.header.param = 0;
+ item_uint32.value = be32(value);
+ fwrite(&item_uint32, 1, sizeof(SL_ITEM_UINT32), fp);
+}
+
+static void
+item_int32_write_pad(unsigned short item, long value, int pad, FILE *fp)
+{
+ SL_ITEM_INT32 item_int32;
+
+ item_int32.header.size = be32(sizeof(SL_ITEM_INT32) + pad);
+ item_int32.header.item = be16(item);
+ item_int32.header.type = SLIT_INT32;
+ item_int32.header.param = 0;
+ item_int32.value = be32(value);
+ fwrite(&item_int32, 1, sizeof(SL_ITEM_INT32), fp);
+ while (pad--)
+ fputc(0, fp);
+}
+
+int
+item_str_write(unsigned short item, char *str, FILE *fp)
+{
+ int lenpadded;
+ SL_ITEM_HEADER hdr;
+
+ lenpadded = 4 * ((strlen(str)+1 + 3) / 4);
+
+ hdr.size = be32(sizeof(hdr) + lenpadded);
+ hdr.item = be16(item);
+ hdr.type = SLIT_STRING;
+ hdr.param = 0;
+ if (fp)
+ {
+ fwrite(&hdr, sizeof(hdr), 1, fp);
+ fwrite(str, lenpadded, 1, fp);
+ }
+ return (sizeof(hdr) + lenpadded);
+}
+
+/*
+ * A linked list of compressed data
+ */
+typedef struct _BIE_CHAIN{
+ unsigned char *data;
+ size_t len;
+ struct _BIE_CHAIN *next;
+} BIE_CHAIN;
+
+void
+free_chain(BIE_CHAIN *chain)
+{
+ BIE_CHAIN *next;
+ next = chain;
+ while ((chain = next))
+ {
+ next = chain->next;
+ if (chain->data)
+ free(chain->data);
+ free(chain);
+ }
+}
+
+int
+write_plane(int planeNum, BIE_CHAIN **root, FILE *fp)
+{
+ BIE_CHAIN *current = *root;
+ BIE_CHAIN *next;
+ int i, len, pad_len;
+ #define PADTO 4
+
+ debug(3, "Write Plane %d\n", planeNum);
+
+ /* error handling */
+ if (!current)
+ error(1,"There is no JBIG!\n");
+ if (!current->next)
+ error(1,"There is no or wrong JBIG header!\n");
+ if (current->len != 20)
+ error(1,"wrong BIH length\n");
+
+ if (planeNum)
+ {
+ // chunk_write(SLT_START_PLANE, 1, 1*sizeof(SL_ITEM_UINT32), fp);
+ // item_uint32_write(SLI_PLANE, planeNum, fp);
+ }
+
+ for (current = *root; current && current->len; current = current->next)
+ {
+ if (current == *root)
+ {
+ chunk_write(SLT_JBIG_BIH, 0, current->len, fp);
+ fwrite(current->data, 1, current->len, fp);
+ }
+ else
+ {
+ len = current->len;
+ next = current->next;
+ if (!next || !next->len)
+ pad_len = ExtraPad + PADTO * ((len+PADTO-1)/PADTO) - len;
+ else
+ pad_len = 0;
+ chunk_write(SLT_JBIG_BID, 0, len + pad_len, fp);
+ fwrite(current->data, 1, len, fp);
+ for (i = 0; i < pad_len; i++ )
+ putc(0, fp);
+ }
+ }
+
+ free_chain(*root);
+
+ chunk_write(SLT_END_JBIG, 0, 0, fp);
+ // if (planeNum)
+ // chunk_write(SLT_END_PLANE, 0, 0, fp);
+ return 0;
+}
+
+void
+start_page(BIE_CHAIN **root, int nbie, FILE *ofp)
+{
+ BIE_CHAIN *current = *root;
+ unsigned long w, h;
+ static int pageno = 0;
+ int nitems;
+ int customx = 0, customy = 0;
+
+ /* error handling */
+ if (!current)
+ error(1, "There is no JBIG!\n");
+ if (!current->next)
+ error(1, "There is no or wrong JBIG header!\n");
+ if (current->len != 20 )
+ error(1,"wrong BIH length\n");
+
+ /* startpage, jbig_bih, jbig_bid, jbig_end, endpage */
+ w = (((long) current->data[ 4] << 24)
+ | ((long) current->data[ 5] << 16)
+ | ((long) current->data[ 6] << 8)
+ | (long) current->data[ 7]);
+ h = (((long) current->data[ 8] << 24)
+ | ((long) current->data[ 9] << 16)
+ | ((long) current->data[10] << 8)
+ | (long) current->data[11]);
+ debug(9, "start_page: w x h = %d x %d\n", w, h);
+
+ nitems = 14;
+ if (LogicalOffsetX != 0)
+ ++nitems;
+ if (LogicalOffsetY != 0)
+ ++nitems;
+
+ if (PaperCode == 255)
+ {
+ customx = PageWidth;
+ customy = PageHeight;
+ }
+
+ chunk_write(SLT_START_PAGE,
+ nitems, nitems * sizeof(SL_ITEM_UINT32), ofp);
+
+ item_uint32_write(SLI_DMPAPER, PaperCode, ofp);
+ item_uint32_write(SLI_CUSTOM_X, customx, ofp);
+ item_uint32_write(SLI_CUSTOM_Y, customy, ofp);
+ item_uint32_write(SLI_DMCOPIES, Copies, ofp);
+ item_uint32_write(SLI_DMDEFAULTSOURCE, SourceCode, ofp);
+
+ item_uint32_write(SLI_DMMEDIATYPE, MediaCode, ofp);
+ if ((PageNum & 1) == 0 && EvenPages)
+ SeekMedia = ftell(EvenPages) - 4;
+ item_uint32_write(SLI_NBIE, (nbie==4) ? 14 : 0, ofp);
+ item_uint32_write(SLI_RESOLUTION_X, ResX, ofp);
+ item_uint32_write(SLI_RESOLUTION_Y, ResY, ofp);
+ if (LogicalOffsetX != 0)
+ item_uint32_write(SLI_OFFSET_X, LogicalOffsetX, ofp);
+
+ if (LogicalOffsetY != 0)
+ item_uint32_write(SLI_OFFSET_Y, LogicalOffsetY, ofp);
+ item_uint32_write(SLI_RASTER_X, RealWidth, ofp);
+ item_uint32_write(SLI_RASTER_Y, h, ofp);
+ item_uint32_write(SLI_VIDEO_X, RealWidth / Bpp,ofp);
+ item_uint32_write(SLI_VIDEO_Y, h, ofp);
+
+ item_uint32_write(0x10f, 1, ofp);
+ ++pageno;
+ if (IsCUPS)
+ fprintf(stderr, "PAGE: %d %d\n", pageno, Copies);
+}
+
+void
+end_page(FILE *ofp)
+{
+ chunk_write(SLT_END_PAGE, 0, 0, ofp);
+}
+
+int
+write_page(BIE_CHAIN **root, BIE_CHAIN **root2,
+ BIE_CHAIN **root3, BIE_CHAIN **root4, FILE *ofp)
+{
+ int nbie = root2 ? 4 : 1;
+
+ start_page(root, nbie, ofp);
+
+ if (root4)
+ write_plane(4, root4, ofp);
+ if (root)
+ {
+ if (OutputStartPlane)
+ write_plane(nbie == 1 ? 4 : 1, root, ofp);
+ else
+ write_plane(nbie == 1 ? 0 : 1, root, ofp);
+ }
+ if (root2)
+ write_plane(2, root2, ofp);
+ if (root3)
+ write_plane(3, root3, ofp);
+
+ end_page(ofp);
+ return 0;
+}
+
+/*
+ * This creates a linked list of compressed data. The first item
+ * in the list is the BIH and is always 20 bytes in size. Each following
+ * item is 65536 bytes in length. The last item length is whatever remains.
+ */
+void
+output_jbig(unsigned char *start, size_t len, void *cbarg)
+{
+ BIE_CHAIN *current, **root = (BIE_CHAIN **) cbarg;
+ int size = 20000000;
+
+ if ( (*root) == NULL)
+ {
+ (*root) = malloc(sizeof(BIE_CHAIN));
+ if (!(*root))
+ error(1, "Can't allocate space for chain\n");
+
+ (*root)->data = NULL;
+ (*root)->next = NULL;
+ (*root)->len = 0;
+ size = 20;
+ if (len != 20)
+ error(1, "First chunk must be BIH and 20 bytes long\n");
+ }
+
+ current = *root;
+ while (current->next)
+ current = current->next;
+
+ while (len > 0)
+ {
+ int amt, left;
+
+ if (!current->data)
+ {
+ current->data = malloc(size);
+ if (!current->data)
+ error(1, "Can't allocate space for compressed data\n");
+ }
+
+ left = size - current->len;
+ amt = (len > left) ? left : len;
+ memcpy(current->data + current->len, start, amt);
+ current->len += amt;
+ len -= amt;
+ start += amt;
+
+ if (current->len == size)
+ {
+ current->next = malloc(sizeof(BIE_CHAIN));
+ if (!current->next)
+ error(1, "Can't allocate space for chain\n");
+ current = current->next;
+ current->data = NULL;
+ current->next = NULL;
+ current->len = 0;
+ }
+ }
+}
+
+void
+start_doc(FILE *fp)
+{
+ char header[4] = "\245SLX"; // Big-endian data
+ int nitems;
+ int size;
+ int pad1 = 12;
+
+ fwrite(header, 1, sizeof(header), fp);
+
+ nitems = 12;
+ size = nitems * sizeof(SL_ITEM_UINT32) + pad1;
+
+ chunk_write(SLT_START_DOC, nitems, size, fp);
+
+ item_uint32_write(SLI_PAGECOUNT, -1, fp);
+ item_uint32_write(SLI_DMDUPLEX, 0, fp);
+ item_uint32_write(SLI_DMCOLLATE, 0, fp);
+ item_int32_write_pad(0x03, 0, pad1, fp);
+ item_int32_write_pad(0x04, 0, 0, fp);
+ item_uint32_write(0x05, 0, fp);
+ item_uint32_write(0x06, 0, fp);
+ item_uint32_write(0x07, 1, fp);
+ item_uint32_write(0x08, 0, fp);
+ item_uint32_write(0x09, 0, fp);
+ item_uint32_write(SLI_COUNT, 1, fp);
+ item_uint32_write(0x0e, 0, fp);
+}
+
+void
+end_doc(FILE *fp)
+{
+ int nitems;
+
+ nitems = 0;
+ chunk_write(SLT_END_DOC , nitems, nitems * sizeof(SL_ITEM_UINT32), fp);
+
+ // item_uint32_write(0x8112, 1, fp);
+}
+
+void
+load_tray2(FILE *fp)
+{
+ int nitems;
+
+ nitems = 0;
+ chunk_write(SLT_2600N_PAUSE, nitems, nitems * sizeof(SL_ITEM_UINT32), fp);
+}
+
+static int AnyColor;
+
+void
+cmyk_planes(unsigned char *plane[4], unsigned char *raw, int w, int h)
+{
+ int rawbpl = (w+1) / 2;
+ int bpl = (w + 7) / 8;
+ int i;
+ int x, y;
+ unsigned char byte;
+ unsigned char mask[8] = { 128, 64, 32, 16, 8, 4, 2, 1 };
+ int aib = AllIsBlack;
+ int bc = BlackClears;
+
+ AnyColor = 0;
+ for (i = 0; i < 4; ++i)
+ memset(plane[i], 0, bpl * h);
+
+ //
+ // Unpack the combined plane into individual color planes
+ //
+ // TODO: this can be speeded up using a 256 or 65536 entry lookup table
+ //
+ for (y = 0; y < h; ++y)
+ {
+ for (x = 0; x < w; ++x)
+ {
+ byte = raw[y*rawbpl + x/2];
+
+ if (aib && (byte & 0xE0) == 0xE0)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x10)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x80) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE0) AnyColor |= byte;
+ }
+ }
+ else
+ {
+ if (byte & 0x80) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x40) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x20) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE0) AnyColor |= byte;
+ }
+
+ ++x;
+ if (aib && (byte & 0x0E) == 0x0E)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ }
+ else if (byte & 0x1)
+ {
+ plane[3][y*bpl + x/8] |= mask[x&7];
+ if (!bc)
+ {
+ if (byte & 0x8) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE) AnyColor |= byte;
+ }
+ }
+ else
+ {
+ if (byte & 0x8) plane[0][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x4) plane[1][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0x2) plane[2][y*bpl + x/8] |= mask[x&7];
+ if (byte & 0xE) AnyColor |= byte;
+ }
+ }
+ }
+ debug(2, "BlackClears = %d; AnyColor = %s %s %s\n",
+ BlackClears,
+ (AnyColor & 0x88) ? "Cyan" : "",
+ (AnyColor & 0x44) ? "Magenta" : "",
+ (AnyColor & 0x22) ? "Yellow" : ""
+ );
+}
+
+int
+cmyk_page(unsigned char *raw, int w, int h, FILE *ofp)
+{
+ BIE_CHAIN *chain[4];
+ int i;
+ int bpl = (w + 7) / 8;
+ unsigned char *plane[4], *bitmaps[4][1];
+ struct jbg_enc_state se[4];
+
+ RealWidth = w;
+ for (i = 0; i < 4; ++i)
+ {
+ plane[i] = malloc(bpl * h);
+ if (!plane[i]) error(3, "Cannot allocate space for bit plane\n");
+ chain[i] = NULL;
+ }
+
+ cmyk_planes(plane, raw, w, h);
+ for (i = 0; i < 4; ++i)
+ {
+ if (Debug >= 9)
+ {
+ FILE *dfp;
+ char fname[256];
+ sprintf(fname, "xxxplane%d", i);
+ dfp = fopen(fname, "w");
+ if (dfp)
+ {
+ fwrite(plane[i], bpl*h, 1, dfp);
+ fclose(dfp);
+ }
+ }
+
+ *bitmaps[i] = plane[i];
+
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
+
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+
+ for (i = 0; i < 4; ++i)
+ free(plane[i]);
+ return 0;
+}
+
+int
+pksm_page(unsigned char *plane[4], int w, int h, FILE *ofp)
+{
+ BIE_CHAIN *chain[4];
+ int i;
+ unsigned char *bitmaps[4][1];
+ struct jbg_enc_state se[4];
+
+ RealWidth = w;
+ for (i = 0; i < 4; ++i)
+ chain[i] = NULL;
+
+ for (i = 0; i < 4; ++i)
+ {
+ *bitmaps[i] = plane[i];
+
+ jbg_enc_init(&se[i], w, h, 1, bitmaps[i], output_jbig, &chain[i]);
+ jbg_enc_options(&se[i], JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se[i]);
+ jbg_enc_free(&se[i]);
+ }
+
+ if (Color2Mono)
+ write_page(&chain[Color2Mono-1], NULL, NULL, NULL, ofp);
+ else if (AnyColor)
+ write_page(&chain[0], &chain[1], &chain[2], &chain[3], ofp);
+ else
+ write_page(&chain[3], NULL, NULL, NULL, ofp);
+
+ return 0;
+}
+
+int
+pbm_page(unsigned char *buf, int w, int h, FILE *ofp)
+{
+ BIE_CHAIN *chain = NULL;
+ unsigned char *bitmaps[1];
+ struct jbg_enc_state se;
+
+ RealWidth = w;
+ if (Model == MODEL_HP1020)
+ w = (w + 127) & ~127;
+
+ if (SaveToner)
+ {
+ int x, y;
+ int bpl, bpl16;
+
+ bpl = (w + 7) / 8;
+ if (Model == MODEL_2300DL)
+ bpl16 = bpl;
+ else
+ bpl16 = (bpl + 15) & ~15;
+
+ for (y = 0; y < h; y += 2)
+ for (x = 0; x < bpl16; ++x)
+ buf[y*bpl16 + x] &= 0x55;
+ for (y = 1; y < h; y += 2)
+ for (x = 0; x < bpl16; ++x)
+ buf[y*bpl16 + x] &= 0xaa;
+ }
+
+ *bitmaps = buf;
+
+ debug(9, "w x h = %d x %d\n", w, h);
+ jbg_enc_init(&se, w, h, 1, bitmaps, output_jbig, &chain);
+ jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
+ JbgOptions[2], JbgOptions[3], JbgOptions[4]);
+ jbg_enc_out(&se);
+ jbg_enc_free(&se);
+
+ write_page(&chain, NULL, NULL, NULL, ofp);
+
+ return 0;
+}
+
+int
+read_and_clip_image(unsigned char *buf,
+ int rawBpl, int rightBpl, int pixelsPerByte,
+ int bpl, int h, int bpl16, FILE *ifp)
+{
+ unsigned char *rowbuf, *rowp;
+ int y;
+ int rc;
+
+ rowbuf = malloc(rawBpl);
+ if (!rowbuf)
+ error(1, "Can't allocate row buffer\n");
+
+ // Clip top rows
+ if (UpperLeftY)
+ {
+ for (y = 0; y < UpperLeftY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc == 0)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(1) on input at y=%d\n", y);
+ }
+ }
+
+ // Copy the rows that we want to image
+ rowp = buf;
+ for (y = 0; y < h; ++y, rowp += bpl16)
+ {
+ // Clip left pixel *bytes*
+ if (UpperLeftX)
+ {
+ rc = fread(rowbuf, UpperLeftX / pixelsPerByte, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(2) on input at y=%d\n", y);
+ }
+
+ if (bpl != bpl16)
+ memset(rowp, 0, bpl16);
+ rc = fread(rowp, bpl, 1, ifp);
+ if (rc == 0 && y == 0 && !UpperLeftY && !UpperLeftX)
+ goto eof;
+ if (rc != 1)
+ error(1, "Premature EOF(3) on input at y=%d\n", y);
+
+ // Clip right pixels
+ if (rightBpl != bpl)
+ {
+ rc = fread(rowbuf, rightBpl - bpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(4) on input at y=%d\n", y);
+ }
+ }
+
+ // Clip bottom rows
+ if (LowerRightY)
+ {
+ for (y = 0; y < LowerRightY; ++y)
+ {
+ rc = fread(rowbuf, rawBpl, 1, ifp);
+ if (rc != 1)
+ error(1, "Premature EOF(5) on input at y=%d\n", y);
+ }
+ }
+
+ free(rowbuf);
+ return (0);
+
+eof:
+ free(rowbuf);
+ return (EOF);
+}
+
+int
+cmyk_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int rc;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ rawW = PageWidth;
+ rawH = PageHeight;
+ rawBpl = (PageWidth + 1) / 2;
+
+ // We only clip multiples of 2 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 1;
+ UpperLeftX &= ~1;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 1) / 2;
+ rightBpl = (rawW - UpperLeftX + 1) / 2;
+
+ buf = malloc(bpl * h);
+ if (!buf)
+ error(1, "Unable to allocate page buffer of %d x %d = %d bytes\n",
+ rawW, rawH, rawBpl * rawH);
+
+ for (;;)
+ {
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 2, bpl, h, bpl, ifp);
+ if (rc == EOF)
+ goto done;
+
+ ++PageNum;
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
+ if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl * h - 1, Mirror4);
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ cmyk_page(buf, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "CMYK Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ cmyk_page(buf, w, h, ofp);
+ }
+
+done:
+ free(buf);
+ return 0;
+}
+
+static unsigned long
+getint(FILE *fp)
+{
+ int c;
+ unsigned long i;
+
+ while ((c = getc(fp)) != EOF && !isdigit(c))
+ if (c == '#')
+ while ((c = getc(fp)) != EOF && !(c == 13 || c == 10)) ;
+ if (c != EOF)
+ {
+ ungetc(c, fp);
+ fscanf(fp, "%lu", &i);
+ }
+ return i;
+}
+
+static void
+skip_to_nl(FILE *fp)
+{
+ for (;;)
+ {
+ int c;
+ c = getc(fp);
+ if (c == EOF)
+ error(1, "Premature EOF on input stream\n");
+ if (c == '\n')
+ return;
+ }
+}
+
+int
+pbm_header(FILE *ifp, int *p4eatenp, int *wp, int *hp)
+{
+ int c1, c2;
+
+ if (*p4eatenp)
+ *p4eatenp = 0; // P4 already eaten in main
+ else
+ {
+ c1 = getc(ifp);
+ if (c1 == EOF)
+ return 0;
+ c2 = getc(ifp);
+ if (c1 != 'P' || c2 != '4')
+ error(1, "Not a pbmraw data stream\n");
+ }
+
+ skip_to_nl(ifp);
+
+ *wp = getint(ifp);
+ *hp = getint(ifp);
+ skip_to_nl(ifp);
+ return 1;
+}
+
+int
+pksm_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *plane[4];
+ int rawW, rawH, rawBpl;
+ int saveW = 0, saveH = 0;
+ int rightBpl;
+ int w, h, bpl;
+ int i;
+ int rc;
+ int p4eaten = 1;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ for (;;)
+ {
+ ++PageNum;
+ AnyColor = 0;
+
+ for (i = 0; i < 4; ++i)
+ {
+ if (pbm_header(ifp, &p4eaten, &rawW, &rawH) == 0)
+ {
+ if (i == 0)
+ goto eof;
+ else
+ error(1, "Premature EOF(pksm) on page %d hdr, plane %d\n",
+ PageNum, i);
+ }
+ if (i == 0)
+ {
+ saveW = rawW;
+ saveH = rawH;
+ }
+ if (saveW != rawW)
+ error(1, "Image width changed from %d to %d on plane %d\n",
+ saveW, rawW, i);
+ if (saveH != rawH)
+ error(1, "Image height changed from %d to %d on plane %d\n",
+ saveH, rawH, i);
+
+ rawBpl = (rawW + 7) / 8;
+
+ // We only clip multiples of 8 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 7;
+ UpperLeftX &= ~7;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ rightBpl = (rawW - UpperLeftX + 7) / 8;
+
+ plane[i] = malloc(bpl * h);
+ if (!plane[i])
+ error(1, "Can't allocate plane buffer\n");
+
+ rc = read_and_clip_image(plane[i],
+ rawBpl, rightBpl, 8, bpl, h, bpl, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pksm) on page %d data, plane %d\n",
+ PageNum, i);
+
+ if (Debug >= 9)
+ {
+ FILE *dfp;
+ char fname[256];
+ sprintf(fname, "xxxplane%d", i);
+ dfp = fopen(fname, "w");
+ if (dfp)
+ {
+ fwrite(plane[i], bpl*h, 1, dfp);
+ fclose(dfp);
+ }
+ }
+
+ // See if we can optimize this to be a monochrome page
+ if (!AnyColor && i != 3)
+ {
+ unsigned char *p, *e;
+
+ for (p = plane[i], e = p + bpl*h; p < e; ++p)
+ if (*p)
+ {
+ AnyColor |= 1<<i;
+ break;
+ }
+ }
+
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(plane[i], plane[i] + bpl * h - 1, Mirror1);
+ if (Duplex == DMDUPLEX_MANUALLONG && (PageNum & 1) == 0)
+ rotate_bytes_180(plane[i], plane[i] + bpl * h - 1, Mirror1);
+ }
+
+ debug(2, "AnyColor = %s %s %s\n",
+ (AnyColor & 0x01) ? "Cyan" : "",
+ (AnyColor & 0x02) ? "Magenta" : "",
+ (AnyColor & 0x04) ? "Yellow" : ""
+ );
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ pksm_page(plane, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "PKSM Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ pksm_page(plane, w, h, ofp);
+
+ for (i = 0; i < 4; ++i)
+ free(plane[i]);
+ }
+eof:
+ return (0);
+}
+
+int
+pbm_pages(FILE *ifp, FILE *ofp)
+{
+ unsigned char *buf;
+ int rawW, rawH, rawBpl;
+ int rightBpl;
+ int w, h, bpl;
+ int bpl16 = 0;
+ int rc;
+ int p4eaten = 1;
+
+ //
+ // Save the original Upper Right clip values as the logical offset,
+ // because we may adjust them slightly below, in the interest of speed.
+ //
+ if (LogicalClip & LOGICAL_CLIP_X)
+ LogicalOffsetX = UpperLeftX;
+ if (LogicalClip & LOGICAL_CLIP_Y)
+ LogicalOffsetY = UpperLeftY;
+
+ for (;;)
+ {
+ if (pbm_header(ifp, &p4eaten, &rawW, &rawH) == 0)
+ break;
+
+ rawBpl = (rawW + 7) / 8;
+
+ // We only clip multiples of 8 pixels off the leading edge, and
+ // add any remainder to the amount we clip from the right edge.
+ // Its fast, and good enough for government work.
+ LowerRightX += UpperLeftX & 7;
+ UpperLeftX &= ~7;
+
+ w = rawW - UpperLeftX - LowerRightX;
+ h = rawH - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ rightBpl = (rawW - UpperLeftX + 7) / 8;
+
+ switch (Model)
+ {
+ case MODEL_2300DL: bpl16 = bpl; break;
+ case MODEL_HP1020: bpl16 = (bpl + 15) & ~15; break;
+ default: error(1, "Bad model %d\n", Model); break;
+ }
+
+ buf = malloc(bpl16 * h);
+ if (!buf)
+ error(1, "Can't allocate page buffer\n");
+
+ rc = read_and_clip_image(buf, rawBpl, rightBpl, 8, bpl, h, bpl16, ifp);
+ if (rc == EOF)
+ error(1, "Premature EOF(pbm) on input stream\n");
+
+ ++PageNum;
+ if (Duplex == DMDUPLEX_LONGEDGE && (PageNum & 1) == 0)
+ rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
+
+ if ((PageNum & 1) == 0 && EvenPages)
+ {
+ if (Duplex == DMDUPLEX_MANUALLONG)
+ rotate_bytes_180(buf, buf + bpl16 * h - 1, Mirror1);
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ pbm_page(buf, w, h, EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "PBM Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+ else
+ pbm_page(buf, w, h, ofp);
+
+ free(buf);
+ }
+ return (0);
+}
+
+void
+blank_page(FILE *ofp)
+{
+ int w, h, bpl, bpl16 = 0;
+ unsigned char *plane;
+
+ w = PageWidth - UpperLeftX - LowerRightX;
+ h = PageHeight - UpperLeftY - LowerRightY;
+ bpl = (w + 7) / 8;
+ switch (Model)
+ {
+ case MODEL_2300DL: bpl16 = bpl; break;
+ case MODEL_HP1020: bpl16 = (bpl + 15) & ~15; break;
+ default: error(1, "Bad model %d\n", Model); break;
+ }
+
+ plane = malloc(bpl16 * h);
+ if (!plane)
+ error(1, "Unable to allocate blank plane (%d bytes)\n", bpl16*h);
+ memset(plane, 0, bpl16*h);
+
+ pbm_page(plane, w, h, ofp);
+ ++PageNum;
+ free(plane);
+}
+
+int
+parse_xy(char *str, int *xp, int *yp)
+{
+ char *p;
+
+ if (!str || str[0] == 0) return -1;
+
+ *xp = strtoul(str, &p, 10);
+ if (str == p) return -2;
+ while (*p && (*p < '0' || *p > '9'))
+ ++p;
+ str = p;
+ if (str[0] == 0) return -3;
+ *yp = strtoul(str, &p, 10);
+ if (str == p) return -4;
+ return (0);
+}
+
+void
+do_one(FILE *in)
+{
+ int mode;
+
+ if (Mode == MODE_COLOR)
+ {
+ mode = getc(in);
+ if (mode != 'P')
+ {
+ ungetc(mode, in);
+ cmyk_pages(in, stdout);
+ }
+ else
+ {
+ mode = getc(in);
+ if (mode == '4')
+ pksm_pages(in, stdout);
+ else
+ error(1, "Not a pksmraw file!\n");
+ }
+ }
+ else
+ {
+ mode = getc(in);
+ if (mode != 'P')
+ error(1, "Not a pbm file!\n");
+ mode = getc(in);
+ if (mode == '4')
+ pbm_pages(in, stdout);
+ else
+ error(1, "Not a pbmraw file!\n");
+ }
+}
+
+int
+main(int argc, char *argv[])
+{
+ int c;
+ int i, j;
+
+ while ( (c = getopt(argc, argv,
+ "cd:g:n:m:p:r:s:tu:l:z:L:ABPJ:S:U:X:D:V?h")) != EOF)
+ switch (c)
+ {
+ case 'c': Mode = MODE_COLOR; break;
+ case 'S': Color2Mono = atoi(optarg);
+ Mode = MODE_COLOR;
+ if (Color2Mono < 0 || Color2Mono > 4)
+ error(1, "Illegal value '%s' for -C\n", optarg);
+ break;
+ case 'd': Duplex = atoi(optarg); break;
+ case 'g': if (parse_xy(optarg, &PageWidth, &PageHeight))
+ error(1, "Illegal format '%s' for -g\n", optarg);
+ if (PageWidth < 0 || PageWidth > 1000000)
+ error(1, "Illegal X value '%s' for -g\n", optarg);
+ if (PageHeight < 0 || PageHeight > 1000000)
+ error(1, "Illegal Y value '%s' for -g\n", optarg);
+ break;
+ case 'm': MediaCode = atoi(optarg); break;
+ case 'n': Copies = atoi(optarg); break;
+ case 'p': PaperCode = atoi(optarg); break;
+ case 'r': if (parse_xy(optarg, &ResX, &ResY))
+ error(1, "Illegal format '%s' for -r\n", optarg);
+ break;
+ case 's': SourceCode = atoi(optarg); break;
+ case 't': SaveToner = 1; break;
+ case 'u':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &UpperLeftX, &UpperLeftY))
+ error(1, "Illegal format '%s' for -u\n", optarg);
+ break;
+ case 'l':
+ if (strcmp(optarg, "0") == 0)
+ break;
+ if (parse_xy(optarg, &LowerRightX, &LowerRightY))
+ error(1, "Illegal format '%s' for -l\n", optarg);
+ break;
+ case 'z': Model = atoi(optarg);
+ if (Model < 0 || Model > MODEL_LAST)
+ error(1, "Illegal value '%s' for -z\n", optarg);
+ break;
+ case 'L': LogicalClip = atoi(optarg);
+ if (LogicalClip < 0 || LogicalClip > 3)
+ error(1, "Illegal value '%s' for -L\n", optarg);
+ break;
+ case 'A': AllIsBlack = !AllIsBlack; break;
+ case 'B': BlackClears = !BlackClears; break;
+ case 'P': OutputStartPlane = !OutputStartPlane; break;
+ case 'J': if (optarg[0]) Filename = optarg; break;
+ case 'U': if (optarg[0]) Username = optarg; break;
+ case 'X': ExtraPad = atoi(optarg); break;
+ case 'D': Debug = atoi(optarg); break;
+ case 'V': printf("%s\n", Version); exit(0);
+ default: usage(); exit(1);
+ }
+
+ if (UpperLeftX < 0 || UpperLeftX >= PageWidth)
+ error(1, "Illegal X value '%d' for -u\n", UpperLeftX);
+ if (UpperLeftY < 0 || UpperLeftY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -u\n", UpperLeftY);
+ if (LowerRightX < 0 || LowerRightX >= PageWidth)
+ error(1, "Illegal X value '%d' for -l\n", LowerRightX);
+ if (LowerRightY < 0 || LowerRightY >= PageHeight)
+ error(1, "Illegal Y value '%d' for -l\n", LowerRightY);
+
+ argc -= optind;
+ argv += optind;
+
+ if (getenv("DEVICE_URI"))
+ IsCUPS = 1;
+
+ if (Model == MODEL_HP1020)
+ {
+ Bpp = ResX / 600;
+ ResX = 600;
+ if (SaveToner)
+ {
+ SaveToner = 0;
+ EconoMode = 1;
+ }
+ }
+
+ switch (Duplex)
+ {
+ case DMDUPLEX_MANUALLONG:
+ case DMDUPLEX_MANUALSHORT:
+ EvenPages = tmpfile();
+ break;
+ }
+
+ start_doc(stdout);
+
+ if (argc == 0)
+ {
+ do_one(stdin);
+ }
+ else
+ {
+ for (i = 0; i < argc; ++i)
+ {
+ FILE *ifp;
+
+ ifp = fopen(argv[i], "r");
+ if (!ifp)
+ error(1, "Can't open '%s' for reading\n", argv[i]);
+ do_one(ifp);
+ fclose(ifp);
+ }
+ }
+
+ /*
+ * Do manual duplex
+ */
+ if (EvenPages)
+ {
+ DWORD media;
+
+ // Handle odd page count
+ if ( (PageNum & 1) == 1)
+ {
+ SeekRec[SeekIndex].b = ftell(EvenPages);
+ blank_page(EvenPages);
+ SeekRec[SeekIndex].e = ftell(EvenPages);
+ debug(1, "Blank Page: %d %ld %ld\n",
+ PageNum, SeekRec[SeekIndex].b, SeekRec[SeekIndex].e);
+ SeekIndex++;
+ }
+
+ /*
+ * Manual Pause
+ */
+ if (Model == MODEL_HP1020)
+ load_tray2(stdout);
+
+ fseek(EvenPages, SeekMedia, 0L);
+ media = be32(DMMEDIA_LETTERHEAD);
+ fwrite(&media, 1, sizeof(DWORD), EvenPages);
+
+ // Write even pages in reverse order
+ for (i = SeekIndex-1; i >= 0; --i)
+ {
+ debug(1, "EvenPage: %d %ld %ld\n",
+ i, SeekRec[i].b, SeekRec[i].e);
+ fseek(EvenPages, SeekRec[i].b, 0L);
+ for (j = 0; j < (SeekRec[i].e - SeekRec[i].b); ++j)
+ putc(getc(EvenPages), stdout);
+ }
+ fclose(EvenPages);
+ }
+
+ end_doc(stdout);
+
+ exit(0);
+}
diff --git a/foo2xqx-wrapper.1in b/foo2xqx-wrapper.1in
index c6d930e..31faffa 100644
--- a/foo2xqx-wrapper.1in
+++ b/foo2xqx-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2xqx-wrapper 1 "${MODpage}" "foo2xqx-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2xqx-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -223,6 +55,7 @@ labels 263
.BI \-p\0 paper
Paper size code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
@@ -241,6 +74,7 @@ Set device resolution in pixels/inch [1200x600].
.BI \-s\0 source
Source (Input Slot) code to send to printer [7].
.TS
+box;
| n l | n l.
1 upper 4 manual
2 lower 7 auto
diff --git a/foo2xqx-wrapper.in b/foo2xqx-wrapper.in
index dda8e89..1d0dde3 100755
--- a/foo2xqx-wrapper.in
+++ b/foo2xqx-wrapper.in
@@ -18,7 +18,7 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2xqx-wrapper.in,v 1.18 2007/07/12 15:43:14 rick Exp $'
+VERSION='$Id: foo2xqx-wrapper.in,v 1.27 2008/02/16 15:30:20 rick Exp $'
#
# Printer Notes:
@@ -36,7 +36,7 @@ PATH=$PATH:/sw/bin:/opt/local/bin
# Log the command line, for debugging and problem reports
#
if [ -x /usr/bin/logger ]; then
- logger -t "$BASENAME" -p lpr.info -- "foo2xqx-wrapper $@" </dev/null
+ logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
fi
usage() {
@@ -134,13 +134,13 @@ nup() {
# Process the options
#
-# Try to use a local copy of GhostScript 8.14, if available. Otherwise,
-# fallback to whatever the Linux distro has installed (usually 7.05)
+# Try to use a local copy of GhostScript 8.54, if available. Otherwise,
+# fallback to whatever the Linux distro has installed (usually 7.07)
#
# N.B. := operator used here, when :- would be better, because "ash"
# doesn't have :-
-if gs8 -v >/dev/null 2>&1; then
- GSBIN=${GSBIN:-gs8}
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
else
GSBIN=${GSBIN:-gs}
fi
@@ -158,7 +158,7 @@ case `$GSBIN --version` in
*) DEFAULTCOLORMODE=2
;;
esac
-QUALITY=1
+QUALITY=wts
MEDIA=1
COPIES=1
PAPER=1
@@ -179,6 +179,12 @@ EXTRAPAD=
SAVETONER=
NUP_ORIENT=
GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+8.1*)
+ QUALITY=1
+ ;;
+esac
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tABS:D:G:I:PX:Vh?" opt
do
case $opt in
@@ -217,7 +223,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2xqx -V; exit 0;;
+ V) echo "$VERSION"; foo2xqx -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -249,7 +255,10 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
@@ -348,26 +357,32 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
;;
- esac
- XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
PAPER=359; paper=letter;
set_clipping 2 84 2 84
@@ -423,6 +438,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -439,6 +457,8 @@ create_crd() {
if [ -x $ICC2PS ]; then
$ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
|| error "Problem converting .ICM file to Postscript"
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
cat > $ICCTMP.usecie.ps <<-EOF
%!PS-Adobe-3.0
<</UseCIEColor true>>setpagedevice
@@ -474,6 +494,8 @@ case "$RES" in
2400x600) SCREEN=screen2400.ps;;
esac
+PSTOPS_OPTS="-n"
+
case "$COLORMODE" in
"")
# Monochrome
@@ -545,6 +567,10 @@ case "$COLORMODE" in
;;
esac
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
if [ "" != "$COLOR" ]; then
if [ "" = "$AIB" -a "" = "$BC" ]; then
# Faster, but can't handle AllIsBlack or BlackClears
@@ -574,9 +600,10 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
| foo2xqx -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
$COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
-J "$LPJOB" -U "$USER" \
diff --git a/foo2xqx.1in b/foo2xqx.1in
index 0b320cb..757987b 100644
--- a/foo2xqx.1in
+++ b/foo2xqx.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2xqx 1 "${MODpage}" "foo2xqx ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2xqx Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -222,6 +54,7 @@ labels 263
.BI \-p\0 paper
Paper code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
@@ -240,6 +73,7 @@ Set device resolution in pixels/inch [1200x600].
.BI \-s\0 source
Source (InputSlot) code to send to printer [7].
.TS
+box;
| n l | n l.
1 upper 4 manual
2 lower 7 auto
diff --git a/foo2xqx.c b/foo2xqx.c
index 03df28e..45824c3 100644
--- a/foo2xqx.c
+++ b/foo2xqx.c
@@ -48,7 +48,7 @@ yourself.
*/
-static char Version[] = "$Id: foo2xqx.c,v 1.16 2007/07/15 14:31:56 rick Exp $";
+static char Version[] = "$Id: foo2xqx.c,v 1.18 2007/12/09 06:57:03 rick Exp $";
#include <stdio.h>
#include <stdlib.h>
@@ -1281,13 +1281,13 @@ parse_xy(char *str, int *xp, int *yp)
if (!str || str[0] == 0) return -1;
- *xp = strtoul(str, &p, 0);
+ *xp = strtoul(str, &p, 10);
if (str == p) return -2;
while (*p && (*p < '0' || *p > '9'))
++p;
str = p;
if (str[0] == 0) return -3;
- *yp = strtoul(str, &p, 0);
+ *yp = strtoul(str, &p, 10);
if (str == p) return -4;
return (0);
}
@@ -1398,7 +1398,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (getenv("DEVICE_URL"))
+ if (getenv("DEVICE_URI"))
IsCUPS = 1;
Bpp = ResX / 600;
diff --git a/foo2zjs-pstops.1in b/foo2zjs-pstops.1in
new file mode 100644
index 0000000..78d1581
--- /dev/null
+++ b/foo2zjs-pstops.1in
@@ -0,0 +1,51 @@
+.TH foo2zjs-pstops 1 "${MODpage}" "foo2zjs-pstops ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+foo2zjs-pstops \- Add PS code for foo2*-wrapper
+.SH SYNOPSIS
+.B foo2zjs-pstops
+.RI [ options "] [" file ]
+.SH DESCRIPTION
+Add PS code for foo2zjs-wrapper.
+
+.SH COMMAND LINE OPTIONS
+These are the options that can appear on the command line.
+.TP
+.BI \-c
+CIE Color.
+.TP
+.BI \-n
+Neuter CUPS cupsPSLevel2
+.TP
+.BI \-r
+Rotate 90 degrees clockwise.
+.TP
+.BI \-w
+Accurate screens and Well Tempered Screens code.
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH FILES
+.BR /usr/bin/foo2zjs-pstops
+.SH SEE ALSO
+.BR foo2hp2600-wrapper (1),
+.BR foo2lava-wrapper (1),
+.BR foo2oak-wrapper (1),
+.BR foo2qpdl-wrapper (1),
+.BR foo2slx-wrapper (1),
+.BR foo2xqx-wrapper (1),
+.BR foo2zjs-wrapper (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLZJS}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/foo2zjs-pstops.sh b/foo2zjs-pstops.sh
new file mode 100755
index 0000000..da51255
--- /dev/null
+++ b/foo2zjs-pstops.sh
@@ -0,0 +1,110 @@
+#!/bin/sh
+
+VERSION='$Id: foo2zjs-pstops.sh,v 1.13 2008/12/05 02:46:35 rick Exp $'
+
+PROGNAME="$0"
+
+usage() {
+ cat <<EOF
+NAME
+ `basename $PROGNAME` - Add PS code for foo2*-wrapper
+
+SYNOPSIS
+ `basename $PROGNAME` [options] [file]
+
+DESCRIPTION
+ Add PS code for foo2zjs-wrapper.
+
+OPTIONS
+ -r Rotate 90 clockwise
+ -c CIEColor
+ -n Neuter CUPS cupsPSLevel2
+ -w Accurate screens and Well Tempered Screens code
+ -D lvl Debug level
+EOF
+
+ exit 1
+}
+
+#
+# Report an error and exit
+#
+error() {
+ echo "`basename $PROGNAME`: $1" >&2
+ exit 1
+}
+
+debug() {
+ if [ $DEBUG -ge $1 ]; then
+ echo "`basename $PROGNAME`: $2" >&2
+ fi
+}
+
+#
+# Process the options
+#
+DEBUG=0
+ROTATE90=0
+ACCURATE=0
+CIECOLOR=0
+NIXCUPS=0
+WTS=0
+while getopts "ach:nwrD:Vh?" opt
+do
+ case $opt in
+ a) ACCURATE=1;;
+ c) CIECOLOR=1;;
+ h) YDIMpoints="$OPTARG";;
+ n) NIXCUPS=1;;
+ r) ROTATE90=1;;
+ w) WTS=1;;
+ D) DEBUG="$OPTARG";;
+ V) echo "$VERSION"; exit 0;;
+ h|\?) usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+if [ $NIXCUPS = 1 ]; then
+ n='s#^[^/]*cupsPSLevel2#false#'
+else
+ n=
+fi
+
+if [ $ROTATE90 = 1 ]; then
+ # %%currentpagedevice /PageSize get\
+ # %%aload pop translate\
+ r="1i\
+ << /Install {\
+ 0 $YDIMpoints translate\
+ -90 rotate\
+ } >> setpagedevice
+ "
+else
+ r=
+fi
+
+if [ $WTS = 1 ]; then
+ w='/%%Page:.*[ ]1[ ]*$/ i\
+ << /UseWTS true >> setuserparams \
+ <<\
+ /AccurateScreens true\
+ /HalftoneType 1\
+ /HalftoneName (Round Dot Screen) cvn\
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}\
+ /Frequency 137\
+ /Angle 37\
+ >> sethalftone
+ '
+else
+ w=
+fi
+
+#
+# Main Program
+#
+sed \
+ -e "$w" \
+ -e "$n" \
+ -e "$r" \
+ $@
diff --git a/foo2zjs-wrapper.1in b/foo2zjs-wrapper.1in
index 18aac2b..90c5017 100644
--- a/foo2zjs-wrapper.1in
+++ b/foo2zjs-wrapper.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2zjs-wrapper 1 "${MODpage}" "foo2zjs-wrapper ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2zjs-wrapper Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -203,7 +35,6 @@ Print in color (else monochrome).
Color correction mode [0].
.TS
n l .
-0 Best compromise
1 Photos (using m2300w CRDs)
2 Photos and text (using m2300w CRDs)
3 Graphics and text (using m2300w CRDs)
@@ -237,6 +68,7 @@ labels 263 3
.BI \-p\0 paper
Paper size code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
diff --git a/foo2zjs-wrapper.in b/foo2zjs-wrapper.in
index cddd496..d03fe96 100755
--- a/foo2zjs-wrapper.in
+++ b/foo2zjs-wrapper.in
@@ -18,7 +18,7 @@
#*
#* Authors: Rick Richardson <rick.richardson@comcast.net>
-VERSION='$Id: foo2zjs-wrapper.in,v 1.106 2007/07/12 15:43:14 rick Exp $'
+VERSION='$Id: foo2zjs-wrapper.in,v 1.117 2009/01/22 20:56:35 rick Exp $'
#
# Printer Notes:
@@ -33,6 +33,7 @@ VERSION='$Id: foo2zjs-wrapper.in,v 1.106 2007/07/12 15:43:14 rick Exp $'
# HP LaserJet 1005 - Same as 2200 DL, plus needs -P
# HP LaserJet 1018 - Same as 2200 DL, plus needs -P -z1 -L0
# HP LaserJet 1020 - Same as 2200 DL, plus needs -P -z1 -L0
+# HP LaserJet P2035 - Same as 2200 DL, plus needs -P -z1 -L0
#
PROGNAME="$0"
@@ -45,7 +46,7 @@ PATH=$PATH:/sw/bin:/opt/local/bin
# Log the command line, for debugging and problem reports
#
if [ -x /usr/bin/logger ]; then
- logger -t "$BASENAME" -p lpr.info -- "foo2zjs-wrapper $@" </dev/null
+ logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" </dev/null
fi
usage() {
@@ -59,6 +60,9 @@ Usage:
Normal Options:
-c Print in color (else monochrome)
+-C colormode Colormode [$COLORMODE]
+ 1=Photos, 2=Photo and text, 3=Graphics and text
+ 10=ICM color profile (using -G *.icm file)
-d duplex Duplex code to send to printer [$DUPLEX]
1=off, 2=longedge, 3=shortedge
-m media Media code to send to printer [$MEDIA]
@@ -144,13 +148,13 @@ nup() {
# Process the options
#
-# Try to use a local copy of GhostScript 8.14, if available. Otherwise,
-# fallback to whatever the Linux distro has installed (usually 7.05)
+# Try to use a local copy of GhostScript 8.54, if available. Otherwise,
+# fallback to whatever the Linux distro has installed (usually 7.07)
#
# N.B. := operator used here, when :- would be better, because "ash"
# doesn't have :-
-if gs8 -v >/dev/null 2>&1; then
- GSBIN=${GSBIN:-gs8}
+if gs.foo -v >/dev/null 2>&1; then
+ GSBIN=${GSBIN:-gs.foo}
else
GSBIN=${GSBIN:-gs}
fi
@@ -159,17 +163,9 @@ CMDLINE="$*"
DEBUG=0
DUPLEX=1
COLOR=
-COLORMODE=0
+COLORMODE=default
MODEL=0
-# What mode to use if the user wants us to pick the "best" mode
-case `$GSBIN --version` in
-7*) DEFAULTCOLORMODE=10
- DEFAULTCOLORMODE=2
- ;;
-*) DEFAULTCOLORMODE=2
- ;;
-esac
-QUALITY=1
+QUALITY=wts
MEDIA=1
COPIES=1
PAPER=1
@@ -190,6 +186,18 @@ EXTRAPAD=
SAVETONER=
NUP_ORIENT=
GSDEV=-sDEVICE=pbmraw
+# What mode to use if the user wants us to pick the "best" mode
+case `$GSBIN --version` in
+7*) DEFAULTCOLORMODE=10
+ DEFAULTCOLORMODE=2
+ ;;
+8.1*)
+ DEFAULTCOLORMODE=2
+ QUALITY=1
+ ;;
+*) DEFAULTCOLORMODE=2
+ ;;
+esac
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt
do
case $opt in
@@ -229,7 +237,7 @@ do
s*) NUP_ORIENT=-r;;
p*|*) NUP_ORIENT=;;
esac;;
- V) echo "$VERSION"; foo2zjs -V; exit 0;;
+ V) echo "$VERSION"; foo2zjs -V; foo2zjs-pstops -V; exit 0;;
h|\?)
if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then
echo "Illegal command:"
@@ -261,7 +269,10 @@ case "$QUALITY" in
GSOPTS="-dCOLORSCREEN $GSOPTS"
;;
2)
- GSOPTS="-dMaxBitMap=500000000 $GSOPTS"
+ GSOPTS="-dMaxBitmap=500000000 $GSOPTS"
+ ;;
+wts)
+ GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS"
;;
esac
@@ -370,26 +381,32 @@ Custom*)
#0
#pop pop pop pop pop
- TMPFILE=/tmp/cus$$
+ #%%BeginFeature: *CustomPageSize True
+ #792.000000 612.000000 1 0.000000 0.000000
+ #pop pop pop pop pop
+
+ if [ $DEBUG = 0 ]; then
+ TMPFILE=/tmp/cus$$
+ else
+ TMPFILE=/tmp/custom.ps
+ fi
cat >$TMPFILE
exec <$TMPFILE
- XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
- case "$XDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size XDIM != 1-99999"
+ tmp=`head -n 10000 $TMPFILE \
+ | sed -n '/CustomPageSize/{n;p;n;p;}' \
+ | tr '\n' ' '`
+ case "$tmp" in
+ [0-9]*\ [0-9]*)
+ XDIM=`echo "$tmp" | sed 's/ .*//'`
+ YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'`
;;
- esac
- XDIM=`dc -e "$XDIM 1200* 72/p"`
-
- YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
- case "$YDIM" in
- ""|0*)
- rm -f $TMPFILE
- error "Custom page size YDIM != 1-99999"
+ *)
+ if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi
+ error "Custom page size [XY]DIM != 1-99999"
;;
esac
+ XDIM=`dc -e "$XDIM 1200* 72/p"`
YDIM=`dc -e "$YDIM 600* 72/p"`
PAPER=256; paper=letter;
MEDIA=261
@@ -472,6 +489,7 @@ Custom*)
;;
*) error "Unimplemented paper code $PAPER";;
esac
+# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps
PAPERSIZE="-sPAPERSIZE=$paper";
case "$RES" in
@@ -488,6 +506,9 @@ case $NUP in
[234689]|1[024568]) PREFILTER="nup";;
*) PREFILTER=cat;;
esac
+if [ "$DEBUG" -ge 9 ]; then
+ PREFILTER="tee /tmp/$BASENAME.ps"
+fi
#
# Overload -G. If the file name ends with ".icm" or ".ICM"
@@ -502,16 +523,40 @@ create_crd() {
#
ICC2PS=$PREFIX/bin/foo2zjs-icc2ps
if [ -x $ICC2PS ]; then
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ ;;
+ *)
$ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \
|| error "Problem converting .ICM file to Postscript"
+ ;;
+ esac
+
+ PSTOPS_OPTS="$PSTOPS_OPTS -c"
cat > $ICCTMP.usecie.ps <<-EOF
%!PS-Adobe-3.0
<</UseCIEColor true>>setpagedevice
EOF
+ if [ "$QUALITY" = wts ]; then
+ cat >> $ICCTMP.usecie.ps <<-EOF
+ << /UseWTS true >> setuserparams
+ <<
+ /AccurateScreens true
+ /HalftoneType 1
+ /HalftoneName (Round Dot Screen) cvn
+ /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}
+ /Frequency 137
+ /Angle 37
+ >> sethalftone
+ EOF
+ fi
cat > $ICCTMP.selcrd.ps <<-EOF
/Current /ColorRendering findresource setcolorrendering
EOF
- GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps"
+ case "$GAMMAFILE" in
+ none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;
+ *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;
+ esac
else
GAMMFILE=
fi
@@ -528,7 +573,10 @@ if [ "" = "$COLOR" ]; then
GAMMAFILE=
else
case "$COLORMODE" in
- 0) COLORMODE=$DEFAULTCOLORMODE;;
+ default) COLORMODE=$DEFAULTCOLORMODE;;
+ esac
+ case "$GAMMAFILE" in
+ default) GAMMAFILE=DL2312.icm;;
esac
fi
@@ -539,8 +587,10 @@ case "$RES" in
2400x600) SCREEN=screen2400.ps;;
esac
+PSTOPS_OPTS="-n"
+
case "$COLORMODE" in
-"")
+0|"")
# Monochrome
;;
10|icm)
@@ -548,6 +598,9 @@ case "$COLORMODE" in
AIB=-A
BC=-B
case "$GAMMAFILE" in
+ none | none.icm | */none.icm)
+ create_crd
+ ;;
*.icm|*.ICM|*.icc|*.ICC)
#
# Its really an .ICM file, not a gamma file.
@@ -563,9 +616,6 @@ case "$COLORMODE" in
GAMMAFILE=
fi
;;
- none)
- GAMMAFILE=
- ;;
esac
;;
1|photo)
@@ -610,6 +660,10 @@ case "$COLORMODE" in
;;
esac
+if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then
+ PSTOPS_OPTS="$PSTOPS_OPTS -w"
+fi
+
if [ "" != "$COLOR" ]; then
if [ "" = "$AIB" -a "" = "$BC" ]; then
# Faster, but can't handle AllIsBlack or BlackClears
@@ -639,9 +693,10 @@ fi
#
GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"
+foo2zjs-pstops $PSTOPS_OPTS | \
$PREFILTER \
| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \
- -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \
+ -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \
| foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
-z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \
-J "$LPJOB" -U "$USER" \
diff --git a/foo2zjs.1in b/foo2zjs.1in
index 3d225bd..2dca56d 100644
--- a/foo2zjs.1in
+++ b/foo2zjs.1in
@@ -1,176 +1,8 @@
+'\" t
.TH foo2zjs 1 "${MODpage}" "foo2zjs ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (foo2zjs Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -231,6 +63,7 @@ labels 263 3
.BI \-p\0 paper
Paper code to send to printer [1].
.TS
+box;
| n l | n l.
1 letter 9 A4
5 legal 11 A5
diff --git a/foo2zjs.c b/foo2zjs.c
index d6d3add..a0c841f 100644
--- a/foo2zjs.c
+++ b/foo2zjs.c
@@ -55,7 +55,7 @@ yourself.
*/
-static char Version[] = "$Id: foo2zjs.c,v 1.79 2007/07/15 14:31:56 rick Exp $";
+static char Version[] = "$Id: foo2zjs.c,v 1.82 2007/12/09 06:57:03 rick Exp $";
#include <stdio.h>
#include <stdlib.h>
@@ -493,6 +493,7 @@ start_page(BIE_CHAIN **root, int nbie, FILE *ofp)
| ((long) current->data[ 9] << 16)
| ((long) current->data[10] << 8)
| (long) current->data[11]);
+ debug(9, "start_page: w x h = %d x %d\n", w, h);
nitems = 13;
if (LogicalOffsetX != 0)
@@ -902,6 +903,7 @@ pbm_page(unsigned char *buf, int w, int h, FILE *ofp)
*bitmaps = buf;
+ debug(9, "w x h = %d x %d\n", w, h);
jbg_enc_init(&se, w, h, 1, bitmaps, output_jbig, &chain);
jbg_enc_options(&se, JbgOptions[0], JbgOptions[1],
JbgOptions[2], JbgOptions[3], JbgOptions[4]);
@@ -1350,13 +1352,13 @@ parse_xy(char *str, int *xp, int *yp)
if (!str || str[0] == 0) return -1;
- *xp = strtoul(str, &p, 0);
+ *xp = strtoul(str, &p, 10);
if (str == p) return -2;
while (*p && (*p < '0' || *p > '9'))
++p;
str = p;
if (str[0] == 0) return -3;
- *yp = strtoul(str, &p, 0);
+ *yp = strtoul(str, &p, 10);
if (str == p) return -4;
return (0);
}
@@ -1471,7 +1473,7 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (getenv("DEVICE_URL"))
+ if (getenv("DEVICE_URI"))
IsCUPS = 1;
if (Model == MODEL_HP1020)
diff --git a/foomatic-db/driver/foo2hiperc.xml b/foomatic-db/driver/foo2hiperc.xml
new file mode 100644
index 0000000..ef534f2
--- /dev/null
+++ b/foomatic-db/driver/foo2hiperc.xml
@@ -0,0 +1,29 @@
+<driver id="driver/foo2hiperc">
+ <name>foo2hiperc</name>
+ <url>http://foo2hiperc.rkkda.com/</url>
+ <execution>
+ <filter />
+ <prototype>foo2hiperc-wrapper %A</prototype>
+ </execution>
+ <comments> <en>
+
+ This is a driver developed for the Oki Data Color Laser Printers
+ C3200, C3400, C5100, and C5500.
+
+ &lt;p&gt;
+
+ </en> </comments>
+ <printers>
+ <printer><id>printer/Oki-C3100</id></printer>
+ <printer><id>printer/Oki-C3200</id></printer>
+ <printer><id>printer/Oki-C3300</id></printer>
+ <printer><id>printer/Oki-C3400</id></printer>
+ <printer><id>printer/Oki-C3530_MFP</id></printer>
+ <printer><id>printer/Oki-C5100</id></printer>
+ <printer><id>printer/Oki-C5200</id></printer>
+ <printer><id>printer/Oki-C5500</id></printer>
+ <printer><id>printer/Oki-C5600</id></printer>
+ <printer><id>printer/Oki-C5800</id></printer>
+ <printer><id>printer/Generic-GDI_Printer</id></printer>
+ </printers>
+</driver>
diff --git a/foomatic-db/driver/foo2hp.xml b/foomatic-db/driver/foo2hp.xml
index 95775ff..f303a72 100644
--- a/foomatic-db/driver/foo2hp.xml
+++ b/foomatic-db/driver/foo2hp.xml
@@ -17,6 +17,7 @@
<printers>
<printer><id>printer/HP-Color_LaserJet_2600n</id></printer>
<printer><id>printer/HP-Color_LaserJet_1600</id></printer>
+ <printer><id>printer/HP-Color_LaserJet_CP1215</id></printer>
<printer><id>printer/Generic-ZJS</id></printer>
<printer><id>printer/Generic-GDI_Printer</id></printer>
</printers>
diff --git a/foomatic-db/driver/foo2lava.xml b/foomatic-db/driver/foo2lava.xml
index 8c29aa9..847c3df 100644
--- a/foomatic-db/driver/foo2lava.xml
+++ b/foomatic-db/driver/foo2lava.xml
@@ -15,10 +15,10 @@
</en> </comments>
<printers>
- <printer><id>printer/KonicaMinolta-magicolor_2490_MF</id></printer>
- <printer><id>printer/KonicaMinolta-magicolor_2530_DL</id></printer>
- <printer><id>printer/Xerox-Phaser-6115MFP</id></printer>
- <printer><id>printer/KonicaMinolta-magicolor_2480_MF</id></printer>
+ <printer><id>printer/KONICA_MINOLTA-magicolor_2490_MF</id></printer>
+ <printer><id>printer/KONICA_MINOLTA-magicolor_2530_DL</id></printer>
+ <printer><id>printer/Xerox-Phaser_6115MFP</id></printer>
+ <printer><id>printer/KONICA_MINOLTA-magicolor_2480_MF</id></printer>
<printer><id>printer/Generic-GDI_Printer</id></printer>
</printers>
</driver>
diff --git a/foomatic-db/driver/foo2oak-z1.xml b/foomatic-db/driver/foo2oak-z1.xml
new file mode 100644
index 0000000..b01323b
--- /dev/null
+++ b/foomatic-db/driver/foo2oak-z1.xml
@@ -0,0 +1,20 @@
+<driver id="driver/foo2oak-z1">
+ <name>foo2oak-z1</name>
+ <url>http://foo2oak.rkkda.com/</url>
+ <execution>
+ <filter />
+ <prototype>foo2oak-wrapper -z1 %A</prototype>
+ </execution>
+ <comments> <en>
+
+ This is a driver developed for the Kyocera KM-1635/2035 copier.
+
+ It is possible that this driver will also work for other Oak
+ Technologies OAKT-based printers, but the author cannot test this.
+
+ </en> </comments>
+ <printers>
+ <printer><id>printer/Kyocera-KM-1635</id></printer>
+ <printer><id>printer/Kyocera-KM-2035</id></printer>
+ </printers>
+</driver>
diff --git a/foomatic-db/driver/foo2qpdl.xml b/foomatic-db/driver/foo2qpdl.xml
index 13a09b6..4526ec1 100644
--- a/foomatic-db/driver/foo2qpdl.xml
+++ b/foomatic-db/driver/foo2qpdl.xml
@@ -8,15 +8,20 @@
<comments> <en>
This is a driver developed for the Samsung CLP-300, CLP-600,
- CLX-3160 (printer only), and the Xerox Phaser 6110 or Phaser
- 6110MFP (printer only).
+ CLP-610, CLX-2160 (printer only), CLX-3160 (printer only).
+
+ And the Xerox Phaser 6110 or Phaser 6110MFP (printer only).
</en> </comments>
<printers>
<printer><id>printer/Samsung-CLP-300</id></printer>
+ <printer><id>printer/Samsung-CLP-315</id></printer>
<printer><id>printer/Samsung-CLP-600</id></printer>
+ <printer><id>printer/Samsung-CLP-610</id></printer>
+ <printer><id>printer/Samsung-CLX-2160</id></printer>
<printer><id>printer/Samsung-CLX-3160</id></printer>
- <printer><id>printer/Xerox-Phaser-6110</id></printer>
+ <printer><id>printer/Samsung-CLX-3175</id></printer>
+ <printer><id>printer/Xerox-Phaser_6110</id></printer>
<printer><id>printer/Generic-GDI_Printer</id></printer>
</printers>
</driver>
diff --git a/foomatic-db/driver/foo2slx.xml b/foomatic-db/driver/foo2slx.xml
new file mode 100644
index 0000000..c8f11c7
--- /dev/null
+++ b/foomatic-db/driver/foo2slx.xml
@@ -0,0 +1,19 @@
+<driver id="driver/foo2slx">
+ <name>foo2slx</name>
+ <url>http://foo2slx.rkkda.com/</url>
+ <execution>
+ <filter />
+ <prototype>foo2slx-wrapper %A</prototype>
+ </execution>
+ <comments> <en>
+
+ This is a driver developed for the Lexmark C500.
+
+ &lt;p&gt;
+
+ </en> </comments>
+ <printers>
+ <printer><id>printer/Lexmark-C500</id></printer>
+ <printer><id>printer/Generic-GDI_Printer</id></printer>
+ </printers>
+</driver>
diff --git a/foomatic-db/driver/foo2xqx.xml b/foomatic-db/driver/foo2xqx.xml
index 107593a..9f456d6 100644
--- a/foomatic-db/driver/foo2xqx.xml
+++ b/foomatic-db/driver/foo2xqx.xml
@@ -14,6 +14,13 @@
</en> </comments>
<printers>
<printer><id>printer/HP-LaserJet_M1005_MFP</id></printer>
+ <printer><id>printer/HP-LaserJet_M1120_MFP</id></printer>
+ <printer><id>printer/HP-LaserJet_P1005</id></printer>
+ <printer><id>printer/HP-LaserJet_P1006</id></printer>
+ <printer><id>printer/HP-LaserJet_P1007</id></printer>
+ <printer><id>printer/HP-LaserJet_P1008</id></printer>
+ <printer><id>printer/HP-LaserJet_P1505</id></printer>
+ <printer><id>printer/HP-LaserJet_P2014</id></printer>
<printer><id>printer/Generic-GDI_Printer</id></printer>
</printers>
</driver>
diff --git a/foomatic-db/driver/foo2zjs.xml b/foomatic-db/driver/foo2zjs.xml
index 5d78520..43ceca9 100644
--- a/foomatic-db/driver/foo2zjs.xml
+++ b/foomatic-db/driver/foo2zjs.xml
@@ -27,6 +27,8 @@
<printer><id>printer/HP-LaserJet_1018</id></printer>
<printer><id>printer/HP-LaserJet_1020</id></printer>
<printer><id>printer/HP-LaserJet_1022</id></printer>
+ <printer><id>printer/HP-LaserJet_P2035</id></printer>
+ <printer><id>printer/HP-LaserJet_M1319_MFP</id></printer>
<printer><id>printer/Generic-ZjStream_Printer</id></printer>
<printer><id>printer/Generic-GDI_Printer</id></printer>
</printers>
diff --git a/foomatic-db/opt/foo2hiperc-ColorMode.xml b/foomatic-db/opt/foo2hiperc-ColorMode.xml
new file mode 100644
index 0000000..47165ae
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-ColorMode.xml
@@ -0,0 +1,38 @@
+<option type="enum" id="opt/foo2hiperc-ColorMode">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Color Mode</en> </arg_longname>
+ <arg_shortname> <en>ColorMode</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>120</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-ColorMode-mono</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-ColorMode-mono">
+ <ev_longname> <en>Monochrome</en> </ev_longname>
+ <comments><en>
+ Prints in monochrome only
+ </en></comments>
+ <ev_shortname> <en>Monochrome</en> </ev_shortname>
+ <ev_driverval></ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-ColorMode-color">
+ <ev_longname> <en>Color</en> </ev_longname>
+ <comments><en>
+ Prints in color using the best compromise setting.
+ </en></comments>
+ <ev_shortname> <en>Color</en> </ev_shortname>
+ <ev_driverval>-c</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-Compression.xml b/foomatic-db/opt/foo2hiperc-Compression.xml
new file mode 100644
index 0000000..5b34367
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-Compression.xml
@@ -0,0 +1,32 @@
+<option type="enum" id="opt/foo2hiperc-Compression">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Compression Mode</en> </arg_longname>
+ <arg_shortname> <en>Compression</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>Adjustment</arg_group>
+ <arg_order>120</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-Compression-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-Compression-0">
+ <ev_longname> <en>Uncompressed</en> </ev_longname>
+ <ev_shortname> <en>uncompressed</en> </ev_shortname>
+ <ev_driverval>-Z0 </ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-Compression-1">
+ <ev_longname> <en>Compressed</en> </ev_longname>
+ <ev_shortname> <en>compressed</en> </ev_shortname>
+ <ev_driverval>-Z1 </ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-Duplex.xml b/foomatic-db/opt/foo2hiperc-Duplex.xml
new file mode 100644
index 0000000..fc7b79d
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-Duplex.xml
@@ -0,0 +1,37 @@
+<option type="enum" id="opt/foo2hiperc-Duplex">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Duplex Printing</en> </arg_longname>
+ <arg_shortname> <en>Duplex</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>210</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-d%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-Duplex-1</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-Duplex-1">
+ <ev_longname> <en>Off</en> </ev_longname>
+ <ev_shortname> <en>None</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-Duplex-2">
+ <ev_longname> <en>Long Edge (Standard)</en> </ev_longname>
+ <ev_shortname> <en>DuplexNoTumble</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-Duplex-3">
+ <ev_longname> <en>Short Edge (Flip)</en> </ev_longname>
+ <ev_shortname> <en>DuplexTumble</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-ICM.xml b/foomatic-db/opt/foo2hiperc-ICM.xml
new file mode 100644
index 0000000..7891225
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-ICM.xml
@@ -0,0 +1,90 @@
+<option type="enum" id="opt/foo2hiperc-ICM">
+ <comments>
+ <en>
+ This option controls which .ICM file to use for color correction.
+ ICM files are stored in directory /usr/share/foo2hiperc/icm/.
+ </en>
+ </comments>
+ <arg_longname> <en>ICM Color Profile</en> </arg_longname>
+ <arg_shortname> <en>ICM</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>Adjustment</arg_group>
+ <arg_order>300</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-ICM-3200-600</arg_defval>
+ </constraint>
+<!--
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLP-300</model>
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-ICM-300</arg_defval>
+ </constraint>
+-->
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-ICM-none">
+ <ev_longname> <en>No ICM color correction</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>none</en> </ev_shortname>
+ <ev_driverval>-C10 -Gnone.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-3200-600">
+ <ev_longname> <en>OK3200L2.icm - 600dpi C3100/C3200/C5100/C5200</en> </ev_longname>
+ <ev_shortname> <en>OK3200L2</en> </ev_shortname>
+ <ev_driverval>-C10 -GOK3200L2.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-3200-1200">
+ <ev_longname> <en>OK3200L1.icm - 1200dpi C3100/C3200/C5100/C5200</en> </ev_longname>
+ <ev_shortname> <en>OK3200L1</en> </ev_shortname>
+ <ev_driverval>-C10 -GOK3200L1.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-3400-600">
+ <ev_longname> <en>C3400-L2.icm - 600dpi C3300/C3400/C3530 MFP</en> </ev_longname>
+ <ev_shortname> <en>C3400-L2</en> </ev_shortname>
+ <ev_driverval>-C10 -GC3400-L2-BIN-ICC_0604110.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-3400-1200">
+ <ev_longname> <en>C3400-L1.icm - 1200dpi C3300/C3400/C3530 MFP</en> </ev_longname>
+ <ev_shortname> <en>C3400-L1</en> </ev_shortname>
+ <ev_driverval>-C10 -GC3400-L1-BIN-ICC_0603150.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-5600-600M">
+ <ev_longname> <en>OK5600L1.icm - 600dpi Multi C5500/C5600/C5800</en> </ev_longname>
+ <ev_shortname> <en>OK5600L1</en> </ev_shortname>
+ <ev_driverval>-C10 -GOK5600L1.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-5600-1200">
+ <ev_longname> <en>OK5600L2.icm - 1200dpi C5500/C5600/C5800</en> </ev_longname>
+ <ev_shortname> <en>OK5600L2</en> </ev_shortname>
+ <ev_driverval>-C10 -GOK5600L2.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-5600-600">
+ <ev_longname> <en>OK5600L3.icm - 600dpi C5500/C5600/C5800</en> </ev_longname>
+ <ev_shortname> <en>OK5600L3</en> </ev_shortname>
+ <ev_driverval>-C10 -GOK5600L3.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hiperc-ICM-testing-300">
+ <ev_longname> <en>File testing.icm</en> </ev_longname>
+ <ev_shortname> <en>testing</en> </ev_shortname>
+ <ev_driverval>-C10 -Gtesting.icm</ev_driverval>
+ </enum_val>
+
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-InputSlot.xml b/foomatic-db/opt/foo2hiperc-InputSlot.xml
new file mode 100644
index 0000000..01d8e5f
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-InputSlot.xml
@@ -0,0 +1,54 @@
+<option type="enum" id="opt/foo2hiperc-InputSlot">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Source</en> </arg_longname>
+ <arg_shortname> <en>InputSlot</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-s%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-InputSlot-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-InputSlot-0">
+ <ev_longname> <en>Auto Select</en> </ev_longname>
+ <ev_shortname> <en>Auto</en> </ev_shortname>
+ <ev_driverval>0</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-InputSlot-1">
+ <ev_longname> <en>Tray 1</en> </ev_longname>
+ <ev_shortname> <en>Tray1</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-InputSlot-2">
+ <ev_longname> <en>Tray 2</en> </ev_longname>
+ <ev_shortname> <en>Tray2</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-InputSlot-3">
+ <ev_longname> <en>MultiPurpose</en> </ev_longname>
+ <ev_shortname> <en>Multi</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-InputSlot-4">
+ <ev_longname> <en>Manual Feed</en> </ev_longname>
+ <ev_shortname> <en>Manual</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+<!--
+ <enum_val id="ev/foo2hiperc-InputSlot-1">
+ <ev_longname> <en>Auto Select</en> </ev_longname>
+ <ev_shortname> <en>Auto</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+-->
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-MediaType.xml b/foomatic-db/opt/foo2hiperc-MediaType.xml
new file mode 100644
index 0000000..5b84356
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-MediaType.xml
@@ -0,0 +1,37 @@
+<option type="enum" id="opt/foo2hiperc-MediaType">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Type</en> </arg_longname>
+ <arg_shortname> <en>MediaType</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-m%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-MediaType-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-MediaType-0">
+ <ev_longname> <en>Plain Paper</en> </ev_longname>
+ <ev_shortname> <en>plain</en> </ev_shortname>
+ <ev_driverval>0</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-MediaType-1">
+ <ev_longname> <en>Labels</en> </ev_longname>
+ <ev_shortname> <en>labels</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-MediaType-2">
+ <ev_longname> <en>Transparency</en> </ev_longname>
+ <ev_shortname> <en>transparency</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-PageSize.xml b/foomatic-db/opt/foo2hiperc-PageSize.xml
new file mode 100644
index 0000000..bea12b8
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-PageSize.xml
@@ -0,0 +1,97 @@
+<option type="enum" id="opt/foo2hiperc-PageSize">
+ <arg_longname> <en>Page Size</en> </arg_longname>
+ <arg_shortname> <en>PageSize</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>135</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-p%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-PageSize-2</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-PageSize-1">
+ <ev_longname> <en>A4</en> </ev_longname>
+ <ev_shortname> <en>A4</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-2">
+ <ev_longname> <en>Letter</en> </ev_longname>
+ <ev_shortname> <en>Letter</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-3">
+ <ev_longname> <en>Legal</en> </ev_longname>
+ <ev_shortname> <en>Legal</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-4">
+ <ev_longname> <en>Legal 13</en> </ev_longname>
+ <ev_shortname> <en>Legal13</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-5">
+ <ev_longname> <en>A5</en> </ev_longname>
+ <ev_shortname> <en>A5</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-6">
+ <ev_longname> <en>B5 (JIS)</en> </ev_longname>
+ <ev_shortname> <en>B5jis</en> </ev_shortname>
+ <ev_driverval>6</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-7">
+ <ev_longname> <en>A6</en> </ev_longname>
+ <ev_shortname> <en>A6</en> </ev_shortname>
+ <ev_driverval>7</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-8">
+ <ev_longname> <en>Env Monarch</en> </ev_longname>
+ <ev_shortname> <en>EnvMonarch</en> </ev_shortname>
+ <ev_driverval>8</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-9">
+ <ev_longname> <en>Env DL</en> </ev_longname>
+ <ev_shortname> <en>EnvDL</en> </ev_shortname>
+ <ev_driverval>9</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-10">
+ <ev_longname> <en>Env C5</en> </ev_longname>
+ <ev_shortname> <en>EnvC5</en> </ev_shortname>
+ <ev_driverval>10</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-11">
+ <ev_longname> <en>Env #10</en> </ev_longname>
+ <ev_shortname> <en>Env10</en> </ev_shortname>
+ <ev_driverval>11</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-12">
+ <ev_longname> <en>Executive</en> </ev_longname>
+ <ev_shortname> <en>Executive</en> </ev_shortname>
+ <ev_driverval>12</ev_driverval>
+ </enum_val>
+<!--
+ <enum_val id="ev/foo2hiperc-PageSize-13">
+ <ev_longname> <en>Env #9</en> </ev_longname>
+ <ev_shortname> <en>Env9</en> </ev_shortname>
+ <ev_driverval>13</ev_driverval>
+ </enum_val>
+-->
+ <enum_val id="ev/foo2hiperc-PageSize-14">
+ <ev_longname> <en>Legal 135</en> </ev_longname>
+ <ev_shortname> <en>Legal135</en> </ev_shortname>
+ <ev_driverval>14</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-PageSize-Custom">
+ <ev_longname> <en>Custom</en> </ev_longname>
+ <ev_shortname> <en>Custom</en> </ev_shortname>
+ <ev_driverval>Custom.%0x%1</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hiperc-Resolution.xml b/foomatic-db/opt/foo2hiperc-Resolution.xml
new file mode 100644
index 0000000..60ac925
--- /dev/null
+++ b/foomatic-db/opt/foo2hiperc-Resolution.xml
@@ -0,0 +1,43 @@
+<option type="enum" id="opt/foo2hiperc-Resolution">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Resolution</en> </arg_longname>
+ <arg_shortname> <en>Resolution</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>130</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-r%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2hiperc-Resolution-600x600</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hiperc-Resolution-600x600">
+ <ev_longname> <en>600x600 dpi</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>600x600dpi</en> </ev_shortname>
+ <ev_driverval>600x600</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-Resolution-300x300">
+ <ev_longname> <en>300x300 dpi</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>300x300dpi</en> </ev_shortname>
+ <ev_driverval>300x300</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2hiperc-Resolution-1200x600">
+ <ev_longname> <en>600x1200 dpi</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>600x1200dpi</en> </ev_shortname>
+ <ev_driverval>600x1200</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hp-ICM.xml b/foomatic-db/opt/foo2hp-ICM.xml
index a33e34e..44a1c83 100644
--- a/foomatic-db/opt/foo2hp-ICM.xml
+++ b/foomatic-db/opt/foo2hp-ICM.xml
@@ -24,76 +24,62 @@
<enum_vals>
<enum_val id="ev/foo2hp-ICM-default">
<ev_longname> <en>Default ICM color correction</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>default</en> </ev_shortname>
<ev_driverval>-Gdefault</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-none">
<ev_longname> <en>No ICM color correction</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>none</en> </ev_shortname>
- <ev_driverval>-Gnone</ev_driverval>
+ <ev_driverval>-Gnone.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2hp-ICM-hp1215-argyll-0">
+ <ev_longname> <en>HP 1215 - Argyll 0 (default)</en> </ev_longname>
+ <ev_shortname> <en>hp1215-argyll-0</en> </ev_shortname>
+ <ev_driverval>-Ghp1215-argyll-0.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-hpclj2600n-0">
- <ev_longname> <en>File hpclj2600n-0.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
+ <ev_longname> <en>HP 1600/2600 - hpclj2600n-0.icm</en> </ev_longname>
<ev_shortname> <en>hpclj2600n-0</en> </ev_shortname>
<ev_driverval>-Ghpclj2600n-0.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-hpclj2600n-1">
- <ev_longname> <en>File ICCFactory 1</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
+ <ev_longname> <en>HP 1600/2600 - ICCFactory 1 (default)</en> </ev_longname>
<ev_shortname> <en>hpclj2600n-1</en> </ev_shortname>
<ev_driverval>-Ghpclj2600n-1.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-km2430_2">
<ev_longname> <en>File km2430_2.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>km2430_2</en> </ev_shortname>
<ev_driverval>-Gkm2430_2.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-testing">
<ev_longname> <en>File testing.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>testing</en> </ev_shortname>
<ev_driverval>-Gtesting.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-user1">
<ev_longname> <en>File user1.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user1</en> </ev_shortname>
<ev_driverval>-Guser1.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-user2">
<ev_longname> <en>File user2.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user2</en> </ev_shortname>
<ev_driverval>-Guser2.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-user3">
<ev_longname> <en>File user3.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user3</en> </ev_shortname>
<ev_driverval>-Guser3.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2hp-ICM-user4">
<ev_longname> <en>File user4.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user4</en> </ev_shortname>
<ev_driverval>-Guser4.icm</ev_driverval>
</enum_val>
diff --git a/foomatic-db/opt/foo2hp-PrinterType.xml b/foomatic-db/opt/foo2hp-PrinterType.xml
new file mode 100644
index 0000000..0bea388
--- /dev/null
+++ b/foomatic-db/opt/foo2hp-PrinterType.xml
@@ -0,0 +1,62 @@
+<option type="enum" id="opt/foo2hp-PrinterType">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Printer Type</en> </arg_longname>
+ <arg_shortname> <en>PrinterType</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>110</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hp</driver>
+ <arg_defval>ev/foo2hp-PrinterType-z0</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>HP</make>
+ <model>Color LaserJet CP1215</model>
+ <driver>foo2hp</driver>
+ <arg_defval>ev/foo2hp-PrinterType-z1</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2hp-PrinterType-z0">
+ <ev_longname> <en>z0 printer</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>z0</en> </ev_shortname>
+ <ev_driverval>-z0</ev_driverval>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2hp</driver>
+ </constraint>
+ <constraint sense="false">
+ <driver>foo2hp</driver>
+ <make>HP</make>
+ <model>Color LaserJet CP1215</model>
+ </constraint>
+ </constraints>
+ </enum_val>
+ <enum_val id="ev/foo2hp-PrinterType-z1">
+ <ev_longname> <en>z1 printer</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>z1</en> </ev_shortname>
+ <ev_driverval>-z1</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <driver>foo2hp</driver>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2hp</driver>
+ <make>HP</make>
+ <model>Color LaserJet CP1215</model>
+ </constraint>
+ </constraints>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2hp-Quality.xml b/foomatic-db/opt/foo2hp-Quality.xml
deleted file mode 100644
index 53e0684..0000000
--- a/foomatic-db/opt/foo2hp-Quality.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<option type="enum" id="opt/foo2hp-Quality">
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
- <arg_longname> <en>Printing Quality</en> </arg_longname>
- <arg_shortname> <en>Quality</en> </arg_shortname>
- <arg_execution>
- <arg_group>General</arg_group>
- <arg_order>110</arg_order>
- <arg_spot>A</arg_spot>
- <arg_required />
- <arg_substitution />
- <arg_proto> %s </arg_proto>
- </arg_execution>
- <constraints>
- <constraint sense="true">
- <driver>foo2hp</driver>
- <arg_defval>ev/foo2hp-Quality-Normal</arg_defval>
- </constraint>
- </constraints>
- <enum_vals>
- <enum_val id="ev/foo2hp-Quality-Normal">
- <ev_longname> <en>Normal Mode</en> </ev_longname>
- <ev_shortname> <en>normal</en> </ev_shortname>
- <ev_driverval></ev_driverval>
- </enum_val>
- <enum_val id="ev/foo2hp-Quality-Draft">
- <ev_longname> <en>Draft Mode</en> </ev_longname>
- <ev_shortname> <en>draft</en> </ev_shortname>
- <ev_driverval>-t </ev_driverval>
- </enum_val>
- </enum_vals>
-</option>
diff --git a/foomatic-db/opt/foo2lava-ICM.xml b/foomatic-db/opt/foo2lava-ICM.xml
index aa6a92a..2898484 100644
--- a/foomatic-db/opt/foo2lava-ICM.xml
+++ b/foomatic-db/opt/foo2lava-ICM.xml
@@ -18,7 +18,7 @@
<constraints>
<constraint sense="true">
<driver>foo2lava</driver>
- <arg_defval>ev/foo2lava-ICM-1</arg_defval>
+ <arg_defval>ev/foo2lava-ICM-conner</arg_defval>
</constraint>
</constraints>
<enum_vals>
@@ -31,28 +31,53 @@
</enum_val>
<enum_val id="ev/foo2lava-ICM-0">
- <ev_longname> <en>km2530_0 - Resolution 600</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
+ <ev_longname> <en>km2530_0.icm - Resolution 600</en> </ev_longname>
<ev_shortname> <en>km2530_0</en> </ev_shortname>
<ev_driverval>-Gkm2530_0.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2lava-ICM-1">
- <ev_longname> <en>km2530_1 - Resolution 1200</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
+ <ev_longname> <en>km2530_1.icm - Resolution 1200</en> </ev_longname>
<ev_shortname> <en>km2530_1</en> </ev_shortname>
<ev_driverval>-Gkm2530_1.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2lava-ICM-2">
- <ev_longname> <en>km2530_2 - Resolution 2400</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
+ <ev_longname> <en>km2530_2.icm - Resolution 2400</en> </ev_longname>
<ev_shortname> <en>km2530_2</en> </ev_shortname>
<ev_driverval>-Gkm2530_2.icm</ev_driverval>
</enum_val>
+ <enum_val id="ev/foo2lava-ICM-conner">
+ <ev_longname> <en>km2530-jconner-d50.icm (default)</en> </ev_longname>
+ <ev_shortname> <en>km2530-jc</en> </ev_shortname>
+ <ev_driverval>-Gkm2530-jconner-d50.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2lava-ICM-testing">
+ <ev_longname> <en>File testing.icm</en> </ev_longname>
+ <ev_shortname> <en>testing</en> </ev_shortname>
+ <ev_driverval>-Gtesting.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2lava-ICM-user1">
+ <ev_longname> <en>File user1.icm</en> </ev_longname>
+ <ev_shortname> <en>user1</en> </ev_shortname>
+ <ev_driverval>-Guser1.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2lava-ICM-user2">
+ <ev_longname> <en>File user2.icm</en> </ev_longname>
+ <ev_shortname> <en>user2</en> </ev_shortname>
+ <ev_driverval>-Guser2.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2lava-ICM-user3">
+ <ev_longname> <en>File user3.icm</en> </ev_longname>
+ <ev_shortname> <en>user3</en> </ev_shortname>
+ <ev_driverval>-Guser3.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2lava-ICM-user4">
+ <ev_longname> <en>File user4.icm</en> </ev_longname>
+ <ev_shortname> <en>user4</en> </ev_shortname>
+ <ev_driverval>-Guser4.icm</ev_driverval>
+ </enum_val>
</enum_vals>
</option>
diff --git a/foomatic-db/opt/foo2lava-PrinterType.xml b/foomatic-db/opt/foo2lava-PrinterType.xml
index 2efa638..77de06b 100644
--- a/foomatic-db/opt/foo2lava-PrinterType.xml
+++ b/foomatic-db/opt/foo2lava-PrinterType.xml
@@ -17,7 +17,7 @@
<arg_defval>ev/foo2lava-PrinterType-lavaflow</arg_defval>
</constraint>
<constraint sense="true">
- <make>KonicaMinolta</make>
+ <make>KONICA MINOLTA</make>
<model>magicolor 2480 MF</model>
<driver>foo2lava</driver>
<arg_defval>ev/foo2lava-PrinterType-opl</arg_defval>
@@ -36,7 +36,7 @@
</constraint>
<constraint sense="false">
<driver>foo2lava</driver>
- <make>KonicaMinolta</make>
+ <make>KONICA MINOLTA</make>
<model>magicolor 2480 MF</model>
</constraint>
</constraints>
@@ -53,7 +53,7 @@
</constraint>
<constraint sense="true">
<driver>foo2lava</driver>
- <make>KonicaMinolta</make>
+ <make>KONICA MINOLTA</make>
<model>magicolor 2480 MF</model>
</constraint>
</constraints>
diff --git a/foomatic-db/opt/foo2lava-Quality.xml b/foomatic-db/opt/foo2lava-Quality.xml
deleted file mode 100644
index df631c9..0000000
--- a/foomatic-db/opt/foo2lava-Quality.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<option type="enum" id="opt/foo2lava-Quality">
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
- <arg_longname> <en>Printing Quality</en> </arg_longname>
- <arg_shortname> <en>Quality</en> </arg_shortname>
- <arg_execution>
- <arg_group>General</arg_group>
- <arg_order>110</arg_order>
- <arg_spot>A</arg_spot>
- <arg_required />
- <arg_substitution />
- <arg_proto> %s </arg_proto>
- </arg_execution>
- <constraints>
- <constraint sense="true">
- <driver>foo2lava</driver>
- <arg_defval>ev/foo2lava-Quality-Normal</arg_defval>
- </constraint>
- </constraints>
- <enum_vals>
- <enum_val id="ev/foo2lava-Quality-Normal">
- <ev_longname> <en>Normal</en> </ev_longname>
- <ev_shortname> <en>normal</en> </ev_shortname>
- <ev_driverval></ev_driverval>
- </enum_val>
- <enum_val id="ev/foo2lava-Quality-Draft">
- <ev_longname> <en>Draft</en> </ev_longname>
- <ev_shortname> <en>draft</en> </ev_shortname>
- <ev_driverval>-t </ev_driverval>
- </enum_val>
- </enum_vals>
-</option>
diff --git a/foomatic-db/opt/foo2oak-ICM.xml b/foomatic-db/opt/foo2oak-ICM.xml
index 9f45fc0..be30b50 100644
--- a/foomatic-db/opt/foo2oak-ICM.xml
+++ b/foomatic-db/opt/foo2oak-ICM.xml
@@ -18,50 +18,51 @@
<constraints>
<constraint sense="true">
<driver>foo2oak</driver>
- <arg_defval>ev/foo2oak-ICM-none</arg_defval>
+ <arg_defval>ev/foo2oak-ICM-default</arg_defval>
</constraint>
</constraints>
<enum_vals>
- <enum_val id="ev/foo2oak-ICM-none">
- <ev_longname> <en>No ICM color correction</en> </ev_longname>
+ <enum_val id="ev/foo2oak-ICM-default">
+ <ev_longname> <en>Default ICM color correction</en> </ev_longname>
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
+ <ev_shortname> <en>default</en> </ev_shortname>
+ <ev_driverval>-Gdefault</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-ICM-none">
+ <ev_longname> <en>No ICM color correction</en> </ev_longname>
<ev_shortname> <en>none</en> </ev_shortname>
- <ev_driverval></ev_driverval>
+ <ev_driverval>-Gnone.icm</ev_driverval>
</enum_val>
+ <enum_val id="ev/foo2oak-ICM-hpclj2600n-1">
+ <ev_longname> <en>File hpclj2600n-1.icm (ICCFactory 1)</en> </ev_longname>
+ <ev_shortname> <en>hpclj2600n-1</en> </ev_shortname>
+ <ev_driverval>-Ghpclj2600n-1.icm</ev_driverval>
+ </enum_val>
+
<enum_val id="ev/foo2oak-ICM-testing">
<ev_longname> <en>File testing.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>testing</en> </ev_shortname>
<ev_driverval>-Gtesting.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2oak-ICM-user1">
<ev_longname> <en>File user1.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user1</en> </ev_shortname>
<ev_driverval>-Guser1.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2oak-ICM-user2">
<ev_longname> <en>File user2.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user2</en> </ev_shortname>
<ev_driverval>-Guser2.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2oak-ICM-user3">
<ev_longname> <en>File user3.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user3</en> </ev_shortname>
<ev_driverval>-Guser3.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2oak-ICM-user4">
<ev_longname> <en>File user4.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user4</en> </ev_shortname>
<ev_driverval>-Guser4.icm</ev_driverval>
</enum_val>
diff --git a/foomatic-db/opt/foo2oak-z1-InputSlot.xml b/foomatic-db/opt/foo2oak-z1-InputSlot.xml
new file mode 100644
index 0000000..6458317
--- /dev/null
+++ b/foomatic-db/opt/foo2oak-z1-InputSlot.xml
@@ -0,0 +1,37 @@
+<option type="enum" id="opt/foo2oak-z1-InputSlot">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Source</en> </arg_longname>
+ <arg_shortname> <en>InputSlot</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-s%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2oak-z1</driver>
+ <arg_defval>ev/foo2oak-z1-InputSlot-7</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2oak-z1-InputSlot-1">
+ <ev_longname> <en>Cassette 1</en> </ev_longname>
+ <ev_shortname> <en>Cassette1</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-InputSlot-4">
+ <ev_longname> <en>MP Tray</en> </ev_longname>
+ <ev_shortname> <en>MPTray</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-InputSlot-7">
+ <ev_longname> <en>Auto Select</en> </ev_longname>
+ <ev_shortname> <en>Auto</en> </ev_shortname>
+ <ev_driverval>7</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2oak-z1-MediaType.xml b/foomatic-db/opt/foo2oak-z1-MediaType.xml
new file mode 100644
index 0000000..85b88b4
--- /dev/null
+++ b/foomatic-db/opt/foo2oak-z1-MediaType.xml
@@ -0,0 +1,102 @@
+<option type="enum" id="opt/foo2oak-z1-MediaType">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Type</en> </arg_longname>
+ <arg_shortname> <en>MediaType</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-m%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2oak-z1</driver>
+ <arg_defval>ev/foo2oak-z1-MediaType-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2oak-z1-MediaType-0">
+ <ev_longname> <en>Auto Select</en> </ev_longname>
+ <ev_shortname> <en>Auto</en> </ev_shortname>
+ <ev_driverval>0</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-1">
+ <ev_longname> <en>Plain</en> </ev_longname>
+ <ev_shortname> <en>Plain</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-2">
+ <ev_longname> <en>Preprinted</en> </ev_longname>
+ <ev_shortname> <en>Preprinted</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-3">
+ <ev_longname> <en>Letterhead</en> </ev_longname>
+ <ev_shortname> <en>Letterhead</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-4">
+ <ev_longname> <en>Transparency</en> </ev_longname>
+ <ev_shortname> <en>Transparency</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-5">
+ <ev_longname> <en>Prepunched</en> </ev_longname>
+ <ev_shortname> <en>Prepunched</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-6">
+ <ev_longname> <en>Labels</en> </ev_longname>
+ <ev_shortname> <en>Labels</en> </ev_shortname>
+ <ev_driverval>6</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-7">
+ <ev_longname> <en>Bond</en> </ev_longname>
+ <ev_shortname> <en>Bond</en> </ev_shortname>
+ <ev_driverval>7</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-8">
+ <ev_longname> <en>Recycled</en> </ev_longname>
+ <ev_shortname> <en>Recycled</en> </ev_shortname>
+ <ev_driverval>8</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-9">
+ <ev_longname> <en>Color</en> </ev_longname>
+ <ev_shortname> <en>Color</en> </ev_shortname>
+ <ev_driverval>9</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-10">
+ <ev_longname> <en>Cardstock</en> </ev_longname>
+ <ev_shortname> <en>Cardstock</en> </ev_shortname>
+ <ev_driverval>10</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-12">
+ <ev_longname> <en>Envelope</en> </ev_longname>
+ <ev_shortname> <en>Envelope</en> </ev_shortname>
+ <ev_driverval>12</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-15">
+ <ev_longname> <en>Vellum</en> </ev_longname>
+ <ev_shortname> <en>Vellum</en> </ev_shortname>
+ <ev_driverval>15</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-16">
+ <ev_longname> <en>Rough</en> </ev_longname>
+ <ev_shortname> <en>Rough</en> </ev_shortname>
+ <ev_driverval>16</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-19">
+ <ev_longname> <en>Thick</en> </ev_longname>
+ <ev_shortname> <en>Thick</en> </ev_shortname>
+ <ev_driverval>19</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-MediaType-20">
+ <ev_longname> <en>High quality</en> </ev_longname>
+ <ev_shortname> <en>HighQuality</en> </ev_shortname>
+ <ev_driverval>20</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2oak-z1-PageSize.xml b/foomatic-db/opt/foo2oak-z1-PageSize.xml
new file mode 100644
index 0000000..0abd4af
--- /dev/null
+++ b/foomatic-db/opt/foo2oak-z1-PageSize.xml
@@ -0,0 +1,143 @@
+<option type="enum" id="opt/foo2oak-z1-PageSize">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Page Size</en> </arg_longname>
+ <arg_shortname> <en>PageSize</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>135</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-p%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2oak-z1</driver>
+ <arg_defval>ev/foo2oak-z1-PageSize-1</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2oak-z1-PageSize-1">
+ <ev_longname> <en>Letter</en> </ev_longname>
+ <ev_shortname> <en>Letter</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-3">
+ <ev_longname> <en>Ledger</en> </ev_longname>
+ <ev_shortname> <en>Ledger</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-5">
+ <ev_longname> <en>Legal</en> </ev_longname>
+ <ev_shortname> <en>Legal</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-6">
+ <ev_longname> <en>Statement</en> </ev_longname>
+ <ev_shortname> <en>Statement</en> </ev_shortname>
+ <ev_driverval>6</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-7">
+ <ev_longname> <en>Executive</en> </ev_longname>
+ <ev_shortname> <en>Executive</en> </ev_shortname>
+ <ev_driverval>7</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-8">
+ <ev_longname> <en>A3</en> </ev_longname>
+ <ev_shortname> <en>A3</en> </ev_shortname>
+ <ev_driverval>8</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-9">
+ <ev_longname> <en>A4</en> </ev_longname>
+ <ev_shortname> <en>A4</en> </ev_shortname>
+ <ev_driverval>9</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-11">
+ <ev_longname> <en>A5</en> </ev_longname>
+ <ev_shortname> <en>A5</en> </ev_shortname>
+ <ev_driverval>11</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-12">
+ <ev_longname> <en>B4</en> </ev_longname>
+ <ev_shortname> <en>B4</en> </ev_shortname>
+ <ev_driverval>12</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-13">
+ <ev_longname> <en>B5 [JIS]</en> </ev_longname>
+ <ev_shortname> <en>B5jis</en> </ev_shortname>
+ <ev_driverval>13</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-14">
+ <ev_longname> <en>Folio</en> </ev_longname>
+ <ev_shortname> <en>Folio</en> </ev_shortname>
+ <ev_driverval>14</ev_driverval>
+ </enum_val>
+<!--
+ <enum_val id="ev/foo2oak-z1-PageSize-19">
+ <ev_longname> <en>Env #9</en> </ev_longname>
+ <ev_shortname> <en>Env9</en> </ev_shortname>
+ <ev_driverval>19</ev_driverval>
+ </enum_val>
+-->
+ <enum_val id="ev/foo2oak-z1-PageSize-20">
+ <ev_longname> <en>Env #10</en> </ev_longname>
+ <ev_shortname> <en>Env10</en> </ev_shortname>
+ <ev_driverval>20</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-27">
+ <ev_longname> <en>Env DL</en> </ev_longname>
+ <ev_shortname> <en>EnvDL</en> </ev_shortname>
+ <ev_driverval>27</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-28">
+ <ev_longname> <en>Env C5</en> </ev_longname>
+ <ev_shortname> <en>EnvC5</en> </ev_shortname>
+ <ev_driverval>28</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-30">
+ <ev_longname> <en>Env C4</en> </ev_longname>
+ <ev_shortname> <en>EnvC4</en> </ev_shortname>
+ <ev_driverval>30</ev_driverval>
+ </enum_val>
+<!--
+ <enum_val id="ev/foo2oak-z1-PageSize-34">
+ <ev_longname> <en>Env B5</en> </ev_longname>
+ <ev_shortname> <en>EnvB5</en> </ev_shortname>
+ <ev_driverval>34</ev_driverval>
+ </enum_val>
+-->
+ <enum_val id="ev/foo2oak-z1-PageSize-37">
+ <ev_longname> <en>Env Monarch</en> </ev_longname>
+ <ev_shortname> <en>EnvMonarch</en> </ev_shortname>
+ <ev_driverval>37</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-257">
+ <ev_longname> <en>A6</en> </ev_longname>
+ <ev_shortname> <en>A6</en> </ev_shortname>
+ <ev_driverval>257</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-258">
+ <ev_longname> <en>B6</en> </ev_longname>
+ <ev_shortname> <en>B6</en> </ev_shortname>
+ <ev_driverval>258</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2oak-z1-PageSize-259">
+ <ev_longname> <en>B5 [ISO]</en> </ev_longname>
+ <ev_shortname> <en>B5</en> </ev_shortname>
+ <ev_driverval>259</ev_driverval>
+ </enum_val>
+<!--
+ <enum_val id="ev/foo2oak-z1-PageSize-260">
+ <ev_longname> <en>Env #6</en> </ev_longname>
+ <ev_shortname> <en>Env6</en> </ev_shortname>
+ <ev_driverval>260</ev_driverval>
+ </enum_val>
+-->
+ <enum_val id="ev/foo2oak-z1-PageSize-Custom">
+ <ev_longname> <en>Custom</en> </ev_longname>
+ <ev_shortname> <en>Custom</en> </ev_shortname>
+ <ev_driverval>Custom.%0x%1</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2qpdl-Duplex.xml b/foomatic-db/opt/foo2qpdl-Duplex.xml
index c861f23..b4cfbe2 100644
--- a/foomatic-db/opt/foo2qpdl-Duplex.xml
+++ b/foomatic-db/opt/foo2qpdl-Duplex.xml
@@ -26,12 +26,54 @@
<enum_val id="ev/foo2qpdl-Duplex-4">
<ev_longname> <en>Long Edge (Standard)</en> </ev_longname>
<ev_shortname> <en>DuplexNoTumble</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="true">
+ <printer>Samsung-CLP-610</printer>
+ </constraint>
+ </constraints>
+ </enum_val>
+ <enum_val id="ev/foo2qpdl-Duplex-5">
+ <ev_longname> <en>Short Edge (Flip)</en> </ev_longname>
+ <ev_shortname> <en>DuplexTumble</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="true">
+ <printer>Samsung-CLP-610</printer>
+ </constraint>
+ </constraints>
+ </enum_val>
+ <enum_val id="ev/foo2qpdl-Duplex-4">
+ <ev_longname> <en>Long Edge (Standard)</en> </ev_longname>
+ <ev_shortname> <en>DuplexNoTumble</en> </ev_shortname>
<ev_driverval>4</ev_driverval>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="false">
+ <printer>Samsung-CLP-610</printer>
+ </constraint>
+ </constraints>
</enum_val>
<enum_val id="ev/foo2qpdl-Duplex-5">
<ev_longname> <en>Short Edge (Flip)</en> </ev_longname>
<ev_shortname> <en>DuplexTumble</en> </ev_shortname>
<ev_driverval>5</ev_driverval>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="false">
+ <printer>Samsung-CLP-610</printer>
+ </constraint>
+ </constraints>
</enum_val>
</enum_vals>
</option>
diff --git a/foomatic-db/opt/foo2qpdl-ICM.xml b/foomatic-db/opt/foo2qpdl-ICM.xml
index 1633381..b0d517f 100644
--- a/foomatic-db/opt/foo2qpdl-ICM.xml
+++ b/foomatic-db/opt/foo2qpdl-ICM.xml
@@ -28,11 +28,29 @@
</constraint>
<constraint sense="true">
<make>Samsung</make>
+ <model>CLP-315</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-ICM-315</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLX-2160</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-ICM-2160</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
<model>CLX-3160</model>
<driver>foo2qpdl</driver>
<arg_defval>ev/foo2qpdl-ICM-3160</arg_defval>
</constraint>
<constraint sense="true">
+ <make>Samsung</make>
+ <model>CLX-3175</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-ICM-3175</arg_defval>
+ </constraint>
+ <constraint sense="true">
<make>Xerox</make>
<model>Phaser 6110</model>
<driver>foo2qpdl</driver>
@@ -44,6 +62,12 @@
<driver>foo2qpdl</driver>
<arg_defval>ev/foo2qpdl-ICM-600</arg_defval>
</constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLP-610</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-ICM-610</arg_defval>
+ </constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2qpdl-ICM-none">
@@ -56,34 +80,57 @@
<enum_val id="ev/foo2qpdl-ICM-300">
<ev_longname> <en>CLP-300</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>clp300</en> </ev_shortname>
<ev_driverval>-C10 -Gsamclp300-0.icm</ev_driverval>
</enum_val>
+ <enum_val id="ev/foo2qpdl-ICM-315">
+ <ev_longname> <en>CLP-315</en> </ev_longname>
+ <ev_shortname> <en>clp315</en> </ev_shortname>
+ <ev_driverval>-C10 -Gsamclp315-argyll-0.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2qpdl-ICM-2160">
+ <ev_longname> <en>CLX-2160</en> </ev_longname>
+ <ev_shortname> <en>clx2160</en> </ev_shortname>
+ <ev_driverval>-C10 -Gsamclp300-0.icm</ev_driverval>
+ </enum_val>
+
<enum_val id="ev/foo2qpdl-ICM-3160">
<ev_longname> <en>CLX-3160</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>clx3160</en> </ev_shortname>
<ev_driverval>-C10 -Gsamclp300-0.icm</ev_driverval>
</enum_val>
+ <enum_val id="ev/foo2qpdl-ICM-3175">
+ <ev_longname> <en>CLP-3175</en> </ev_longname>
+ <ev_shortname> <en>clp3175</en> </ev_shortname>
+ <ev_driverval>-C10 -Gsamclp315-argyll-0.icm</ev_driverval>
+ </enum_val>
+
<enum_val id="ev/foo2qpdl-ICM-6110">
<ev_longname> <en>Phaser 6110</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>ph6110</en> </ev_shortname>
<ev_driverval>-C10 -Gsamclp300-0.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2qpdl-ICM-600">
<ev_longname> <en>CLP-600</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>clp600</en> </ev_shortname>
<ev_driverval>-z1</ev_driverval>
</enum_val>
+
+ <enum_val id="ev/foo2qpdl-ICM-610">
+ <ev_longname> <en>CLP-610</en> </ev_longname>
+ <ev_shortname> <en>clp610</en> </ev_shortname>
+ <ev_driverval>-z2</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2qpdl-ICM-testing-300">
+ <ev_longname> <en>File testing.icm</en> </ev_longname>
+ <ev_shortname> <en>testing</en> </ev_shortname>
+ <ev_driverval>-C10 -Gtesting.icm</ev_driverval>
+ </enum_val>
+
</enum_vals>
</option>
diff --git a/foomatic-db/opt/foo2qpdl-InputSlot.xml b/foomatic-db/opt/foo2qpdl-InputSlot.xml
index ae44381..e5234ae 100644
--- a/foomatic-db/opt/foo2qpdl-InputSlot.xml
+++ b/foomatic-db/opt/foo2qpdl-InputSlot.xml
@@ -34,9 +34,14 @@
<ev_driverval>3</ev_driverval>
</enum_val>
<enum_val id="ev/foo2qpdl-InputSlot-4">
- <ev_longname> <en>Tray 1</en> </ev_longname>
+ <ev_longname> <en>Upper / Tray 1</en> </ev_longname>
<ev_shortname> <en>Tray1</en> </ev_shortname>
<ev_driverval>4</ev_driverval>
</enum_val>
+ <enum_val id="ev/foo2qpdl-InputSlot-5">
+ <ev_longname> <en>Lower / Tray 2</en> </ev_longname>
+ <ev_shortname> <en>Tray2</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
</enum_vals>
</option>
diff --git a/foomatic-db/opt/foo2qpdl-PrinterType.xml b/foomatic-db/opt/foo2qpdl-PrinterType.xml
new file mode 100644
index 0000000..aa08d5a
--- /dev/null
+++ b/foomatic-db/opt/foo2qpdl-PrinterType.xml
@@ -0,0 +1,122 @@
+<option type="enum" id="opt/foo2qpdl-PrinterType">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Printer Type</en> </arg_longname>
+ <arg_shortname> <en>PrinterType</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>110</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-PrinterType-z0</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLP-315</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-PrinterType-z2</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLP-600</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-PrinterType-z1</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLP-610</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-PrinterType-z2</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>Samsung</make>
+ <model>CLX-3175</model>
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2qpdl-PrinterType-z2</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2qpdl-PrinterType-z0">
+ <ev_longname> <en>z0 printer</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>z0</en> </ev_shortname>
+ <ev_driverval>-z0</ev_driverval>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-315</model>
+ </constraint>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-600</model>
+ </constraint>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-610</model>
+ </constraint>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLX-3175</model>
+ </constraint>
+ </constraints>
+ </enum_val>
+ <enum_val id="ev/foo2qpdl-PrinterType-z1">
+ <ev_longname> <en>z1 printer</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>z1</en> </ev_shortname>
+ <ev_driverval>-z1</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-600</model>
+ </constraint>
+ </constraints>
+ </enum_val>
+ <enum_val id="ev/foo2qpdl-PrinterType-z2">
+ <ev_longname> <en>z2 printer</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>z2</en> </ev_shortname>
+ <ev_driverval>-z2</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <driver>foo2qpdl</driver>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-315</model>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLP-610</model>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <make>Samsung</make>
+ <model>CLX-3175</model>
+ </constraint>
+ </constraints>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2qpdl-Quality.xml b/foomatic-db/opt/foo2qpdl-Quality.xml
deleted file mode 100644
index 01d645c..0000000
--- a/foomatic-db/opt/foo2qpdl-Quality.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<option type="enum" id="opt/foo2qpdl-Quality">
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
- <arg_longname> <en>Printing Quality</en> </arg_longname>
- <arg_shortname> <en>Quality</en> </arg_shortname>
- <arg_execution>
- <arg_group>General</arg_group>
- <arg_order>110</arg_order>
- <arg_spot>A</arg_spot>
- <arg_required />
- <arg_substitution />
- <arg_proto> %s </arg_proto>
- </arg_execution>
- <constraints>
- <constraint sense="true">
- <driver>foo2qpdl</driver>
- <arg_defval>ev/foo2qpdl-Quality-Normal</arg_defval>
- </constraint>
- </constraints>
- <enum_vals>
- <enum_val id="ev/foo2qpdl-Quality-Normal">
- <ev_longname> <en>Normal</en> </ev_longname>
- <ev_shortname> <en>normal</en> </ev_shortname>
- <ev_driverval></ev_driverval>
- </enum_val>
- <enum_val id="ev/foo2qpdl-Quality-Draft">
- <ev_longname> <en>Draft</en> </ev_longname>
- <ev_shortname> <en>draft</en> </ev_shortname>
- <ev_driverval>-t </ev_driverval>
- </enum_val>
- </enum_vals>
-</option>
diff --git a/foomatic-db/opt/foo2slx-ColorMode.xml b/foomatic-db/opt/foo2slx-ColorMode.xml
new file mode 100644
index 0000000..c331dec
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-ColorMode.xml
@@ -0,0 +1,38 @@
+<option type="enum" id="opt/foo2slx-ColorMode">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Color Mode</en> </arg_longname>
+ <arg_shortname> <en>ColorMode</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>120</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-ColorMode-mono</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-ColorMode-mono">
+ <ev_longname> <en>Monochrome</en> </ev_longname>
+ <comments><en>
+ Prints in monochrome only
+ </en></comments>
+ <ev_shortname> <en>Monochrome</en> </ev_shortname>
+ <ev_driverval></ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-ColorMode-color">
+ <ev_longname> <en>Color</en> </ev_longname>
+ <comments><en>
+ Prints in color using the best compromise setting.
+ </en></comments>
+ <ev_shortname> <en>Color</en> </ev_shortname>
+ <ev_driverval>-c</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2slx-ICM.xml b/foomatic-db/opt/foo2slx-ICM.xml
new file mode 100644
index 0000000..462ef6a
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-ICM.xml
@@ -0,0 +1,65 @@
+<option type="enum" id="opt/foo2slx-ICM">
+ <comments>
+ <en>
+ This option controls which .ICM file to use for color correction.
+ ICM files are stored in directory /usr/share/foo2slx/icm/.
+ </en>
+ </comments>
+ <arg_longname> <en>ICM Color Profile</en> </arg_longname>
+ <arg_shortname> <en>ICM</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>Adjustment</arg_group>
+ <arg_order>300</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-ICM-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-ICM-none">
+ <ev_longname> <en>No ICM color correction</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>none</en> </ev_shortname>
+ <ev_driverval>-Gnone.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2slx-ICM-0">
+ <ev_longname> <en>File lexRPCA2000.icm (xp)</en> </ev_longname>
+ <ev_shortname> <en>lexRPCA2000</en> </ev_shortname>
+ <ev_driverval>-GlexRPCA2000.icm</ev_driverval>
+ </enum_val>
+
+ <enum_val id="ev/foo2slx-ICM-testing">
+ <ev_longname> <en>File testing.icm</en> </ev_longname>
+ <ev_shortname> <en>testing</en> </ev_shortname>
+ <ev_driverval>-Gtesting.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-ICM-user1">
+ <ev_longname> <en>File user1.icm</en> </ev_longname>
+ <ev_shortname> <en>user1</en> </ev_shortname>
+ <ev_driverval>-Guser1.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-ICM-user2">
+ <ev_longname> <en>File user2.icm</en> </ev_longname>
+ <ev_shortname> <en>user2</en> </ev_shortname>
+ <ev_driverval>-Guser2.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-ICM-user3">
+ <ev_longname> <en>File user3.icm</en> </ev_longname>
+ <ev_shortname> <en>user3</en> </ev_shortname>
+ <ev_driverval>-Guser3.icm</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-ICM-user4">
+ <ev_longname> <en>File user4.icm</en> </ev_longname>
+ <ev_shortname> <en>user4</en> </ev_shortname>
+ <ev_driverval>-Guser4.icm</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2slx-InputSlot.xml b/foomatic-db/opt/foo2slx-InputSlot.xml
new file mode 100644
index 0000000..0586fcf
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-InputSlot.xml
@@ -0,0 +1,32 @@
+<option type="enum" id="opt/foo2slx-InputSlot">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Source</en> </arg_longname>
+ <arg_shortname> <en>InputSlot</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-s%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-InputSlot-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-InputSlot-0">
+ <ev_longname> <en>Auto Select</en> </ev_longname>
+ <ev_shortname> <en>Auto</en> </ev_shortname>
+ <ev_driverval>0</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-InputSlot-1">
+ <ev_longname> <en>Cassette 1</en> </ev_longname>
+ <ev_shortname> <en>Cassette1</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2slx-MediaType.xml b/foomatic-db/opt/foo2slx-MediaType.xml
new file mode 100644
index 0000000..01626ec
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-MediaType.xml
@@ -0,0 +1,72 @@
+<option type="enum" id="opt/foo2slx-MediaType">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Media Type</en> </arg_longname>
+ <arg_shortname> <en>MediaType</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>150</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-m%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-MediaType-0</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-MediaType-0">
+ <ev_longname> <en>Plain Paper</en> </ev_longname>
+ <ev_shortname> <en>plain</en> </ev_shortname>
+ <ev_driverval>0</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-1">
+ <ev_longname> <en>Transparency</en> </ev_longname>
+ <ev_shortname> <en>transparency</en> </ev_shortname>
+ <ev_driverval>1</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-2">
+ <ev_longname> <en>Labels</en> </ev_longname>
+ <ev_shortname> <en>labels</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-3">
+ <ev_longname> <en>Thick 1</en> </ev_longname>
+ <ev_shortname> <en>thick1</en> </ev_shortname>
+ <ev_driverval>3</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-4">
+ <ev_longname> <en>Envelope 1</en> </ev_longname>
+ <ev_shortname> <en>envelope1</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-5">
+ <ev_longname> <en>Thin</en> </ev_longname>
+ <ev_shortname> <en>thin</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-6">
+ <ev_longname> <en>Thick 2</en> </ev_longname>
+ <ev_shortname> <en>thick2</en> </ev_shortname>
+ <ev_driverval>6</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-7">
+ <ev_longname> <en>Envelope 2</en> </ev_longname>
+ <ev_shortname> <en>envelope2</en> </ev_shortname>
+ <ev_driverval>7</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-8">
+ <ev_longname> <en>Middle</en> </ev_longname>
+ <ev_shortname> <en>middle</en> </ev_shortname>
+ <ev_driverval>8</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-MediaType-9">
+ <ev_longname> <en>Special</en> </ev_longname>
+ <ev_shortname> <en>special</en> </ev_shortname>
+ <ev_driverval>9</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2slx-PageSize.xml b/foomatic-db/opt/foo2slx-PageSize.xml
new file mode 100644
index 0000000..b1800f1
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-PageSize.xml
@@ -0,0 +1,67 @@
+<option type="enum" id="opt/foo2slx-PageSize">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Page Size</en> </arg_longname>
+ <arg_shortname> <en>PageSize</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>135</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-p%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-PageSize-6</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-PageSize-6">
+ <ev_longname> <en>Letter</en> </ev_longname>
+ <ev_shortname> <en>Letter</en> </ev_shortname>
+ <ev_driverval>6</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-9">
+ <ev_longname> <en>Legal</en> </ev_longname>
+ <ev_shortname> <en>Legal</en> </ev_shortname>
+ <ev_driverval>9</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-8">
+ <ev_longname> <en>Executive</en> </ev_longname>
+ <ev_shortname> <en>Executive</en> </ev_shortname>
+ <ev_driverval>8</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-2">
+ <ev_longname> <en>A4</en> </ev_longname>
+ <ev_shortname> <en>A4</en> </ev_shortname>
+ <ev_driverval>2</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-4">
+ <ev_longname> <en>B5</en> </ev_longname>
+ <ev_shortname> <en>B5</en> </ev_shortname>
+ <ev_driverval>4</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-5">
+ <ev_longname> <en>B5iso</en> </ev_longname>
+ <ev_shortname> <en>B5iso</en> </ev_shortname>
+ <ev_driverval>5</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-10">
+ <ev_longname> <en>Env #10</en> </ev_longname>
+ <ev_shortname> <en>Env10</en> </ev_shortname>
+ <ev_driverval>10</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-11">
+ <ev_longname> <en>Env DL</en> </ev_longname>
+ <ev_shortname> <en>EnvDL</en> </ev_shortname>
+ <ev_driverval>11</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-PageSize-Custom">
+ <ev_longname> <en>Custom</en> </ev_longname>
+ <ev_shortname> <en>Custom</en> </ev_shortname>
+ <ev_driverval>Custom.%0x%1</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2slx-Resolution.xml b/foomatic-db/opt/foo2slx-Resolution.xml
new file mode 100644
index 0000000..bd3af79
--- /dev/null
+++ b/foomatic-db/opt/foo2slx-Resolution.xml
@@ -0,0 +1,36 @@
+<option type="enum" id="opt/foo2slx-Resolution">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Resolution</en> </arg_longname>
+ <arg_shortname> <en>Resolution</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>130</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto>-r%s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2slx-Resolution-1200x600</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2slx-Resolution-600x600">
+ <ev_longname> <en>600x600 dpi</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>600x600dpi</en> </ev_shortname>
+ <ev_driverval>600x600</ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2slx-Resolution-1200x600">
+ <ev_longname> <en>1200x600 dpi</en> </ev_longname>
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <ev_shortname> <en>1200x600dpi</en> </ev_shortname>
+ <ev_driverval>1200x600</ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2xqx-Quality.xml b/foomatic-db/opt/foo2xqx-Quality.xml
deleted file mode 100644
index d71a502..0000000
--- a/foomatic-db/opt/foo2xqx-Quality.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<option type="enum" id="opt/foo2xqx-Quality">
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
- <arg_longname> <en>Printing Quality</en> </arg_longname>
- <arg_shortname> <en>Quality</en> </arg_shortname>
- <arg_execution>
- <arg_group>General</arg_group>
- <arg_order>110</arg_order>
- <arg_spot>A</arg_spot>
- <arg_required />
- <arg_substitution />
- <arg_proto> %s </arg_proto>
- </arg_execution>
- <constraints>
- <constraint sense="true">
- <driver>foo2xqx</driver>
- <arg_defval>ev/foo2xqx-Quality-Normal</arg_defval>
- </constraint>
- </constraints>
- <enum_vals>
- <enum_val id="ev/foo2xqx-Quality-Normal">
- <ev_longname> <en>Normal</en> </ev_longname>
- <ev_shortname> <en>normal</en> </ev_shortname>
- <ev_driverval></ev_driverval>
- </enum_val>
- <enum_val id="ev/foo2xqx-Quality-Draft">
- <ev_longname> <en>Draft</en> </ev_longname>
- <ev_shortname> <en>draft</en> </ev_shortname>
- <ev_driverval>-t </ev_driverval>
- </enum_val>
- </enum_vals>
-</option>
diff --git a/foomatic-db/opt/foo2zjs-Copies.xml b/foomatic-db/opt/foo2xxx-Copies.xml
index adecfaf..d9bab3b 100644
--- a/foomatic-db/opt/foo2zjs-Copies.xml
+++ b/foomatic-db/opt/foo2xxx-Copies.xml
@@ -1,4 +1,4 @@
-<option type="int" id="opt/foo2oakzjs-Copies">
+<option type="int" id="opt/foo2xxx-Copies">
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<arg_longname> <en>Copies</en> </arg_longname>
@@ -36,6 +36,14 @@
<driver>foo2qpdl</driver>
<arg_defval>1</arg_defval>
</constraint>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>1</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>1</arg_defval>
+ </constraint>
</constraints>
<arg_max>100</arg_max>
<arg_min>1</arg_min>
diff --git a/foomatic-db/opt/foo2zjs-Nup.xml b/foomatic-db/opt/foo2xxx-Nup.xml
index 660d288..fd96909 100644
--- a/foomatic-db/opt/foo2zjs-Nup.xml
+++ b/foomatic-db/opt/foo2xxx-Nup.xml
@@ -1,4 +1,4 @@
-<option type="enum" id="opt/foo2oakzjs-Nup">
+<option type="enum" id="opt/foo2xxx-Nup">
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<arg_longname> <en>N-up Printing</en> </arg_longname>
@@ -14,88 +14,96 @@
<constraints>
<constraint sense="true">
<driver>foo2zjs</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2oak</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2hp</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2xqx</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2lava</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2qpdl</driver>
- <arg_defval>ev/foo2oakzjs-Nup-1</arg_defval>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2xxx-Nup-1</arg_defval>
</constraint>
</constraints>
<enum_vals>
- <enum_val id="ev/foo2oakzjs-Nup-1">
+ <enum_val id="ev/foo2xxx-Nup-1">
<ev_longname> <en>1-up</en> </ev_longname>
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<ev_shortname> <en>1up</en> </ev_shortname>
<ev_driverval></ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-2">
+ <enum_val id="ev/foo2xxx-Nup-2">
<ev_longname> <en>2-up</en> </ev_longname>
<ev_shortname> <en>2up</en> </ev_shortname>
<ev_driverval>-2</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-3">
+ <enum_val id="ev/foo2xxx-Nup-3">
<ev_longname> <en>3-up</en> </ev_longname>
<ev_shortname> <en>3up</en> </ev_shortname>
<ev_driverval>-3</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-4">
+ <enum_val id="ev/foo2xxx-Nup-4">
<ev_longname> <en>4-up</en> </ev_longname>
<ev_shortname> <en>4up</en> </ev_shortname>
<ev_driverval>-4</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-6">
+ <enum_val id="ev/foo2xxx-Nup-6">
<ev_longname> <en>6-up</en> </ev_longname>
<ev_shortname> <en>6up</en> </ev_shortname>
<ev_driverval>-6</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-8">
+ <enum_val id="ev/foo2xxx-Nup-8">
<ev_longname> <en>8-up</en> </ev_longname>
<ev_shortname> <en>8up</en> </ev_shortname>
<ev_driverval>-8</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-10">
+ <enum_val id="ev/foo2xxx-Nup-10">
<ev_longname> <en>10-up</en> </ev_longname>
<ev_shortname> <en>10up</en> </ev_shortname>
<ev_driverval>-10</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-12">
+ <enum_val id="ev/foo2xxx-Nup-12">
<ev_longname> <en>12-up</en> </ev_longname>
<ev_shortname> <en>12up</en> </ev_shortname>
<ev_driverval>-12</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-14">
+ <enum_val id="ev/foo2xxx-Nup-14">
<ev_longname> <en>14-up</en> </ev_longname>
<ev_shortname> <en>14up</en> </ev_shortname>
<ev_driverval>-14</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-15">
+ <enum_val id="ev/foo2xxx-Nup-15">
<ev_longname> <en>15-up</en> </ev_longname>
<ev_shortname> <en>15up</en> </ev_shortname>
<ev_driverval>-15</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-16">
+ <enum_val id="ev/foo2xxx-Nup-16">
<ev_longname> <en>16-up</en> </ev_longname>
<ev_shortname> <en>16up</en> </ev_shortname>
<ev_driverval>-16</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-Nup-18">
+ <enum_val id="ev/foo2xxx-Nup-18">
<ev_longname> <en>18-up</en> </ev_longname>
<ev_shortname> <en>18up</en> </ev_shortname>
<ev_driverval>-18</ev_driverval>
diff --git a/foomatic-db/opt/foo2zjs-NupOrient.xml b/foomatic-db/opt/foo2xxx-NupOrient.xml
index 6a3bb2a..e45c629 100644
--- a/foomatic-db/opt/foo2zjs-NupOrient.xml
+++ b/foomatic-db/opt/foo2xxx-NupOrient.xml
@@ -1,4 +1,4 @@
-<option type="enum" id="opt/foo2oakzjs-NupOrient">
+<option type="enum" id="opt/foo2xxx-NupOrient">
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<arg_longname> <en>N-up Orientation</en> </arg_longname>
@@ -14,45 +14,53 @@
<constraints>
<constraint sense="true">
<driver>foo2zjs</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2oak</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2hp</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2xqx</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2lava</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
<constraint sense="true">
<driver>foo2qpdl</driver>
- <arg_defval>ev/foo2oakzjs-NupOrient-port</arg_defval>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2xxx-NupOrient-port</arg_defval>
</constraint>
</constraints>
<enum_vals>
- <enum_val id="ev/foo2oakzjs-NupOrient-port">
+ <enum_val id="ev/foo2xxx-NupOrient-port">
<ev_longname> <en>Portrait</en> </ev_longname>
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<ev_shortname> <en>port</en> </ev_shortname>
<ev_driverval></ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-NupOrient-land">
+ <enum_val id="ev/foo2xxx-NupOrient-land">
<ev_longname> <en>Landscape</en> </ev_longname>
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<ev_shortname> <en>land</en> </ev_shortname>
<ev_driverval>-ol</ev_driverval>
</enum_val>
- <enum_val id="ev/foo2oakzjs-NupOrient-sea">
+ <enum_val id="ev/foo2xxx-NupOrient-sea">
<ev_longname> <en>Seascape</en> </ev_longname>
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
diff --git a/foomatic-db/opt/foo2xxx-Quality.xml b/foomatic-db/opt/foo2xxx-Quality.xml
new file mode 100644
index 0000000..7271294
--- /dev/null
+++ b/foomatic-db/opt/foo2xxx-Quality.xml
@@ -0,0 +1,63 @@
+<option type="enum" id="opt/foo2xxx-Quality">
+ <!-- A multilingual <comments> block can appear here, too;
+ it should be treated as documentation for the user. -->
+ <arg_longname> <en>Printing Quality</en> </arg_longname>
+ <arg_shortname> <en>Quality</en> </arg_shortname>
+ <arg_execution>
+ <arg_group>General</arg_group>
+ <arg_order>110</arg_order>
+ <arg_spot>A</arg_spot>
+ <arg_required />
+ <arg_substitution />
+ <arg_proto> %s </arg_proto>
+ </arg_execution>
+ <constraints>
+ <constraint sense="true">
+ <driver>foo2zjs</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+<!--
+ Doesn't have -t option
+ <constraint sense="true">
+ <driver>foo2oak</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+-->
+ <constraint sense="true">
+ <driver>foo2hp</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2xqx</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2lava</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2qpdl</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2slx</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2hiperc</driver>
+ <arg_defval>ev/foo2xxx-Quality-Normal</arg_defval>
+ </constraint>
+ </constraints>
+ <enum_vals>
+ <enum_val id="ev/foo2xxx-Quality-Normal">
+ <ev_longname> <en>Normal</en> </ev_longname>
+ <ev_shortname> <en>normal</en> </ev_shortname>
+ <ev_driverval></ev_driverval>
+ </enum_val>
+ <enum_val id="ev/foo2xxx-Quality-Draft">
+ <ev_longname> <en>Draft</en> </ev_longname>
+ <ev_shortname> <en>draft</en> </ev_shortname>
+ <ev_driverval>-t </ev_driverval>
+ </enum_val>
+ </enum_vals>
+</option>
diff --git a/foomatic-db/opt/foo2zjs-ColorMode.xml b/foomatic-db/opt/foo2zjs-ColorMode.xml
index ea65a1a..f0d6851 100644
--- a/foomatic-db/opt/foo2zjs-ColorMode.xml
+++ b/foomatic-db/opt/foo2zjs-ColorMode.xml
@@ -49,6 +49,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ColorMode-PhotoOnly">
@@ -76,6 +82,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ColorMode-PhotoAndText">
@@ -102,6 +114,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ColorMode-GraphicAndText">
@@ -130,6 +148,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ColorMode-ICM">
@@ -155,6 +179,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
</enum_vals>
diff --git a/foomatic-db/opt/foo2zjs-Duplex.xml b/foomatic-db/opt/foo2zjs-Duplex.xml
index c14d699..cb398dc 100644
--- a/foomatic-db/opt/foo2zjs-Duplex.xml
+++ b/foomatic-db/opt/foo2zjs-Duplex.xml
@@ -28,6 +28,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1020</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2zjs-Duplex-1">
diff --git a/foomatic-db/opt/foo2zjs-ICM.xml b/foomatic-db/opt/foo2zjs-ICM.xml
index 90fa813..37e97eb 100644
--- a/foomatic-db/opt/foo2zjs-ICM.xml
+++ b/foomatic-db/opt/foo2zjs-ICM.xml
@@ -53,6 +53,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2zjs-ICM-none">
@@ -60,13 +66,11 @@
<!-- A multilingual <comments> block can appear here, too;
it should be treated as documentation for the user. -->
<ev_shortname> <en>none</en> </ev_shortname>
- <ev_driverval></ev_driverval>
+ <ev_driverval>-Gnone.icm</ev_driverval>
</enum_val>
<enum_val id="ev/foo2zjs-ICM-DL2312">
<ev_longname> <en>File DL2312.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>DL2312</en> </ev_shortname>
<ev_driverval>-GDL2312.icm</ev_driverval>
<constraints>
@@ -83,8 +87,6 @@
</enum_val>
<enum_val id="ev/foo2zjs-ICM-DL2324">
<ev_longname> <en>File DL2324.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>DL2324</en> </ev_shortname>
<ev_driverval>-GDL2324.icm</ev_driverval>
<constraints>
@@ -101,8 +103,6 @@
</enum_val>
<enum_val id="ev/foo2zjs-ICM-km2430_2">
<ev_longname> <en>File km2430_2.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>km2430_2</en> </ev_shortname>
<ev_driverval>-Gkm2430_2.icm</ev_driverval>
<constraints>
@@ -120,8 +120,6 @@
<enum_val id="ev/foo2zjs-ICM-DL2200RGB">
<ev_longname> <en>File DL2200RGB.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>DL2200RGB</en> </ev_shortname>
<ev_driverval>-GDL2200RGB.icm</ev_driverval>
<constraints>
@@ -136,8 +134,6 @@
<enum_val id="ev/foo2zjs-ICM-CPWL6W">
<ev_longname> <en>File CPWL6W.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>CPWL6W</en> </ev_shortname>
<ev_driverval>-GCPWL6W.icm</ev_driverval>
<constraints>
@@ -151,8 +147,6 @@
</enum_val>
<enum_val id="ev/foo2zjs-ICM-CPWL12W">
<ev_longname> <en>File CPWL12W.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>CPWL12W</en> </ev_shortname>
<ev_driverval>-GCPWL12W.icm</ev_driverval>
<constraints>
@@ -166,8 +160,6 @@
</enum_val>
<enum_val id="ev/foo2zjs-ICM-CPWL24W">
<ev_longname> <en>File CPWL24W.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>CPWL24W</en> </ev_shortname>
<ev_driverval>-GCPWL24W.icm</ev_driverval>
<constraints>
@@ -182,8 +174,6 @@
<enum_val id="ev/foo2zjs-ICM-testing">
<ev_longname> <en>File testing.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>testing</en> </ev_shortname>
<ev_driverval>-Gtesting.icm</ev_driverval>
<constraints>
@@ -202,12 +192,16 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ICM-user1">
<ev_longname> <en>File user1.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user1</en> </ev_shortname>
<ev_driverval>-Guser1.icm</ev_driverval>
<constraints>
@@ -226,12 +220,16 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ICM-user2">
<ev_longname> <en>File user2.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user2</en> </ev_shortname>
<ev_driverval>-Guser2.icm</ev_driverval>
<constraints>
@@ -250,12 +248,16 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ICM-user3">
<ev_longname> <en>File user3.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user3</en> </ev_shortname>
<ev_driverval>-Guser3.icm</ev_driverval>
<constraints>
@@ -274,12 +276,16 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-ICM-user4">
<ev_longname> <en>File user4.icm</en> </ev_longname>
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
<ev_shortname> <en>user4</en> </ev_shortname>
<ev_driverval>-Guser4.icm</ev_driverval>
<constraints>
@@ -298,6 +304,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
</enum_vals>
diff --git a/foomatic-db/opt/foo2zjs-Intent.xml b/foomatic-db/opt/foo2zjs-Intent.xml
index b2e3973..76fbf8b 100644
--- a/foomatic-db/opt/foo2zjs-Intent.xml
+++ b/foomatic-db/opt/foo2zjs-Intent.xml
@@ -31,6 +31,12 @@
<constraint sense="false">
<make>HP</make> <model>LaserJet 1022</model>
</constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2zjs-Intent-0">
diff --git a/foomatic-db/opt/foo2zjs-PrinterType.xml b/foomatic-db/opt/foo2zjs-PrinterType.xml
index 17731cc..c97c89f 100644
--- a/foomatic-db/opt/foo2zjs-PrinterType.xml
+++ b/foomatic-db/opt/foo2zjs-PrinterType.xml
@@ -46,6 +46,18 @@
<driver>foo2zjs</driver>
<arg_defval>ev/foo2zjs-PrinterType-BW-z1</arg_defval>
</constraint>
+ <constraint sense="true">
+ <make>HP</make>
+ <model>LaserJet P2035</model>
+ <driver>foo2zjs</driver>
+ <arg_defval>ev/foo2zjs-PrinterType-BW-z1</arg_defval>
+ </constraint>
+ <constraint sense="true">
+ <make>HP</make>
+ <model>LaserJet M1319 MFP</model>
+ <driver>foo2zjs</driver>
+ <arg_defval>ev/foo2zjs-PrinterType-BW-z1</arg_defval>
+ </constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2zjs-PrinterType-BW">
@@ -105,6 +117,16 @@
<make>HP</make>
<model>LaserJet 1022</model>
</constraint>
+ <constraint sense="true">
+ <driver>foo2zjs</driver>
+ <make>HP</make>
+ <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="true">
+ <driver>foo2zjs</driver>
+ <make>HP</make>
+ <model>LaserJet M1319 MFP</model>
+ </constraint>
</constraints>
</enum_val>
<enum_val id="ev/foo2zjs-PrinterType-Color">
diff --git a/foomatic-db/opt/foo2zjs-Quality.xml b/foomatic-db/opt/foo2zjs-Quality.xml
deleted file mode 100644
index 9c32a4f..0000000
--- a/foomatic-db/opt/foo2zjs-Quality.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<option type="enum" id="opt/foo2zjs-Quality">
- <!-- A multilingual <comments> block can appear here, too;
- it should be treated as documentation for the user. -->
- <arg_longname> <en>Printing Quality</en> </arg_longname>
- <arg_shortname> <en>Quality</en> </arg_shortname>
- <arg_execution>
- <arg_group>General</arg_group>
- <arg_order>110</arg_order>
- <arg_spot>A</arg_spot>
- <arg_required />
- <arg_substitution />
- <arg_proto> %s </arg_proto>
- </arg_execution>
- <constraints>
- <constraint sense="true">
- <driver>foo2zjs</driver>
- <arg_defval>ev/foo2zjs-Quality-Normal</arg_defval>
- </constraint>
- </constraints>
- <enum_vals>
- <enum_val id="ev/foo2zjs-Quality-Normal">
- <ev_longname> <en>Normal</en> </ev_longname>
- <ev_shortname> <en>normal</en> </ev_shortname>
- <ev_driverval></ev_driverval>
- </enum_val>
- <enum_val id="ev/foo2zjs-Quality-Draft">
- <ev_longname> <en>Draft</en> </ev_longname>
- <ev_shortname> <en>draft</en> </ev_shortname>
- <ev_driverval>-t </ev_driverval>
- </enum_val>
- </enum_vals>
-</option>
diff --git a/foomatic-db/opt/foo2zjs-Resolution.xml b/foomatic-db/opt/foo2zjs-Resolution.xml
index e39b062..40ba561 100644
--- a/foomatic-db/opt/foo2zjs-Resolution.xml
+++ b/foomatic-db/opt/foo2zjs-Resolution.xml
@@ -36,6 +36,12 @@
it should be treated as documentation for the user. -->
<ev_shortname> <en>600x600dpi</en> </ev_shortname>
<ev_driverval>600x600</ev_driverval>
+ <constraints>
+ <constraint sense="false">
+ <make>Minolta</make>
+ <model>magicolor 2200 DL</model>
+ </constraint>
+ </constraints>
</enum_val>
<enum_val id="ev/foo2zjs-Resolution-1200x600">
<ev_longname> <en>1200x600 dpi</en> </ev_longname>
@@ -62,28 +68,28 @@
<ev_driverval>2400x600</ev_driverval>
<constraints>
<constraint sense="false">
- <make>HP</make>
- <model>LaserJet 1000</model>
+ <make>HP</make> <model>LaserJet 1000</model>
</constraint>
<constraint sense="false">
- <make>HP</make>
- <model>LaserJet 1005</model>
+ <make>HP</make> <model>LaserJet 1005</model>
</constraint>
<constraint sense="false">
- <make>HP</make>
- <model>LaserJet 1018</model>
+ <make>HP</make> <model>LaserJet 1018</model>
</constraint>
<constraint sense="false">
- <make>HP</make>
- <model>LaserJet 1020</model>
+ <make>HP</make> <model>LaserJet 1020</model>
</constraint>
<constraint sense="false">
- <make>HP</make>
- <model>LaserJet 1022</model>
+ <make>HP</make> <model>LaserJet 1022</model>
</constraint>
<constraint sense="false">
- <make>Minolta</make>
- <model>magicolor 2200 DL</model>
+ <make>HP</make> <model>LaserJet P2035</model>
+ </constraint>
+ <constraint sense="false">
+ <make>HP</make> <model>LaserJet M1319 MFP</model>
+ </constraint>
+ <constraint sense="false">
+ <make>Minolta</make> <model>magicolor 2200 DL</model>
</constraint>
</constraints>
</enum_val>
diff --git a/foomatic-db/printer/HP-Color_LaserJet_CP1215.xml b/foomatic-db/printer/HP-Color_LaserJet_CP1215.xml
new file mode 100644
index 0000000..12568ed
--- /dev/null
+++ b/foomatic-db/printer/HP-Color_LaserJet_CP1215.xml
@@ -0,0 +1,58 @@
+<printer id="printer/HP-Color_LaserJet_CP1215">
+ <make>HP</make>
+ <model>Color LaserJet CP1215</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>inch</unit>
+ <top>0.166666</top>
+ <bottom>0.166666</bottom>
+ <left>0.166666</left>
+ <right>0.166666</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Q6000A HP Color LaserJet black print cartridge [Add $75.00]
+ Q6001A HP Color LaserJet cyan print cartridge [Add $82.00]
+ Q6002A HP Color LaserJet yellow print cartridge [Add $82.00]
+ Q6003A HP Color LaserJet magenta print cartridge [Add $82.00]
+ </en> </comments>
+ <partno>Q6000A</partno>
+ <partno>Q6001A</partno>
+ <partno>Q6002A</partno>
+ <partno>Q6003A</partno>
+ </consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328060-15077-3328070-3422474.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP Color LaserJet CP1215;CMD:ZJS,HBS,PJL,ACL,HTTP;CLS:PRINTER;DES:HP Color LaserJet CP1215;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP Color LaserJet CP1215</model>
+ <commandset>ACL</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>C</functionality>
+ <driver>foo2hp</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Color LaserJet CP1215 is color laser printer with a 2008 street
+ price of $199 USD. This printer is supported by the foo2hp
+ printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_M1120_MFP.xml b/foomatic-db/printer/HP-LaserJet_M1120_MFP.xml
new file mode 100644
index 0000000..55a8116
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_M1120_MFP.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_M1120_MFP">
+ <make>HP</make>
+ <model>LaserJet M1120 MFP</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/ie/en/ho/WF06b/5043-5527-5531-5531-12489380-81083169-81084209.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet M1120;CMD:ACL;CLS:PRINTER;DES:HP LaserJet M1120;FWVER:20060721;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet M1120</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_M1319_MFP.xml b/foomatic-db/printer/HP-LaserJet_M1319_MFP.xml
new file mode 100644
index 0000000..1a0301d
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_M1319_MFP.xml
@@ -0,0 +1,55 @@
+<printer id="printer/HP-LaserJet_M1319_MFP">
+ <make>HP</make>
+ <model>LaserJet M1319 MFP</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Print cartridge (2000 prints) - $78
+ </en></comments>
+ <partno>Q2612</partno>
+ </consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328064-12004-3328082-3547126.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet M1319;CMD:ACL;CLS:PRINTER;DES:HP LaserJet M1319;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet M1319</model>
+ <commandset>ACL</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2zjs</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2zjs free software printer driver.
+ &lt;p&gt;
+
+ The printer is faster than the LaserJet 1020 and has a USB
+ or an optional network connection. It has 16 MB of RAM.&lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P1005.xml b/foomatic-db/printer/HP-LaserJet_P1005.xml
new file mode 100644
index 0000000..b59dc96
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P1005.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P1005">
+ <make>HP</make>
+ <model>LaserJet P1005</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328059-14638-3328066-3435674.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P1005;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P1005;FWVER:20080415;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P1005</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P1006.xml b/foomatic-db/printer/HP-LaserJet_P1006.xml
new file mode 100644
index 0000000..a2f5d0b
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P1006.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P1006">
+ <make>HP</make>
+ <model>LaserJet P1006</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328059-14638-3328066-3435682.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P1006;FWVER:20080415;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P1006</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P1007.xml b/foomatic-db/printer/HP-LaserJet_P1007.xml
new file mode 100644
index 0000000..5f19354
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P1007.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P1007">
+ <make>HP</make>
+ <model>LaserJet P1007</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328059-14638-3328066-3435674.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P1007;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P1007;FWVER:20080415;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P1007</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P1008.xml b/foomatic-db/printer/HP-LaserJet_P1008.xml
new file mode 100644
index 0000000..61480b8
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P1008.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P1008">
+ <make>HP</make>
+ <model>LaserJet P1008</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF05a/18972-18972-3328059-14638-3328066-3435682.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P1008;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P1008;FWVER:20080415;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P1008</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P1505.xml b/foomatic-db/printer/HP-LaserJet_P1505.xml
new file mode 100644
index 0000000..5711b8f
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P1505.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P1505">
+ <make>HP</make>
+ <model>LaserJet P1505</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF25a/18972-18972-3328059-14638-3328066-3435666.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P1505;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P1505;FWVER:20070910;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P1505</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P2014.xml b/foomatic-db/printer/HP-LaserJet_P2014.xml
new file mode 100644
index 0000000..b588b6f
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P2014.xml
@@ -0,0 +1,50 @@
+<printer id="printer/HP-LaserJet_P2014">
+ <make>HP</make>
+ <model>LaserJet P2014</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments>
+ <en>Cartridge containing toner and imaging drum</en>
+ </comments>
+ <!--one or more "partno" elements.--></consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/sm/WF25a/18972-18972-3328059-14638-3328066-3435666.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?--></lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P2014;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P2014;FWVER:20070910;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P2014</model>
+ <commandset>XQX</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2xqx</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2xqx free software printer driver.
+ &lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/HP-LaserJet_P2035.xml b/foomatic-db/printer/HP-LaserJet_P2035.xml
new file mode 100644
index 0000000..ce24270
--- /dev/null
+++ b/foomatic-db/printer/HP-LaserJet_P2035.xml
@@ -0,0 +1,55 @@
+<printer id="printer/HP-LaserJet_P2035">
+ <make>HP</make>
+ <model>LaserJet P2035</model>
+ <mechanism>
+ <laser/><!--not "color"-->
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4</top>
+ <bottom>4</bottom>
+ <left>4</left>
+ <right>4</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Print cartridge (2000 prints) - $89
+ </en></comments>
+ <partno>CE505</partno>
+ </consumables>
+ </mechanism>
+ <url>http://h10010.www1.hp.com/wwpc/us/en/en/WF06b/18972-18972-3328059-14638-236263-3662025-3662026-3662038.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ <parallel>
+ <ieee1284>MFG:Hewlett-Packard;MDL:HP LaserJet P2035;CMD:ACL;CLS:PRINTER;DES:HP LaserJet P2035;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>HP LaserJet P2035</model>
+ <commandset>ACL</commandset>
+ </parallel>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2zjs</driver>
+ <!--no "contrib_url"-->
+ <comments>
+ <en>
+
+ This printer is supported by the foo2zjs free software printer driver.
+ &lt;p&gt;
+
+ The printer is faster than the LaserJet 1020 and has a USB
+ or an optional network connection. It has 16 MB of RAM.&lt;p&gt;
+
+ </en>
+ </comments>
+</printer>
diff --git a/foomatic-db/printer/KonicaMinolta-magicolor_2480_MF.xml b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2480_MF.xml
index 4ce6181..87d7abc 100644
--- a/foomatic-db/printer/KonicaMinolta-magicolor_2480_MF.xml
+++ b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2480_MF.xml
@@ -1,5 +1,5 @@
-<printer id="printer/KonicaMinolta-magicolor_2480_MF">
- <make>KonicaMinolta</make>
+<printer id="printer/KONICA_MINOLTA-magicolor_2480_MF">
+ <make>KONICA MINOLTA</make>
<model>magicolor 2480 MF</model>
<mechanism>
<laser/>
diff --git a/foomatic-db/printer/KonicaMinolta-magicolor_2490_MF.xml b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2490_MF.xml
index 5d8024c..429d5b8 100644
--- a/foomatic-db/printer/KonicaMinolta-magicolor_2490_MF.xml
+++ b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2490_MF.xml
@@ -1,5 +1,5 @@
-<printer id="printer/KonicaMinolta-magicolor_2490_MF">
- <make>KonicaMinolta</make>
+<printer id="printer/KONICA_MINOLTA-magicolor_2490_MF">
+ <make>KONICA MINOLTA</make>
<model>magicolor 2490 MF</model>
<mechanism>
<laser/>
diff --git a/foomatic-db/printer/KonicaMinolta-magicolor_2530_DL.xml b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2530_DL.xml
index 9578579..a9e7227 100644
--- a/foomatic-db/printer/KonicaMinolta-magicolor_2530_DL.xml
+++ b/foomatic-db/printer/KONICA_MINOLTA-magicolor_2530_DL.xml
@@ -1,5 +1,5 @@
-<printer id="printer/KonicaMinolta-magicolor_2530_DL">
- <make>KonicaMinolta</make>
+<printer id="printer/KONICA_MINOLTA-magicolor_2530_DL">
+ <make>KONICA MINOLTA</make>
<model>magicolor 2530 DL</model>
<mechanism>
<laser/>
diff --git a/foomatic-db/printer/Kyocera-KM-1635.xml b/foomatic-db/printer/Kyocera-KM-1635.xml
new file mode 100644
index 0000000..03dd201
--- /dev/null
+++ b/foomatic-db/printer/Kyocera-KM-1635.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Kyocera-KM-1635">
+ <make>Kyocera</make>
+ <model>KM-1635</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>inch</unit>
+ <top>0.166666</top>
+ <bottom>0.166666</bottom>
+ <left>0.166666</left>
+ <right>0.166666</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (15000 prints) - $70
+ Imaging Drum (150000 prints) - $160
+ </en> </comments>
+ <partno>tk410</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.kyoceramita.eu/index/products/product/km1635.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+<!--
+ <autodetect>
+ <parallel>
+ <ieee1284>CLS:PRINTER;MDL:hp color LaserJet 1500;MFG:Hewlett-Packard;CMD:OAKRAS;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>hp color LaserJet 1500</model>
+ <commandset>OAKRAS</commandset>
+ </parallel>
+ </autodetect>
+-->
+ <functionality>C</functionality>
+ <driver>foo2oak-z1</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The KM-1635 is a copier. Only the print function is supported.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Kyocera-KM-2035.xml b/foomatic-db/printer/Kyocera-KM-2035.xml
new file mode 100644
index 0000000..2ec05d7
--- /dev/null
+++ b/foomatic-db/printer/Kyocera-KM-2035.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Kyocera-KM-2035">
+ <make>Kyocera</make>
+ <model>KM-2035</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>inch</unit>
+ <top>0.166666</top>
+ <bottom>0.166666</bottom>
+ <left>0.166666</left>
+ <right>0.166666</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (15000 prints) - $70
+ Imaging Drum (150000 prints) - $160
+ </en> </comments>
+ <partno>tk410</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.kyoceramita.eu/index/products/product/km2035.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+<!--
+ <autodetect>
+ <parallel>
+ <ieee1284>CLS:PRINTER;MDL:hp color LaserJet 1500;MFG:Hewlett-Packard;CMD:OAKRAS;</ieee1284>
+ <manufacturer>Hewlett-Packard</manufacturer>
+ <model>hp color LaserJet 1500</model>
+ <commandset>OAKRAS</commandset>
+ </parallel>
+ </autodetect>
+-->
+ <functionality>C</functionality>
+ <driver>foo2oak-z1</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The KM-2035 is a copier. Only the print function is supported.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Lexmark-C500.xml b/foomatic-db/printer/Lexmark-C500.xml
new file mode 100644
index 0000000..b470700
--- /dev/null
+++ b/foomatic-db/printer/Lexmark-C500.xml
@@ -0,0 +1,54 @@
+<printer id="printer/Lexmark-C500">
+ <make>Lexmark</make>
+ <model>C500</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>600</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (5000 prints) - $90
+ Toner Yellow (3000 prints) - $90
+ Toner Magenta (3000 prints) - $90
+ Toner Cyan (3000 prints) - $90
+ Photodeveloper Cartridge (120000 prints) - $205
+ </en> </comments>
+ <partno>C500H2KG</partno>
+ <partno>C500H2YG</partno>
+ <partno>C500H2MG</partno>
+ <partno>C500H2CG</partno>
+ <partno>C500X26G</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.lexmark.com/lexmark/product/home/435/0,6970,204816596_653293763_728193459_en,00.html</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2slx</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Lexmark C500 is a networked color laser printer with a
+ 2007 street price of $300 USD. This printer is supported
+ by the foo2slx open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C3100.xml b/foomatic-db/printer/Oki-C3100.xml
new file mode 100644
index 0000000..6158011
--- /dev/null
+++ b/foomatic-db/printer/Oki-C3100.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C3100">
+ <make>Oki</make>
+ <model>C3100</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C3100n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C3100 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C3200.xml b/foomatic-db/printer/Oki-C3200.xml
new file mode 100644
index 0000000..247e538
--- /dev/null
+++ b/foomatic-db/printer/Oki-C3200.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C3200">
+ <make>Oki</make>
+ <model>C3200</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C3200n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C3200 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C3300.xml b/foomatic-db/printer/Oki-C3300.xml
new file mode 100644
index 0000000..db63bd0
--- /dev/null
+++ b/foomatic-db/printer/Oki-C3300.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C3300">
+ <make>Oki</make>
+ <model>C3300</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C3300n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C3300 is a networked color laser printer with a
+ 2007 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C3400.xml b/foomatic-db/printer/Oki-C3400.xml
new file mode 100644
index 0000000..facbc0f
--- /dev/null
+++ b/foomatic-db/printer/Oki-C3400.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C3400">
+ <make>Oki</make>
+ <model>C3400</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C3400n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C3400 is a networked color laser printer with a
+ 2007 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C3530_MFP.xml b/foomatic-db/printer/Oki-C3530_MFP.xml
new file mode 100644
index 0000000..e169855
--- /dev/null
+++ b/foomatic-db/printer/Oki-C3530_MFP.xml
@@ -0,0 +1,55 @@
+<printer id="printer/Oki-C3530_MFP">
+ <make>Oki</make>
+ <model>C3530 MFP</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/PP-C3530nMFP.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C3530n MFP is a networked color multifuction printer with
+ a 2008 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ Only the print function is supported.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C5100.xml b/foomatic-db/printer/Oki-C5100.xml
new file mode 100644
index 0000000..75e3ad7
--- /dev/null
+++ b/foomatic-db/printer/Oki-C5100.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C5100">
+ <make>Oki</make>
+ <model>C5100</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C5100n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C5100 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C5200.xml b/foomatic-db/printer/Oki-C5200.xml
new file mode 100644
index 0000000..03aac87
--- /dev/null
+++ b/foomatic-db/printer/Oki-C5200.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C5200">
+ <make>Oki</make>
+ <model>C5200</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.oki.co.uk/</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C5200 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C5500.xml b/foomatic-db/printer/Oki-C5500.xml
new file mode 100644
index 0000000..54b78a9
--- /dev/null
+++ b/foomatic-db/printer/Oki-C5500.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C5500">
+ <make>Oki</make>
+ <model>C5500</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C5500n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C5500 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C5600.xml b/foomatic-db/printer/Oki-C5600.xml
new file mode 100644
index 0000000..ad9f5cf
--- /dev/null
+++ b/foomatic-db/printer/Oki-C5600.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C5600">
+ <make>Oki</make>
+ <model>C5600</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C5600n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C5600 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Oki-C5800.xml b/foomatic-db/printer/Oki-C5800.xml
new file mode 100644
index 0000000..7029f81
--- /dev/null
+++ b/foomatic-db/printer/Oki-C5800.xml
@@ -0,0 +1,53 @@
+<printer id="printer/Oki-C5800">
+ <make>Oki</make>
+ <model>C5800</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>600</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (1500 prints) - $32
+ Toner Yellow (1500 prints) - $65
+ Toner Magenta (1500 prints) - $65
+ Toner Cyan (1500 prints) - $65
+ Drum Black (15000 prints) - $100
+ Drum Yellow (1500 prints) - $120
+ Drum Magenta (1500 prints) - $120
+ Drum Cyan (1500 prints) - $120
+ </en> </comments>
+ <partno>43034804</partno>
+ </consumables>
+ </mechanism>
+ <url>http://my.okidata.com/pp-C5800n.nsf</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2hiperc</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Oki C5800 is a networked color laser printer with a
+ 2006 street price of $399 USD. This printer is supported
+ by the foo2hiperc open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Samsung-CLP-315.xml b/foomatic-db/printer/Samsung-CLP-315.xml
new file mode 100644
index 0000000..97468e9
--- /dev/null
+++ b/foomatic-db/printer/Samsung-CLP-315.xml
@@ -0,0 +1,57 @@
+<printer id="printer/Samsung-CLP-315">
+ <make>Samsung</make>
+ <model>CLP-315</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (2000 prints) - $54
+ Toner Yellow (1000 prints) - $45
+ Toner Magenta (1000 prints) - $45
+ Toner Cyan (1000 prints) - $45
+ Waste Toner (5000 prints) - $10
+ Drum Kit (20000 prints) - $96
+ </en> </comments>
+ <partno>CLP-K300A</partno>
+ <partno>CLP-Y315A</partno>
+ <partno>CLP-M300A</partno>
+ <partno>CLP-C300A</partno>
+ <partno>CLP-W300A</partno>
+ <partno>CLP-R300A</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.samsung.com/Products/PrinterandMultifunction/ColorLaserPrinters/CLP_300NXAA.asp</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2qpdl</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Samsung CLP-315 (USB) and Samsung CLP-315W (Net) are color laser
+ printers with a 2008 street price of $159 USD and $249 USD.
+
+ This printer is supported by the foo2qpdl open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Samsung-CLP-610.xml b/foomatic-db/printer/Samsung-CLP-610.xml
new file mode 100644
index 0000000..be452ba
--- /dev/null
+++ b/foomatic-db/printer/Samsung-CLP-610.xml
@@ -0,0 +1,54 @@
+<printer id="printer/Samsung-CLP-610">
+ <make>Samsung</make>
+ <model>CLP-610</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (4000 prints) - $80
+ Toner Yellow (4000 prints) - $110
+ Toner Magenta (4000 prints) - $110
+ Toner Cyan (4000 prints) - $110
+ Transfer Belt (35000 prints) - $47
+ </en> </comments>
+ <partno>CLP-K600A</partno>
+ <partno>CLP-Y600A</partno>
+ <partno>CLP-M600A</partno>
+ <partno>CLP-C600A</partno>
+ <partno>CLP-T600A</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.samsung.com/my/products/printer/lasercolorprinter/clp_610ndxss.asp</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2qpdl</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Samsung CLP-610 is a networked color laser printer with a
+ 2008 street price of $330 USD. This printer is supported
+ by the foo2qpdl open software printer driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Samsung-CLX-2160.xml b/foomatic-db/printer/Samsung-CLX-2160.xml
new file mode 100644
index 0000000..f763d95
--- /dev/null
+++ b/foomatic-db/printer/Samsung-CLX-2160.xml
@@ -0,0 +1,59 @@
+<printer id="printer/Samsung-CLX-2160">
+ <make>Samsung</make>
+ <model>CLX-2160</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (2000 prints) - $54
+ Toner Yellow (1000 prints) - $45
+ Toner Magenta (1000 prints) - $45
+ Toner Cyan (1000 prints) - $45
+ Waste Toner (5000 prints) - $10
+ Drum Kit (20000 prints) - $96
+ </en> </comments>
+ <partno>CLP-K300A</partno>
+ <partno>CLP-Y300A</partno>
+ <partno>CLP-M300A</partno>
+ <partno>CLP-C300A</partno>
+ <partno>CLP-W300A</partno>
+ <partno>CLP-R300A</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.samsung.com/uk/business/b2b/products/printers/multifunctional/clx-2160n.htm</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2qpdl</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Samsung CLX-2160 is color laser multifunction printer
+ with a 2007 street price of $450 USD.
+
+ This printer is supported by the foo2qpdl open software printer driver.
+
+ Only the printer function is supported by this driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Samsung-CLX-3175.xml b/foomatic-db/printer/Samsung-CLX-3175.xml
new file mode 100644
index 0000000..ce0dd2e
--- /dev/null
+++ b/foomatic-db/printer/Samsung-CLX-3175.xml
@@ -0,0 +1,59 @@
+<printer id="printer/Samsung-CLX-3175">
+ <make>Samsung</make>
+ <model>CLX-3175</model>
+ <mechanism>
+ <laser/>
+ <color/>
+ <resolution>
+ <dpi>
+ <x>1200</x>
+ <y>1200</y>
+ </dpi>
+ </resolution>
+ <margins>
+ <general>
+ <unit>mm</unit>
+ <top>4.23164</top>
+ <bottom>4.23164</bottom>
+ <left>3.175</left>
+ <right>3.175</right>
+ </general>
+ </margins>
+ <consumables>
+ <comments> <en>
+ Toner Black (2000 prints) - $54
+ Toner Yellow (1000 prints) - $45
+ Toner Magenta (1000 prints) - $45
+ Toner Cyan (1000 prints) - $45
+ Waste Toner (5000 prints) - $10
+ Drum Kit (20000 prints) - $96
+ </en> </comments>
+ <partno>CLP-K300A</partno>
+ <partno>CLP-Y300A</partno>
+ <partno>CLP-M300A</partno>
+ <partno>CLP-C300A</partno>
+ <partno>CLP-W300A</partno>
+ <partno>CLP-R300A</partno>
+ </consumables>
+ </mechanism>
+ <url>http://www.samsung.com/Products/PrinterandMultifunction/ColorLaserPrinters/CLX_3175FNXAA.asp</url>
+ <lang>
+ <proprietary/>
+ <!--no pjl--><!--No "text"?-->
+ </lang>
+ <autodetect>
+ </autodetect>
+ <functionality>B</functionality>
+ <driver>foo2qpdl</driver>
+ <!--not "unverified"--><!--no "contrib_url"-->
+ <comments> <en>
+
+ The Samsung CLX-3175 (USB) is color laser multifunction printer
+ with a 2008 street price of $590 USD.
+
+ This printer is supported by the foo2qpdl open software printer driver.
+
+ Only the printer function is supported by this driver.
+
+ </en> </comments>
+</printer>
diff --git a/foomatic-db/printer/Xerox-Phaser-6110.xml b/foomatic-db/printer/Xerox-Phaser_6110.xml
index fb2bf29..f1e51b7 100644
--- a/foomatic-db/printer/Xerox-Phaser-6110.xml
+++ b/foomatic-db/printer/Xerox-Phaser_6110.xml
@@ -1,4 +1,4 @@
-<printer id="printer/Xerox-Phaser-6110">
+<printer id="printer/Xerox-Phaser_6110">
<make>Xerox</make>
<model>Phaser 6110</model>
<mechanism>
@@ -48,6 +48,9 @@
<model>Phaser 6110</model>
<commandset>SPLC</commandset>
</parallel>
+ <snmp>
+ <description>Xerox Phaser 6110</description>
+ </snmp>
</autodetect>
<functionality>B</functionality>
<driver>foo2qpdl</driver>
diff --git a/foomatic-db/printer/Xerox-Phaser-6115MFP.xml b/foomatic-db/printer/Xerox-Phaser_6115MFP.xml
index e69d3f2..5972063 100644
--- a/foomatic-db/printer/Xerox-Phaser-6115MFP.xml
+++ b/foomatic-db/printer/Xerox-Phaser_6115MFP.xml
@@ -1,4 +1,4 @@
-<printer id="printer/Xerox-Phaser-6115MFP">
+<printer id="printer/Xerox-Phaser_6115MFP">
<make>Xerox</make>
<model>Phaser 6115MFP</model>
<mechanism>
diff --git a/getweb.in b/getweb.in
index ca4e812..611caff 100755
--- a/getweb.in
+++ b/getweb.in
@@ -1,9 +1,21 @@
#!/bin/sh
-WGETOPTS=--passive-ftp
+#
+# (c) Copyright Rick Richardson 2008
+#
+
+#
+# PLEASE don't remove the copyright statements. They should
+# be displayed to the human that is running this.
+#
+
+VERSION='$Id: getweb.in,v 1.82 2008/12/31 07:14:19 rick Exp $'
+
+WGETOPTS="--passive-ftp -q"
usage() {
cat <<EOF
+
Usage:
./getweb something
@@ -12,6 +24,8 @@ Usage:
$ ./getweb 2600n # Get HP Color LaserJet 2600n .ICM files
$ ./getweb 1600 # Get HP Color LaserJet 1600 .ICM files
+ $ ./getweb 1500 # Get HP Color LaserJet 1500 .ICM files
+ $ ./getweb 1215 # Get HP Color LaserJet CP1215 .ICM files
$ ./getweb 2530 # Get Konica Minolta 2530 DL .ICM files
$ ./getweb 2490 # Get Konica Minolta 2490 MF .ICM files
@@ -24,14 +38,37 @@ Usage:
$ ./getweb cpwl # Get Minolta Color PageWorks/Pro L .ICM files
$ ./getweb 300 # Get Samsung CLP-300 .ICM files
+ $ ./getweb 315 # Get Samsung CLP-315 .ICM files
$ ./getweb 600 # Get Samsung CLP-600 .ICM files
+ $ ./getweb 610 # Get Samsung CLP-610 .ICM files
+ $ ./getweb 2160 # Get Samsung CLX-2160 .ICM files
$ ./getweb 3160 # Get Samsung CLX-3160 .ICM files
+ $ ./getweb 3175 # Get Samsung CLX-3175 .ICM files
$ ./getweb 6110 # Get Xerox Phaser 6110 and 6110MFP .ICM files
- $ ./getweb 1020 # Get HP LJ1020 firmware file
- $ ./getweb 1018 # Get HP LJ1005 firmware file
- $ ./getweb 1005 # Get HP LJ1005 firmware file
- $ ./getweb 1000 # Get HP LJ1000 firmware file
+ $ ./getweb 500 # Get Lexmark C500 .ICM files
+
+ $ ./getweb 3100 # Get Oki C3100 .ICM files
+ $ ./getweb 3200 # Get Oki C3200 .ICM files
+ $ ./getweb 3300 # Get Oki C3300 .ICM files
+ $ ./getweb 3400 # Get Oki C3400 .ICM files
+ $ ./getweb 3530 # Get Oki C3530 MFP .ICM files
+ $ ./getweb 5100 # Get Oki C5100 / C5150n .ICM files
+ $ ./getweb 5200 # Get Oki C5200 .ICM files
+ $ ./getweb 5500 # Get Oki C5500 .ICM files
+ $ ./getweb 5600 # Get Oki C5600 .ICM files
+ $ ./getweb 5800 # Get Oki C5800 .ICM files
+
+ $ ./getweb 1020 # Get HP LJ 1020 firmware file
+ $ ./getweb 1018 # Get HP LJ 1005 firmware file
+ $ ./getweb 1005 # Get HP LJ 1005 firmware file
+ $ ./getweb 1000 # Get HP LJ 1000 firmware file
+
+ $ ./getweb p1505 # Get HP LJ P1505 firmware file
+ $ ./getweb p1008 # Get HP LJ P1008 firmware file
+ $ ./getweb p1007 # Get HP LJ P1007 firmware file
+ $ ./getweb p1006 # Get HP LJ P1006 firmware file
+ $ ./getweb p1005 # Get HP LJ P1005 firmware file
$ ./getweb all # Get everything above
@@ -51,8 +88,8 @@ error() {
exit 1
}
-SYSTEM=$(uname -s)
-WGET=$(type wget 2>/dev/null)
+SYSTEM=`uname -s`
+WGET=`type wget 2>/dev/null`
if [ "$SYSTEM" = Darwin -a "$WGET" = "" ]
then
WGETOPTS=
@@ -68,11 +105,11 @@ fi
getexe() {
url="$1"
exefile="$2"
- what="$3"
+ shift; shift
wget $WGETOPTS -O $exefile "$url/$exefile" ||
error "Couldn't download $url/$exefile"
- unzip -o $exefile "$what"
+ unzip -oj $exefile "$@"
rm $exefile
}
@@ -90,50 +127,80 @@ gettgz() {
rm $file
}
+copyright() {
+ echo
+ echo "$1"
+ echo
+}
+
getone() {
case "$1" in
lj1000|1000)
gettgz \
- http://foo2zjs.rkkda.com sihp1000.tar.gz \
+ http://foo2zjs.rkkda.com/firmware sihp1000.tar.gz \
""
#echo "provided"
#getexe \
#ftp://ftp.hp.com/pub/softlib/software1/lj1488/lj-1145-2 \
#lj1488en.exe \
#sihp1000.img
+ copyright "(c) Copyright Hewlett-Packard 2001"
;;
lj1005|1005)
gettgz \
- http://foo2zjs.rkkda.com sihp1005.tar.gz \
+ http://foo2zjs.rkkda.com/firmware sihp1005.tar.gz \
""
#echo "provided"
#getexe \
#ftp://ftp.hp.com/pub/softlib/software2/COL2222/lj-10067-2 \
#lj1005hostbased-en.exe \
#sihp1005.img
+ copyright "(c) Copyright Hewlett-Packard 2002"
;;
lj1018|1018)
gettgz \
- http://foo2zjs.rkkda.com sihp1018.tar.gz \
+ http://foo2zjs.rkkda.com/firmware sihp1018.tar.gz \
""
+ copyright "(c) Copyright Hewlett-Packard 2005"
;;
lj1020|1020)
gettgz \
- http://foo2zjs.rkkda.com sihp1020.tar.gz \
+ http://foo2zjs.rkkda.com/firmware sihp1020.tar.gz \
+ ""
+ copyright "(c) Copyright Hewlett-Packard 2005"
+ ;;
+ [pP]100[57])
+ gettgz \
+ http://foo2zjs.rkkda.com/firmware sihpP1005.tar.gz \
+ ""
+ copyright "(c) Copyright Hewlett-Packard 2008"
+ ;;
+ [pP]100[68])
+ gettgz \
+ http://foo2zjs.rkkda.com/firmware sihpP1006.tar.gz \
""
+ copyright "(c) Copyright Hewlett-Packard 2008"
+ ;;
+ [pP]1505)
+ gettgz \
+ http://foo2zjs.rkkda.com/firmware sihpP1505.tar.gz \
+ ""
+ copyright "(c) Copyright Hewlett-Packard 2008"
;;
2200dl|2200)
getexe \
ftp://ftp.minolta-qms.com/pub/crc/out_going/win2000 m22dlicc.exe \
"*.icm"
+ copyright "(c) Copyright Minolta-QMS 1999"
;;
2300dl|2300)
getexe \
- ftp://ftp.minolta-qms.com/pub/crc/out_going/win m23dlicc.exe \
+ ftp://ftp.minolta-qms.com/pub/crc/out_going/other m23dlicc.exe \
"*.icm"
gettgz \
- http://foo2zjs.rkkda.com km2430.tar.gz \
+ http://foo2zjs.rkkda.com/icm km2430.tar.gz \
""
+ copyright "(c) Copyright Minolta-QMS 2001"
;;
2300dl_fw)
# 2300DL firmware upgrade to v2.55
@@ -145,41 +212,98 @@ getone() {
echo "*** Now use a windows box to unzip and install $FILE ***"
;;
cpwl|pageworks)
- getexe \
- ftp://ftp.minolta-qms.com/pub/crc/out_going/windows cpplxp.exe \
- "*.IC_"
- for i in C*.IC_
- do
- base=`basename $i .IC_`
- mv $base.IC_ $base.ic_
- ./msexpand $base.ic_
- rm -f $base.ic_
- done
+ if true; then
+ getexe \
+ ftp://ftp.minolta-qms.com/pub/crc/out_going/windows cpplxp.exe \
+ "*.IC_"
+ for i in C*.IC_
+ do
+ base=`basename $i .IC_`
+ mv $base.IC_ $base.ic_
+ ./msexpand $base.ic_
+ rm -f $base.ic_
+ done
+ copyright "(c) Copyright Minolta-QMS 1998"
+ fi
;;
2430)
gettgz \
- http://foo2zjs.rkkda.com km2430.tar.gz \
+ http://foo2zjs.rkkda.com/icm km2430.tar.gz \
""
+ copyright "(c) Copyright Konica Minolta 2003"
;;
2530|2490|6115|2480)
gettgz \
- http://foo2lava.rkkda.com km2530.tar.gz \
+ http://foo2lava.rkkda.com/icm km2530.tar.gz \
""
+ copyright "(c) Copyright Konica Minolta 2005"
+ copyright "(c) Copyright Rick Richardson 2007. All Rights Reserved"
;;
- 1600|2600n)
+ 1215|1500|1600|2600*)
gettgz \
- http://foo2hp.rkkda.com hpclj2600n.tar.gz \
+ http://foo2hp.rkkda.com/icm hpclj2600n.tar.gz \
""
gettgz \
- http://foo2zjs.rkkda.com km2430.tar.gz \
+ http://foo2zjs.rkkda.com/icm km2430.tar.gz \
"km2430_2.icm"
+ copyright "(c) Copyright Hewlett-Packard 2003"
+ copyright "(c) Copyright Rick Richardson 2006. All Rights Reserved"
+ gettgz \
+ http://foo2hp.rkkda.com/icm hp1215.tar.gz \
+ ""
+ copyright "(c) Copyright Rick Richardson 2008. All Rights Reserved"
;;
- 300|3160|6110)
+ 300|315|2160|3160|3175|6110)
gettgz \
- http://foo2qpdl.rkkda.com samclp300.tar.gz \
+ http://foo2qpdl.rkkda.com/icm samclp300.tar.gz \
""
+ copyright "(c) Copyright Rick Richardson 2007. All Rights Reserved"
+ gettgz \
+ http://foo2qpdl.rkkda.com/icm samclp315.tar.gz \
+ ""
+ copyright "(c) Copyright Rick Richardson 2008. All Rights Reserved"
;;
- 600)
+ 600|610)
+ ;;
+
+ 500)
+ gettgz \
+ http://foo2slx.rkkda.com/icm lexc500.tar.gz \
+ ""
+ copyright "(c) Copyright Lexmark 2006"
+ ;;
+
+ oki)
+ echo "Please wait, ~20MB is being downloaded from a slow site..."
+ getexe \
+ http://www.okiprintingsolutions.at/binaryData/16516/ \
+ ICCProfiles.zip \
+ "*OK3200*ICM" "*OK5600*ICM" "*rom732*7.zip"
+ unzip -oj *rom732*7.zip "*C3400*ICM"
+ rm -f *rom732*7.zip
+ for i in OK*ICM C3400*ICM; do
+ base=`basename $i .ICM`
+ mv "$base.ICM" "$base.icm"
+ done
+ copyright "(c) Copyright Okidata 2005, 2006"
+ ;;
+ 3100|3200|5100|5150|5200|5250)
+ gettgz \
+ http://foo2hiperc.rkkda.com/icm okic3200.tar.gz \
+ ""
+ copyright "(c) Copyright Okidata 2005"
+ ;;
+ 3300|3400|3530)
+ gettgz \
+ http://foo2hiperc.rkkda.com/icm okic3400.tar.gz \
+ ""
+ copyright "(c) Copyright Okidata 2006"
+ ;;
+ 5500|5600|5800)
+ gettgz \
+ http://foo2hiperc.rkkda.com/icm okic5600.tar.gz \
+ ""
+ copyright "(c) Copyright Okidata 2006"
;;
xPPD)
@@ -212,17 +336,25 @@ getone() {
printer=`basename $i .xml`
echo $printer
case "$printer" in
- *M1005*) driver=foo2xqx;;
+ *M1005*|*M1120*) driver=foo2xqx;;
+ *P1[05]0[56]*) driver=foo2xqx;;
+ *P2014*) driver=foo2xqx;;
*1500*|*OAKT*) driver=foo2oak;;
*1600*|*2600*) driver=foo2hp;;
+ *1215*) driver=foo2hp;;
*2530*|*24[89]0*) driver=foo2lava;;
*6115*) driver=foo2lava;;
+ *C500*) driver=foo2slx;;
+ *C3[234]00*) driver=foo2hiperc;;
+ *C5[12568]00*) driver=foo2hiperc;;
*CLP*|*CLX*|*6110*) driver=foo2qpdl;;
*) driver=foo2zjs;;
esac
ENGINE=../foomatic/foomatic-db-engine
PERL5LIB=$ENGINE/lib $ENGINE/foomatic-ppdfile \
- -d $driver -p $printer > PPD/$printer.ppd
+ -d $driver -p $printer \
+ > PPD/$printer.ppd
+ # | sed -e 's/\(^\*NickName.*\)"/\1 (foo2zjs recommended)"/'
done
;;
update)
@@ -252,6 +384,7 @@ getone() {
}
if [ $# = 0 ]; then
+ echo "$VERSION"
usage
fi
@@ -264,18 +397,29 @@ do
getone 1018
getone 1020
+ getone p1005
+ getone p1006
+ getone p1505
+
getone 2200
getone 2300
# getone 2430 already done
- getone cpwl
+ # getone cpwl # file doesn't exist 1/28/08
getone 2600n
+ # getone 1215 # already done
getone 2530
getone 300
# getone 6110 already done
getone 600
+
+ getone 500
+
+ getone 3200
+ getone 3400
+ getone 5600
;;
*)
getone $i
diff --git a/gipddecode.c b/gipddecode.c
new file mode 100644
index 0000000..7cb4762
--- /dev/null
+++ b/gipddecode.c
@@ -0,0 +1,843 @@
+/*
+ * $Id: gipddecode.c,v 1.26 2008/09/23 23:30:35 rick Exp $
+ */
+
+/*b
+ * Copyright (C) 2003-2006 Rick Richardson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Rick Richardson <rick.richardson@comcast.net>
+b*/
+
+/*
+ * Dell 1125 MFP
+ * Lexmark X500
+ *
+ * Granite Systems, inc. a.k.a Monotype Imaging
+ * Granite Image Printer Driver (gipddecode)
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "slx.h"
+#include "jbig.h"
+
+/*
+ * Global option flags
+ */
+int Debug = 0;
+char *RawFile;
+char *DecFile;
+int PrintOffset = 0;
+int PrintHexOffset = 0;
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+int
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, fatal ? "Error: " : "Warning: ");
+ if (errno)
+ fprintf(stderr, "%s: ", strerror(errno));
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ if (fatal > 0)
+ exit(fatal);
+ else
+ {
+ errno = 0;
+ return (fatal);
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" gdidecode [options] < zjs-file\n"
+"\n"
+" Decode a GDI stream into human readable form.\n"
+"\n"
+" A GDI stream is the printer langauge used by some Lexmark\n"
+" printers, such as the X500.\n"
+"\n"
+" More information on GDI Stream can be found at:\n"
+"\n"
+" http://softwareimaging.com/products-services/sorcerer/index.asp\n"
+"\n"
+"Options:\n"
+" -d basename Basename of .pbm file for saving decompressed planes\n"
+" -r basename Basename of .jbg file for saving raw planes\n"
+" -o Print file offsets\n"
+" -h Print hex file offsets\n"
+" -D lvl Set Debug level [%d]\n"
+ , Debug
+ );
+
+ exit(1);
+}
+
+void
+print_bih(unsigned char bih[20])
+{
+ unsigned int xd, yd, l0;
+
+ xd = (bih[4] << 24) | (bih[5] << 16) | (bih[6] << 8) | (bih[7] << 0);
+ yd = (bih[8] << 24) | (bih[9] << 16) | (bih[10] << 8) | (bih[11] << 0);
+ l0 = (bih[12] << 24) | (bih[13] << 16) | (bih[14] << 8) | (bih[15] << 0);
+
+ printf(" DL = %d, D = %d, P = %d, - = %d, XY = %d x %d\n",
+ bih[0], bih[1], bih[2], bih[3], xd, yd);
+
+ printf(" L0 = %d, MX = %d, MY = %d\n",
+ l0, bih[16], bih[17]);
+
+ printf(" Order = %d %s%s%s%s%s\n", bih[18],
+ bih[18] & JBG_HITOLO ? " HITOLO" : "",
+ bih[18] & JBG_SEQ ? " SEQ" : "",
+ bih[18] & JBG_ILEAVE ? " ILEAVE" : "",
+ bih[18] & JBG_SMID ? " SMID" : "",
+ bih[18] & 0xf0 ? " other" : "");
+
+ printf(" Options = %d %s%s%s%s%s%s%s%s\n", bih[19],
+ bih[19] & JBG_LRLTWO ? " LRLTWO" : "",
+ bih[19] & JBG_VLENGTH ? " VLENGTH" : "",
+ bih[19] & JBG_TPDON ? " TPDON" : "",
+ bih[19] & JBG_TPBON ? " TPBON" : "",
+ bih[19] & JBG_DPON ? " DPON" : "",
+ bih[19] & JBG_DPPRIV ? " DPPRIV" : "",
+ bih[19] & JBG_DPLAST ? " DPLAST" : "",
+ bih[19] & 0x80 ? " other" : "");
+ printf(" %u stripes, %d layers, %d planes\n",
+ ((yd >> bih[1]) + ((((1UL << bih[1]) - 1) & xd) != 0) + l0 - 1) / l0,
+ bih[1] - bih[0], bih[2]);
+}
+
+typedef struct
+{
+ char data[128-4];
+ char magic[4];
+} OFST;
+typedef struct
+{
+ char magic[4];
+ int len;
+ int len2;
+} GDI;
+
+void
+decode(FILE *fp)
+{
+ DWORD magic;
+ SL_HEADER hdr;
+ int c;
+ int rc;
+ int size;
+ int items;
+ char *codestr;
+ FILE *dfp = NULL;
+ FILE *rfp = NULL;
+ int pageNum = 0;
+ int padding;
+ int len;
+ int curOff = 0;
+ struct jbg_dec_state s[5];
+ unsigned char bih[20];
+ //DWORD bih[5];
+ int bihlen = 0;
+ int imageCnt[5] = {0,0,0,0,0};
+ int pn = 0;
+ int incrY = 0;
+ int totSize = 0;
+ OFST ofst;
+ GDI gdi;
+ DWORD dbuf[256];
+ int ocnt = 0;
+ int bcnt = 0;
+ int ver;
+ int i;
+
+ for (;;)
+ {
+ rc = fread(&ofst, sizeof(ofst), 1, fp);
+ if (rc != 1)
+ error(1, "aaa\n");
+ if (memcmp(ofst.magic, "OFST", 4) != 0)
+ {
+ error(1, "magic %s\n", ofst.magic);
+ exit(1);
+ }
+ else
+ {
+ if (ocnt < 5 || ocnt >= 1275)
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ printf("OFST %d len=%d\n", ocnt, (int) sizeof(ofst));
+ }
+ else if (ocnt == 5)
+ printf("\t[SNIP]\n");
+ ++ocnt;
+ }
+ curOff += sizeof(ofst);
+ c = getc(fp);
+ ungetc(c, fp);
+ if (c == 'G')
+ break;
+ if (c == '\033')
+ break;
+ //debug(0, "got\n");
+ }
+
+ totSize = curOff;
+
+ /*
+ * Zenographics ZX format
+ */
+ c = getc(fp);
+ if (c == EOF)
+ {
+ printf("EOF on file reading header.\n");
+ return;
+ }
+ ungetc(c, fp);
+ if (c == '\033')
+ {
+ char buf[1024];
+
+ while (fgets(buf, sizeof(buf), fp))
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ if (buf[0] == '\033')
+ {
+ printf("\\033");
+ fputs(buf+1, stdout);
+ }
+ else
+ fputs(buf, stdout);
+ curOff += strlen(buf);
+ if (strcmp(buf, "@PJL SET REVERSEPRINT=OFF\r\n") == 0)
+ break;
+ }
+ if (feof(fp))
+ {
+ printf("\n");
+ return;
+ }
+ }
+
+ c = getc(fp);
+ ungetc(c, fp);
+ ver = 0; //Dell
+ if (c == '\033')
+ {
+ rc = fread(&ofst, 9, 1, fp); // %-12345X
+ ver = 1; //Lexmark
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ printf("\\033%-8.8s\n", ofst.data+1);
+ curOff += 9;
+ }
+ for (;;)
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ rc = fread(&gdi, sizeof(gdi), 1, fp); // %-12345X
+ curOff += sizeof(gdi);
+ if (memcmp(gdi.magic, "JIDG", 4) == 0)
+ {
+ printf("%-4.4s\n", gdi.magic);
+ printf("Total Size = %d (0x%x)\n",
+ curOff - totSize, curOff - totSize);
+ return;
+ }
+ if (memcmp(gdi.magic, "PIDG", 4) == 0)
+ {
+ printf("%-4.4s\n", gdi.magic);
+ continue;
+ }
+ if (memcmp(gdi.magic, "GDI", 3) != 0)
+ error(1, "Missing GDIJ (%-4.4s)\n", gdi.magic);
+ if (gdi.magic[3] == 'B')
+ {
+ if (ver == 0)
+ gdi.len = 0x20 + be32(gdi.len2);
+ else
+ gdi.len = 0xBC + be32(gdi.len2);
+ }
+ else
+ gdi.len = be32(gdi.len);
+ // debug(0, "%.4s len=%d\n", gdi.magic, gdi.len);
+ gdi.len -= sizeof(gdi);
+ switch (gdi.magic[3])
+ {
+ case 'J':
+ printf("%.4s len=%d\n", gdi.magic, gdi.len);
+ bcnt = 0;
+ {
+ int unk0, unk1, unk2, unk3, unk4;
+ int unk5, unk6, unk7, unk8;
+ int paper;
+ int i;
+
+ rc = fread(&dbuf, gdi.len, 1, fp);
+ curOff += gdi.len;
+
+ unk0 = be32(dbuf[0]);
+ unk1 = be32(dbuf[1]);
+ unk2 = be32(dbuf[2]);
+ unk3 = be32(dbuf[3]);
+ unk4 = be32(dbuf[4]);
+ unk5 = be32(dbuf[5]);
+ unk6 = be32(dbuf[6]);
+ unk7 = be32(dbuf[7]);
+ unk8 = be32(dbuf[8]);
+ paper = be32(dbuf[9]);
+ printf("\tunk0=%d, unk1=%d, unk2=%d, unk3=%d, unk4=%d\n",
+ unk0, unk1, unk2, unk3, unk4);
+ printf("\tunk5=%d(0x%x), unk6=%d, unk7=%d, unk8=%d, paper=%d\n",
+ unk5, unk5, unk6, unk7, unk8, paper);
+ gdi.len -= 4*10;
+ printf("\t");
+ for (i = 0; i < gdi.len; i += 4)
+ printf("%d, ", dbuf[10+i/4]);
+ printf("\n");
+ gdi.len = 0;
+ }
+ curOff += gdi.len;
+ //printf("cr=%x\n", curOff);
+ while (gdi.len--)
+ getc(fp);
+ break;
+ case 'P':
+ printf("%.4s len=%d\n", gdi.magic, gdi.len);
+ bcnt = 0;
+ {
+ int w254;
+ int h254;
+ int nplane;
+ int i;
+ char *buf = (char *) dbuf;
+
+ rc = fread(&dbuf, gdi.len, 1, fp);
+ curOff += gdi.len;
+
+ w254 = (buf[0] << 8) + buf[1];
+ h254 = (buf[2] << 8) + buf[3];
+ nplane = buf[5*4];
+ printf("\tnplane = %d, w254 = %d, h254 = %d\n",
+ nplane, w254, h254);
+
+ printf("\t");
+ for (i = 0; i < gdi.len; i += 4)
+ printf("%x, ", be32(dbuf[i/4]));
+ printf("\n");
+ gdi.len = 0;
+ }
+ curOff += gdi.len;
+ //printf("cr=%x\n", curOff);
+ while (gdi.len--)
+ getc(fp);
+ break;
+ case 'B':
+ //printf("cr=%x\n", curOff);
+ rc = fread(&dbuf, 3*4, 1, fp);
+ curOff += 3*4;
+ //debug(0, "%x\n", be32(gdi.len2));
+ //debug(0, "%x\n", be32(dbuf[0]));
+ //debug(0, "%x\n", be32(dbuf[1]));
+ //debug(0, "%x\n", be32(dbuf[2]));
+ gdi.len = 0x14 + be32(gdi.len2) + be32(dbuf[0])
+ + be32(dbuf[1]) + be32(dbuf[2]);
+ gdi.len -= sizeof(gdi);
+
+ printf("%.4s %2d len=%d (0x%x)\n",
+ gdi.magic, bcnt++, gdi.len, gdi.len);
+ //print_bih((unsigned char *)(dbuf+3));
+ if (0) {
+ int i;
+
+ rc = fread(&dbuf, gdi.len, 1, fp);
+ printf("\t0x%x\n", be32(dbuf[0]));
+ printf("\t");
+ for (i = 0; i < 4; i += 4)
+ printf("%d, ", be32(dbuf[i/4]));
+ printf("\n");
+ // gdi.len = 0;
+ }
+ curOff += gdi.len;
+ //printf("cr=%x\n", curOff);
+ i = 0;
+ if (Debug > 0)
+ printf("\t");
+ while (gdi.len--)
+ {
+ c = getc(fp);
+ if (Debug > 0 && i++ < 48)
+ {
+ printf("%02x, ", c);
+ if (i < 48 && (i % 16) == 0)
+ printf("\n\t");
+ }
+ }
+ if (Debug > 0)
+ printf("\n");
+ break;
+ default:
+ error(1, "unknown type '%c'\n", gdi.magic[3]);
+ break;
+ }
+ }
+
+ /*
+ * Software Imaging K.K. SLX_MAGIC format
+ */
+ rc = fread(&magic, len = sizeof(magic), 1, fp);
+ if (rc != 1)
+ {
+ printf("Missing SLX Magic number\n");
+ return;
+ }
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ printf("SLX_MAGIC, 0x%lx (%.4s)\n", (long)magic, (char *) &magic);
+
+ if (memcmp((char *) &magic, "\245SLX", 4) &&
+ memcmp((char *) &magic, "XLS\245", 4))
+ {
+ printf(" Don't understand magic number 0x%lx\n", (long)magic);
+ return;
+ }
+
+ curOff += len;
+ for (;;)
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+
+ rc = fread(&hdr, len = sizeof(hdr), 1, fp);
+ if (rc != 1) break;
+ curOff += len;
+
+ hdr.type = be32(hdr.type);
+ hdr.size = be32(hdr.size);
+ hdr.items = be32(hdr.items);
+ hdr.reserved = be16(hdr.reserved);
+ hdr.signature = be16(hdr.signature);
+
+ #define CODESTR(X) case X: codestr = #X;
+ switch (hdr.type)
+ {
+ CODESTR(SLT_START_DOC) break;
+ CODESTR(SLT_END_DOC) break;
+ CODESTR(SLT_START_PAGE) ++pageNum;
+ memset(imageCnt, 0, sizeof(imageCnt));
+ totSize = 0;
+ break;
+ CODESTR(SLT_END_PAGE) pn = 0;
+ break;
+ CODESTR(SLT_JBIG_BIH) break;
+ CODESTR(SLT_JBIG_BID) break;
+ CODESTR(SLT_END_JBIG) break;
+ CODESTR(SLT_SIGNATURE) break;
+ CODESTR(SLT_RAW_IMAGE) break;
+ CODESTR(SLT_START_PLANE) break;
+ CODESTR(SLT_END_PLANE) break;
+ CODESTR(SLT_2600N_PAUSE) break;
+ CODESTR(SLT_2600N) break;
+ default: codestr = NULL; break;
+ }
+
+ if (codestr)
+ printf("%s, %ld items", codestr, (long) hdr.items);
+ else
+ printf("SLT_0x%lx, %ld items", (long) hdr.type, (long) hdr.items);
+ if (hdr.size & 3)
+ {
+ printf(" (unaligned size)");
+ padding = 4 - (hdr.size & 3);
+ }
+ else
+ padding = 0;
+ if (hdr.reserved)
+ printf(" (reserved=0x%x)", hdr.reserved);
+ if (hdr.signature != 0xa5a5)
+ printf(" (funny siggy 0x%x)", hdr.signature);
+ if (hdr.type == SLT_START_PAGE)
+ printf(" [Page %d]", pageNum);
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ switch (++pn)
+ {
+ case 1: printf(" [black]"); break;
+ case 2: printf(" [cyan]"); break;
+ case 3: printf(" [magenta]"); break;
+ case 4: printf(" [yellow]"); break;
+ }
+ }
+ printf("\n");
+ fflush(stdout);
+
+ items = hdr.items;
+ size = hdr.size - sizeof(hdr);
+
+ while (items--)
+ {
+ SL_ITEM_HEADER ihdr;
+ int isize;
+ DWORD val;
+ char buf[512];
+ int i, c;
+
+ if (PrintOffset)
+ printf(" %d: ", curOff);
+ else if (PrintHexOffset)
+ printf(" %6x: ", curOff);
+
+ size -= sizeof(ihdr);
+
+ rc = fread(&ihdr, len = sizeof(ihdr), 1, fp);
+ if (rc != 1) break;
+ curOff += len;
+
+ ihdr.size = be32(ihdr.size);
+ ihdr.item = be16(ihdr.item);
+
+ isize = ihdr.size - sizeof(ihdr);
+ size -= isize;
+
+ switch (ihdr.item)
+ {
+ CODESTR(SLI_PAGECOUNT) break;
+ CODESTR(SLI_DMCOLLATE) break;
+ CODESTR(SLI_DMDUPLEX) break;
+ CODESTR(SLI_DISPLAY) break;
+ CODESTR(SLI_DISPLAY_PC) break;
+ CODESTR(SLI_PRINT_SLOWLY) break;
+ CODESTR(SLI_REMOVE_SLEEP_MODE) break;
+ CODESTR(SLI_USE_SEP_SHEETS) break;
+ CODESTR(SLI_COUNT) break;
+
+ CODESTR(SLI_DMPAPER) break;
+ CODESTR(SLI_DMCOPIES) break;
+ CODESTR(SLI_DMDEFAULTSOURCE) break;
+ CODESTR(SLI_DMMEDIATYPE) break;
+ CODESTR(SLI_NBIE) break;
+ CODESTR(SLI_RESOLUTION_X) break;
+ CODESTR(SLI_RESOLUTION_Y) break;
+ CODESTR(SLI_OFFSET_X) break;
+ CODESTR(SLI_OFFSET_Y) break;
+ CODESTR(SLI_RASTER_X) break;
+ CODESTR(SLI_RASTER_Y) break;
+ CODESTR(SLI_CUSTOM_X) break;
+ CODESTR(SLI_CUSTOM_Y) break;
+ CODESTR(SLI_VIDEO_X) break;
+ CODESTR(SLI_VIDEO_Y) break;
+ default: codestr = NULL; break;
+ }
+
+ switch (ihdr.type)
+ {
+ case SLIT_UINT32:
+ fread(&val, len = sizeof(val), 1, fp);
+ curOff += len;
+ val = be32(val);
+ isize -= 4;
+ if (codestr)
+ printf(" %s, %ld (0x%lx) %s",
+ codestr, (long) val, (long) val,
+ ihdr.type == SLIT_INT32 ? "(int)" : "");
+ else
+ printf(" SLI_0x%x, %ld (0x%lx) %s",
+ ihdr.item, (long) val, (long) val,
+ ihdr.type == SLIT_INT32 ? "(int)" : "");
+ if (ihdr.item == SLI_NBIE)
+ ; // pn = (val & 7);
+ break;
+ case SLIT_INT32:
+ case SLIT_STRING:
+ for (i = 0; i < sizeof(buf) - 1; )
+ {
+ c = fgetc(fp);
+ if (c == EOF) break;
+ ++curOff;
+ buf[i++] = c;
+ --isize;
+ if (isize == 0 || c == 0) break;
+ }
+ buf[i] = 0;
+ if (codestr)
+ printf(" %s, '%s'", codestr, buf);
+ else
+ printf(" SLI_0x%x, '%s'", ihdr.item, buf);
+ break;
+ default:
+ case SLIT_BYTELUT:
+ fread(&val, len = sizeof(val), 1, fp);
+ curOff += len;
+ val = be32(val);
+ isize -= 4;
+ if (codestr)
+ printf(" %s, BYTELUT (len=%d)", codestr, val);
+ else
+ printf(" SLI_0x%x, BYTELUT (len=%d)", ihdr.item, val);
+ if (0) // ihdr.item == SLI_JBIG_BIH && val == 20)
+ {
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
+ if (bihlen <= 0)
+ isize = 0;
+ else
+ {
+ isize -= bihlen;
+ curOff += len;
+ }
+ if (bihlen == 20)
+ {
+ printf("\n");
+ print_bih(bih);
+ }
+ }
+ break;
+ }
+
+ if (ihdr.param != 0)
+ printf(" (reserved=0x%x)", ihdr.param);
+ printf("\n");
+ fflush(stdout);
+
+ while (isize-- > 0)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+
+ if (size <= 0 && items)
+ {
+ printf(" #items is wrong!\n");
+ break;
+ }
+ }
+
+ if (size)
+ {
+ if (PrintOffset)
+ printf(" %d:", curOff);
+ else if (PrintHexOffset)
+ printf(" %6x:", curOff);
+ printf(" Data: %d bytes\n", size);
+ fflush(stdout);
+ totSize += size;
+
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
+ if (bihlen <= 0)
+ size = 0;
+ else
+ {
+ size -= bihlen;
+ curOff += len;
+ }
+ if (bihlen == 20)
+ print_bih(bih);
+ }
+
+ if ( (RawFile || DecFile) &&
+ (hdr.type == SLT_JBIG_BIH || hdr.type == SLT_JBIG_BID
+ || hdr.type == SLT_2600N) )
+ {
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ if (RawFile)
+ {
+ char buf[512];
+ sprintf(buf, "%s-%02d-%d.jbg",
+ RawFile, pageNum, pn);
+ rfp = fopen(buf, "w");
+ }
+ if (rfp)
+ fwrite(bih, bihlen, 1, rfp);
+ if (DecFile)
+ {
+ size_t cnt;
+
+ // debug(1, "pn = %d\n", pn);
+ imageCnt[pn] = 0;
+ jbg_dec_init(&s[pn]);
+ rc = jbg_dec_in(&s[pn], bih, bihlen, &cnt);
+ if (rc == JBG_EIMPL)
+ error(1, "JBIG uses unimplemented feature\n");
+ }
+ }
+ while (size--)
+ {
+ int c;
+ c = fgetc(fp);
+ ++curOff;
+ if (rfp)
+ fputc(c, rfp);
+ if (DecFile)
+ {
+ size_t cnt;
+ unsigned char ch = c;
+
+ rc = JBG_EAGAIN;
+ rc = jbg_dec_in(&s[pn], &ch, 1, &cnt);
+ if (rc == JBG_EOK)
+ {
+ int h, w, len;
+ unsigned char *image;
+
+ // debug(1, "JBG_EOK: %d\n", pn);
+ h = jbg_dec_getheight(&s[pn]);
+ w = jbg_dec_getwidth(&s[pn]);
+ image = jbg_dec_getimage(&s[pn], 0);
+ len = jbg_dec_getsize(&s[pn]);
+ if (image)
+ {
+ char buf[512];
+ sprintf(buf, "%s-%02d-%d.pbm",
+ DecFile, pageNum, pn);
+ dfp = fopen(buf,
+ imageCnt[pn] ? "a" : "w");
+ if (dfp)
+ {
+ if (imageCnt[pn] == 0)
+ fprintf(dfp, "P4\n%8d %8d\n", w, h);
+ imageCnt[pn] += incrY;
+ fwrite(image, 1, len, dfp);
+ fclose(dfp);
+ }
+ }
+ else
+ debug(0, "Missing image %dx%d!\n", h, w);
+ jbg_dec_free(&s[pn]);
+ }
+ }
+ }
+ }
+ else
+ {
+ while (size--)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+ if (rfp)
+ {
+ fclose(rfp);
+ rfp = NULL;
+ }
+ }
+ }
+
+ while (padding--)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+
+ if (hdr.type == SLT_END_DOC)
+ break;
+ }
+ if (rfp)
+ fclose(rfp);
+ printf("Total size: %d bytes\n", totSize);
+}
+
+int
+main(int argc, char *argv[])
+{
+ extern int optind;
+ extern char *optarg;
+ int c;
+
+ while ( (c = getopt(argc, argv, "d:hor:D:?h")) != EOF)
+ switch (c)
+ {
+ case 'd': DecFile = optarg; break;
+ case 'r': RawFile = optarg; break;
+ case 'o': PrintOffset = 1; break;
+ case 'h': PrintHexOffset = 1; break;
+ case 'D': Debug = atoi(optarg); break;
+ default: usage(); exit(1);
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ for (;;)
+ {
+ decode(fp);
+ c = getc(fp); ungetc(c, fp);
+ if (feof(fp))
+ break;
+ }
+ fclose(fp);
+ }
+ else
+ {
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
+ }
+
+ exit(0);
+}
diff --git a/hiperc.h b/hiperc.h
new file mode 100644
index 0000000..208d00c
--- /dev/null
+++ b/hiperc.h
@@ -0,0 +1,171 @@
+/*
+ * Manifest constants for the HIPERC protocol
+ */
+
+#include <inttypes.h>
+typedef uint32_t DWORD;
+typedef uint16_t WORD;
+typedef uint8_t BYTE;
+
+typedef enum {
+ HIPERC_START_PAGE = 0,
+ HIPERC_DATA = 1,
+ HIPERC_END_PAGE = 255,
+} HIPERC_RECTYPE;
+
+typedef enum
+{
+ DMDUPLEX_OFF = 1,
+ DMDUPLEX_LONGEDGE = 2,
+ DMDUPLEX_SHORTEDGE = 3,
+ DMDUPLEX_MANUALLONG = 4,
+ DMDUPLEX_MANUALSHORT= 5
+} DMDUPLEX;
+
+typedef enum {
+ DMBIN_AUTO = 0,
+ DMBIN_TRAY1 = 1,
+ DMBIN_TRAY2 = 2,
+ DMBIN_MULTI = 3,
+ DMBIN_MANUAL = 4,
+} DM_BIN;
+
+typedef enum {
+ DMMEDIA_PLAIN = 0, // Plain paper
+ DMMEDIA_THICK = 1,
+ DMMEDIA_THIN = 2,
+ DMMEDIA_BOND = 3,
+ DMMEDIA_COLOR = 4,
+ DMMEDIA_CARDSTOCK = 5,
+ DMMEDIA_LABELS = 6, // Labels
+ DMMEDIA_ENVELOPE = 7, // Envelope
+ DMMEDIA_PREPRINTED = 8,
+ DMMEDIA_COTTON = 9,
+ DMMEDIA_RECYCLED = 10,
+} DMMEDIA;
+
+typedef enum {
+ DMCOLOR_MONOCHROME = 1,
+ DMCOLOR_COLOR = 2,
+} DMCOLOR;
+
+typedef enum {
+ DMORIENT_PORTRAIT = 1,
+ DMORIENT_LANDSCAPE = 2,
+} DMORIENT;
+
+typedef enum {
+ DMPAPER_LETTER = 1, // Letter, 8 1/2- by 11-inches
+ DMPAPER_LETTERSMALL = 2, // Letter Small, 8 1/2- by 11-inches
+ DMPAPER_TABLOID = 3, // Tabloid, 11- by 17-inches
+ DMPAPER_LEDGER = 4, // Ledger, 17- by 11-inches
+ DMPAPER_LEGAL = 5, // Legal, 8 1/2- by 14-inches
+ DMPAPER_STATEMENT = 6, // Statement, 5 1/2- by 8 1/2-inches
+ DMPAPER_EXECUTIVE = 7, // Executive, 7 1/4- by 10 1/2-inches
+ DMPAPER_A3 = 8, // A3 sheet, 297- by 420-millimeters
+ DMPAPER_A4 = 9, // A4 Sheet, 210- by 297-millimeters
+ DMPAPER_A4SMALL =10, // A4 small sheet, 210- by 297-millimeters
+ DMPAPER_A5 =11, // A5 sheet, 148- by 210-millimeters
+ DMPAPER_B4 =12, // B4 sheet, 250- by 354-millimeters
+ DMPAPER_B5 =13, // B5 sheet, 182- by 257-millimeter paper
+ DMPAPER_FOLIO =14, // Folio, 8 1/2- by 13-inch paper
+ DMPAPER_QUARTO =15, // Quarto, 215- by 275-millimeter paper
+ DMPAPER_10X14 =16, // 10- by 14-inch sheet
+ DMPAPER_11X17 =17, // 11- by 17-inch sheet
+ DMPAPER_NOTE =18, // Note, 8 1/2- by 11-inches
+ DMPAPER_ENV_9 =19, // #9 Envelope, 3 7/8- by 8 7/8-inches
+ DMPAPER_ENV_10 =20, // #10 Envelope, 4 1/8- by 9 1/2-inches
+ DMPAPER_ENV_11 =21, // #11 Envelope, 4 1/2- by 10 3/8-inches
+ DMPAPER_ENV_12 =22, // #12 Envelope, 4 3/4- by 11-inches
+ DMPAPER_ENV_14 =23, // #14 Envelope, 5- by 11 1/2-inches
+ DMPAPER_CSHEET =24, // C Sheet, 17- by 22-inches
+ DMPAPER_DSHEET =25, // D Sheet, 22- by 34-inches
+ DMPAPER_ESHEET =26, // E Sheet, 34- by 44-inches
+ DMPAPER_ENV_DL =27, // DL Envelope, 110- by 220-millimeters
+ DMPAPER_ENV_C5 =28, // C5 Envelope, 162- by 229-millimeters
+ DMPAPER_ENV_C3 =29, // C3 Envelope, 324- by 458-millimeters
+ DMPAPER_ENV_C4 =30, // C4 Envelope, 229- by 324-millimeters
+ DMPAPER_ENV_C6 =31, // C6 Envelope, 114- by 162-millimeters
+ DMPAPER_ENV_C65 =32, // C65 Envelope, 114- by 229-millimeters
+ DMPAPER_ENV_B4 =33, // B4 Envelope, 250- by 353-millimeters
+ DMPAPER_ENV_B5 =34, // B5 Envelope, 176- by 250-millimeters
+ DMPAPER_ENV_B6 =35, // B6 Envelope, 176- by 125-millimeters
+ DMPAPER_ENV_ITALY =36, // Italy Envelope, 110- by 230-millimeters
+ DMPAPER_ENV_MONARCH =37, // Monarch Envelope, 3 7/8- by 7 1/2-inches
+ DMPAPER_ENV_PERSONAL=38, // 6 3/4 Envelope, 3 5/8- by 6 1/2-inches
+ DMPAPER_FANFOLD_US =39, // US Std Fanfold, 14 7/8- by 11-inches
+ DMPAPER_FANFOLD_STD_GERMAN =40, // German Std Fanfold, 8 1/2 x 12 in
+ DMPAPER_FANFOLD_LGL_GERMAN =41, // German Legal Fanfold, 8 1/2 x 13 in
+
+ DMPAPER_ISO_B4 =42, // B4 (ISO) 250 x 353 mm
+ DMPAPER_JAPANESE_POSTCARD =43, // Japanese Postcard 100 x 148 mm
+ DMPAPER_9X11 =44, // 9 x 11 in
+ DMPAPER_10X11 =45, // 10 x 11 in
+ DMPAPER_15X11 =46, // 15 x 11 in
+ DMPAPER_ENV_INVITE =47, // Envelope Invite 220 x 220 mm
+ DMPAPER_RESERVED_48 =48, // RESERVED--DO NOT USE
+ DMPAPER_RESERVED_49 =49, // RESERVED--DO NOT USE
+ DMPAPER_LETTER_EXTRA =50, // Letter Extra 9 \275 x 12 in
+ DMPAPER_LEGAL_EXTRA =51, // Legal Extra 9 \275 x 15 in
+ DMPAPER_TABLOID_EXTRA =52, // Tabloid Extra 11.69 x 18 in
+ DMPAPER_A4_EXTRA =53, // A4 Extra 9.27 x 12.69 in
+ DMPAPER_LETTER_TRANSVERSE =54, // Letter Transverse 8 \275 x 11 in
+ DMPAPER_A4_TRANSVERSE =55, // A4 Transverse 210 x 297 mm
+ DMPAPER_LETTER_EXTRA_TRANSVERSE=56, // Letter Extra Transverse 9\275 x 12 in
+ DMPAPER_A_PLUS =57, // SuperA/SuperA/A4 227 x 356 mm
+ DMPAPER_B_PLUS =58, // SuperB/SuperB/A3 305 x 487 mm
+ DMPAPER_LETTER_PLUS =59, // Letter Plus 8.5 x 12.69 in
+ DMPAPER_A4_PLUS =60, // A4 Plus 210 x 330 mm
+ DMPAPER_A5_TRANSVERSE =61, // A5 Transverse 148 x 210 mm
+ DMPAPER_B5_TRANSVERSE =62, // B5 (JIS) Transverse 182 x 257 mm
+ DMPAPER_A3_EXTRA =63, // A3 Extra 322 x 445 mm
+ DMPAPER_A5_EXTRA =64, // A5 Extra 174 x 235 mm
+ DMPAPER_B5_EXTRA =65, // B5 (ISO) Extra 201 x 276 mm
+ DMPAPER_A2 =66, // A2 420 x 594 mm
+ DMPAPER_A3_TRANSVERSE =67, // A3 Transverse 297 x 420 mm
+ DMPAPER_A3_EXTRA_TRANSVERSE =68, // A3 Extra Transverse 322 x 445 mm
+} DMPAPER;
+
+typedef union _SWAP_32{
+ char byte[sizeof(uint32_t)];
+ uint32_t dword;
+} SWAP_32;
+
+typedef union _SWAP_16{
+ char byte[sizeof(uint16_t)];
+ uint16_t word;
+} SWAP_16;
+
+static inline uint32_t
+be32(uint32_t dword)
+{
+ SWAP_32 swap;
+ uint32_t probe = 1;
+
+ if (((char *)&probe)[0] == 1)
+ {
+ swap.byte[3] = (( SWAP_32 )dword).byte[0];
+ swap.byte[2] = (( SWAP_32 )dword).byte[1];
+ swap.byte[1] = (( SWAP_32 )dword).byte[2];
+ swap.byte[0] = (( SWAP_32 )dword).byte[3];
+ return swap.dword;
+ }
+ else
+ return dword;
+}
+
+static inline uint16_t
+be16(uint16_t word)
+{
+ SWAP_16 swap;
+ uint16_t probe = 1;
+
+ if (((char *)&probe)[0] == 1)
+ {
+ swap.byte[1] = (( SWAP_16 )word).byte[0];
+ swap.byte[0] = (( SWAP_16 )word).byte[1];
+ return swap.word;
+ }
+ else
+ return word;
+}
diff --git a/hipercdecode.1in b/hipercdecode.1in
new file mode 100644
index 0000000..a5783ec
--- /dev/null
+++ b/hipercdecode.1in
@@ -0,0 +1,168 @@
+.TH hipercdecode 1 "${MODpage}" "hipercdecode ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+hipercdecode \- Decode a HIPERC stream into human readable form.
+.SH SYNOPSIS
+.B hipercdecode
+.RI [ options "] <" hiperc-file
+.SH DESCRIPTION
+.B hipercdecode
+decodes a HIPERC stream into human readable form.
+Uncompressed and JBIG formats are handled.
+.P
+An HIPERC stream is the printer langauge used by the
+Oki Data C3200n, C3300n, C3400n, C5100n, and the C5500n
+printers.
+
+.SH COMMAND LINE OPTIONS
+These are the options that can appear on the command line.
+.TP
+.BI \-d\0 basename
+Basename of .pbm file for saving decompressed planes.
+.TP
+.BI \-h
+Print hex file offsets.
+.TP
+.BI \-o
+Print file offsets.
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Decode an HIPERC stream file created by foo2hiperc.
+
+.nf
+.ft CW
+$ foo2hiperc-wrapper testpage.ps | hipercdecode -h
+ 0: \\033%-12345X@PJL
+ f: @PJL RDYMSG DISPLAY = "Unknown"
+ 30: @PJL SET OKIJOBACCOUNTJOB USERID="Unknown" JOBNAME="Unknown"
+ 6e: @PJL SET OKIAUXJOBINFO DATA="DocumentName=Unknown"
+ a2: @PJL SET OKIAUXJOBINFO DATA="ComputerName=dual.rkkda.org"
+ dd: @PJL SET OKIAUXJOBINFO DATA="ReceptionTime=00:00:00 2008/01/30"
+ 11e: @PJL SET OKIAUTOTRAYSWITCH=ON
+ 13d: @PJL SET OKIPAPERSIZECHECK=ENABLE
+ 160: @PJL SET RESOLUTION=600
+ 179: @PJL SET PAPER=LETTER
+ 190: @PJL SET OKITRAYSEQUENCE=PAPERFEEDTRAY
+ 1b8: @PJL SET OKIPAPERFEED=TRAY1
+ 1d5: @PJL SET OKIMEDIATYPE = PLAIN
+ 1f4: @PJL SET LPARM:PCL OKIPRINTMARGIN=INCH1D6
+ 21f: @PJL SET COPIES=1
+ 232: @PJL SET QTY=1
+ 242: @PJL SET HIPERCEFFECTIVEBLOCKSIZE=34799360
+ 26e: @PJL ENTER LANGUAGE=HIPERC
+ 289: RECTYPE 0 (len=52,0x34 cnt=1)
+ 291: BLKNUM 0, nbie=1, pn=3 [black] uc=0,0, wid=4864 ud=0,100
+ 2a5: BLKNUM 1 (len=20), uncompressed=1, bie:
+ DL = 48, D = 48, P = 49, - = 48, XY = 4864 x 6816
+ L0 = 256, MX = 0, MY = 0
+ Order = 0
+ Options = 0
+ 1 stripes, 0 layers, 49 planes
+ 2bd: RECTYPE 1 (len=155668,0x26014 cnt=1)
+ 2c5: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ 2cd: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ 262d1: RECTYPE 1 (len=155668,0x26014 cnt=2)
+ 262d9: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ 262e1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ 4c2e5: RECTYPE 1 (len=155668,0x26014 cnt=3)
+ 4c2ed: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ 4c2f5: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ 722f9: RECTYPE 1 (len=155668,0x26014 cnt=4)
+ 72301: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ 72309: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ 9830d: RECTYPE 1 (len=155668,0x26014 cnt=5)
+ 98315: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ 9831d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ be321: RECTYPE 1 (len=155668,0x26014 cnt=6)
+ be329: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ be331: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+ e4335: RECTYPE 1 (len=155668,0x26014 cnt=7)
+ e433d: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+ e4345: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+10a349: RECTYPE 1 (len=155668,0x26014 cnt=8)
+10a351: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+10a359: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+13035d: RECTYPE 1 (len=155668,0x26014 cnt=9)
+130365: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+13036d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+156371: RECTYPE 1 (len=155668,0x26014 cnt=10)
+156379: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+156381: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+17c385: RECTYPE 1 (len=155668,0x26014 cnt=11)
+17c38d: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+17c395: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+1a2399: RECTYPE 1 (len=155668,0x26014 cnt=12)
+1a23a1: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+1a23a9: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+1c83ad: RECTYPE 1 (len=155668,0x26014 cnt=13)
+1c83b5: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+1c83bd: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+1ee3c1: RECTYPE 1 (len=155668,0x26014 cnt=14)
+1ee3c9: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+1ee3d1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+2143d5: RECTYPE 1 (len=155668,0x26014 cnt=15)
+2143dd: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+2143e5: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+23a3e9: RECTYPE 1 (len=155668,0x26014 cnt=16)
+23a3f1: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+23a3f9: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+2603fd: RECTYPE 1 (len=155668,0x26014 cnt=17)
+260405: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+26040d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+286411: RECTYPE 1 (len=155668,0x26014 cnt=18)
+286419: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+286421: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+2ac425: RECTYPE 1 (len=155668,0x26014 cnt=19)
+2ac42d: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+2ac435: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+2d2439: RECTYPE 1 (len=155668,0x26014 cnt=20)
+2d2441: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+2d2449: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+2f844d: RECTYPE 1 (len=155668,0x26014 cnt=21)
+2f8455: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+2f845d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+31e461: RECTYPE 1 (len=155668,0x26014 cnt=22)
+31e469: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+31e471: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+344475: RECTYPE 1 (len=155668,0x26014 cnt=23)
+34447d: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+344485: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+36a489: RECTYPE 1 (len=155668,0x26014 cnt=24)
+36a491: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+36a499: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+39049d: RECTYPE 1 (len=155668,0x26014 cnt=25)
+3904a5: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+3904ad: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+3b64b1: RECTYPE 1 (len=155668,0x26014 cnt=26)
+3b64b9: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+3b64c1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+3dc4c5: RECTYPE 1 (len=97300,0x17c14 cnt=27)
+3dc4cd: BLKNUM 0 (len=4), plane=3, uc=0,0,0
+3dc4d5: BLKNUM 1 (len=97280), Data=00 00 00 00 00 00 00 00 00 00 00 ...
+3f40d9: RECTYPE 255 (len=8,0x8 cnt=28)
+3f40e1: \\033%-12345X
+
+.ft P
+.fi
+
+.SH FILES
+.BR /usr/bin/hipercdecode
+.SH SEE ALSO
+.BR foo2hiperc-wrapper (1),
+.BR foo2hiperc (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLHC}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/okidecode.c b/hipercdecode.c
index 586ba3c..4ee5d9d 100644
--- a/okidecode.c
+++ b/hipercdecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: okidecode.c,v 1.12 2007/06/27 22:23:24 rick Exp $
+ * $Id: hipercdecode.c,v 1.4 2008/09/05 15:05:54 rick Exp $
*/
/*b
@@ -29,7 +29,7 @@ b*/
#include <unistd.h>
#include <errno.h>
-#include "oki.h"
+#include "hiperc.h"
#include "jbig.h"
/*
@@ -41,6 +41,7 @@ char *DecFile;
int PrintOffset = 0;
int PrintHexOffset = 0;
FILE *FpRaw[4];
+FILE *FpDec[4];
void
debug(int level, char *fmt, ...)
@@ -144,6 +145,7 @@ print_bih(unsigned char bih[20])
((yd >> bih[1]) + ((((1UL << bih[1]) - 1) & xd) != 0) + l0 - 1) / l0,
bih[1] - bih[0], bih[2]);
}
+ unsigned char blk[50*1024*1024];
void
decode(FILE *fp)
@@ -159,6 +161,9 @@ decode(FILE *fp)
int imageCnt[4] = {0,0,0,0};
int pn = 0;
char buf[1024];
+ int reccnt = 0;
+ int uncompressed = 0;
+ unsigned int w = 0, h = 0;
c = getc(fp);
if (c == EOF)
@@ -203,7 +208,12 @@ decode(FILE *fp)
rectype = be32(rectype);
if (PrintOffset) printf("%d: ", curOff);
else if (PrintHexOffset) printf("%6x: ", curOff);
- printf("RECTYPE %d (len=%d)\n", rectype, reclen);
+ printf("RECTYPE %d (len=%d,0x%x cnt=%d)",
+ rectype, reclen, reclen, ++reccnt);
+ if (rectype == 0)
+ printf(", Page %d\n", pageNum);
+ else
+ printf("\n");
curOff += 8;
blknum = 0;
@@ -212,7 +222,7 @@ decode(FILE *fp)
{
int blklen;
int i;
- unsigned char blk[200*1024];
+// unsigned char blk[50*1024*1024];
if (PrintOffset) printf("%d: ", curOff);
else if (PrintHexOffset) printf("%6x: ", curOff);
@@ -232,6 +242,7 @@ decode(FILE *fp)
switch (rectype)
{
case 0:
+ reccnt = 0;
switch (blknum)
{
case 0:
@@ -240,24 +251,28 @@ decode(FILE *fp)
switch (pn = blk[1])
{
case 0: printf(" [cyan] "); break;
- case 1: printf(" [yello]"); break;
- case 2: printf(" [magen]"); break;
+ case 1: printf(" [magen]"); break;
+ case 2: printf(" [yello]"); break;
case 3: printf(" [black]"); break;
}
printf(" uc=%d,%d, wid=%d ud=%d,%x\n",
blk[2], blk[3],
getdword(blk+4), getdword(blk+8), getdword(blk+12));
+ w = getdword(blk+4);
if (pn < 0 || pn > 3)
error(1, "Plane %d is not 0-3.\n", pn);
break;
case 1: /* BIH */
- printf("\tBLKNUM %d (len=%d), bie:\n",
- blknum, blklen);
+ uncompressed = (blk[0] == 48);
+ printf("\tBLKNUM %d (len=%d), uncompressed=%d, bie:\n",
+ blknum, blklen, uncompressed);
memcpy(bih[pn], blk, 20);
// bih[18] |= JBG_ILEAVE | JBG_SMID;
// bih[19] |= JBG_TPDON | JBG_DPON;
// bih[19] |= JBG_DELAY_AT;
print_bih(bih[pn]);
+ h = (blk[8] << 24) | (blk[9] << 16)
+ | (blk[10] << 8) | (blk[11] << 0);
imageCnt[pn] = 0;
break;
}
@@ -285,7 +300,20 @@ decode(FILE *fp)
}
if (FpRaw[pn])
fwrite(blk, 1, blklen, FpRaw[pn]);
- if (DecFile)
+ if (uncompressed)
+ {
+ if (DecFile && !FpDec[pn])
+ {
+ sprintf(buf, "%s-%02d-%d.pbm",
+ DecFile, pageNum, pn);
+ FpDec[pn] = fopen(buf, "w");
+ fprintf(FpDec[pn], "P4\n");
+ fprintf(FpDec[pn], "%9d %9d\n", w, h);
+ }
+ if (FpDec[pn])
+ fwrite(blk, 1, blklen, FpDec[pn]);
+ }
+ else if (DecFile)
{
size_t cnt;
unsigned char *image;
@@ -306,23 +334,23 @@ decode(FILE *fp)
for (i = 0; i < blklen; ++i)
{
rc = jbg_dec_in(&s[pn], &blk[i], 1, &cnt);
- if (rc == JBG_OK)
+ if (rc == JBG_EOK)
break;
- if (rc != JBG_EAGAIN && rc != JBG_OK)
+ if (rc != JBG_EAGAIN && rc != JBG_EOK)
error(1, "jbg_dec_in rc=%d (%s)\n",
- rc, jbg_strerror(rc, 0));
+ rc, jbg_strerror(rc));
}
if (0) {
- printf("\ti=%d (%s)\n", i, jbg_strerror(rc, 0));
+ printf("\ti=%d (%s)\n", i, jbg_strerror(rc));
len = jbg_dec_getsize(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
printf("\tlen=%d image=%lx (%s)\n",
- len, (long) image, jbg_strerror(rc, 0));
+ len, (long) image, jbg_strerror(rc));
for (i=0; i<len; ++i)
if (image[i])
printf("image[%d] = %x\n", i, image[i]);
}
- if (rc == JBG_OK)
+ if (rc == JBG_EOK)
{
int w, h;
@@ -331,7 +359,7 @@ decode(FILE *fp)
len = jbg_dec_getsize(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
printf("\trc=%d(%s) %dx%d len=%d\n",
- rc, jbg_strerror(rc, 0), w, h, len);
+ rc, jbg_strerror(rc), w, h, len);
sprintf(buf, "%s-%02d-%d.pbm",
DecFile, pageNum, pn);
@@ -363,6 +391,16 @@ decode(FILE *fp)
}
if (rectype == 255)
{
+ if (FpDec[pn])
+ {
+ int i;
+ for (i = 0; i < 4; ++i)
+ {
+ if (FpDec[i])
+ fclose(FpDec[i]);
+ FpDec[i] = 0;
+ }
+ }
c = getc(fp);
if (c == EOF) break;
ungetc(c, fp);
@@ -412,7 +450,18 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- decode(stdin);
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ decode(fp);
+ fclose(fp);
+ }
+ else
+ decode(stdin);
exit(0);
}
diff --git a/hplj1000 b/hplj1000
index ca57960..761e775 100755
--- a/hplj1000
+++ b/hplj1000
@@ -38,9 +38,16 @@ DEV=""
FWDIR=/usr/share/foo2zjs/firmware
#
-# Program used to determine USB id information
+# Program used to determine USB printer id information
#
-USBID=/bin/usb_printerid
+# NOTE: /usr/bin is NOT mounted at this point
+#
+# e.g. /etc/rc.sysinit:
+# /sbin/start_udev
+# [snip]
+# # Mount all other filesystems (except for NFS and /proc, which is already
+#
+PRINTERID=/bin/usb_printerid
#
# Figure out how to log our messages
@@ -66,28 +73,64 @@ fi
# Figure out the model number from the name of this script
#
case "$0" in
+*P1005)
+ MODEL=P1005; FWMODEL=$MODEL
+ USB1=0x03f0 #Vendor
+ USB2=0x3d17 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
+*P1006)
+ MODEL=P1006; FWMODEL=$MODEL
+ USB1=0x03f0 #Vendor
+ USB2=0x3e17 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
+*P1007)
+ MODEL=P1007; FWMODEL=P1005 # Alias
+ USB1=0x03f0 #Vendor
+ USB2=0x4817 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
+*P1008)
+ MODEL=P1008; FWMODEL=P1006 # Alias
+ USB1=0x03f0 #Vendor
+ USB2=0x4917 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
+*P1505)
+ MODEL=P1505; FWMODEL=$MODEL
+ USB1=0x03f0 #Vendor
+ USB2=0x3f17 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
+*P1505n)
+ MODEL=P1505n; FWMODEL=$MODEL
+ USB1=0x03f0 #Vendor
+ USB2=0x4017 #Model
+ FWDIR=/usr/share/foo2xqx/firmware
+ ;;
*1000)
- MODEL=1000
+ MODEL=1000; FWMODEL=$MODEL
USB1=0x03f0 #Vendor
USB2=0x0517 #Model
;;
*1005)
- MODEL=1005
+ MODEL=1005; FWMODEL=$MODEL
USB1=0x03f0 #Vendor
USB2=0x1317 #Model
;;
*1018)
- MODEL=1018
+ MODEL=1018; FWMODEL=$MODEL
USB1=0x03f0 #Vendor
USB2=0x4117 #Model
;;
*1020)
- MODEL=1020
+ MODEL=1020; FWMODEL=$MODEL
USB1=0x03f0 #Vendor
USB2=0x2b17 #Model
;;
*)
- log "Only HP LaserJet 1000, 1005, 1018, and 1020 are supported"
+ log "Only HP LaserJet 100[05],1018,1020,P100[5678],P1505 are supported"
exit
;;
esac
@@ -133,7 +176,7 @@ esac
#
load1() {
_dev="$1"
- fw="$FWDIR/sihp$MODEL.dl"
+ fw="$FWDIR/sihp$FWMODEL.dl"
if [ ! -f "$fw" ]; then
log "Missing HP LaserJet $MODEL firmware file $fw"
log "...read foo2zjs installation instructions and run ./getweb $MODEL"
@@ -160,17 +203,17 @@ if [ "$DEV" != "" ]; then
# force downloading to a specific device
#
load1 "$DEV"
-elif [ -x $USBID ]; then
+elif [ -x $PRINTERID ]; then
#
# Sniff around for printers that need a firmware download
#
usblps=`find /dev/usb -name lp*`" "`find /dev -name usblp*`
for dev in $usblps; do
- status=`$USBID $dev 2>/dev/null | grep -y "hp LaserJet $MODEL"`
+ status=`$PRINTERID $dev 2>/dev/null | grep -y "hp LaserJet $MODEL"`
if [ "$status" != "" ]; then
# This is a LaserJet 100x
chmod 0666 $dev
- status=`$USBID $dev | grep 'FWVER'`
+ status=`$PRINTERID $dev | grep 'FWVER'`
if [ "$status" = "" ]; then
# Firmware is not yet loaded
load1 "$dev"
@@ -181,5 +224,5 @@ elif [ -x $USBID ]; then
done
else
log "HP LaserJet $MODEL firmware was not downloaded..."
- log "...couldn't find $USBID and DEV is not set"
+ log "...couldn't find $PRINTERID and DEV is not set"
fi
diff --git a/hplj1020.desktop b/hplj1020.desktop
new file mode 100644
index 0000000..ef39fb4
--- /dev/null
+++ b/hplj1020.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Encoding=UTF-8
+Name=HPLJ 10xx Replaced Paper
+Comment=HP LaserJet 1018, 1020
+zExec=usb_printerid /dev/usb/lp0
+Exec=wish /usr/share/foo2zjs/hplj10xx_gui.tcl
+Terminal=false
+Type=Application
+Icon=/usr/share/pixmaps/hplj1020_icon.png
+StartupNotify=true
+Categories=System;
+X-Desktop-File-Install-Version=0.10
diff --git a/hplj1020_icon.gif b/hplj1020_icon.gif
new file mode 100644
index 0000000..b39d412
--- /dev/null
+++ b/hplj1020_icon.gif
Binary files differ
diff --git a/hplj1020_icon.png b/hplj1020_icon.png
new file mode 100644
index 0000000..fae4db2
--- /dev/null
+++ b/hplj1020_icon.png
Binary files differ
diff --git a/hplj10xx.rules b/hplj10xx.rules
index 2929a6d..b6f002f 100644
--- a/hplj10xx.rules
+++ b/hplj10xx.rules
@@ -1,8 +1,36 @@
#Own udev rule for HP Laserjet 1000
-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", SYSFS{product}=="hp LaserJet 1000", NAME="usb/%k", SYMLINK+="hplj1000%e", MODE="0666", RUN+="/etc/hotplug/usb/hplj1000"
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="hp LaserJet 1000", NAME="usb/%k", \
+ SYMLINK+="hplj1000-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1000"
#Own udev rule for HP Laserjet 1005
-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", SYSFS{product}=="hp LaserJet 1005 series", NAME="usb/%k", SYMLINK+="hplj1005%e", MODE="0666", RUN+="/etc/hotplug/usb/hplj1005"
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="hp LaserJet 1005 series", NAME="usb/%k", \
+ SYMLINK+="hplj1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1005"
#Own udev rule for HP Laserjet 1018
-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", SYSFS{product}=="HP LaserJet 1018", NAME="usb/%k", SYMLINK+="hplj1018%e", MODE="0666", RUN+="/etc/hotplug/usb/hplj1018"
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet 1018", NAME="usb/%k", \
+ SYMLINK+="hplj1018-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1018"
#Own udev rule for HP Laserjet 1020
-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", SYSFS{product}=="HP LaserJet 1020", NAME="usb/%k", SYMLINK+="hplj1020%e", MODE="0666", RUN+="/etc/hotplug/usb/hplj1020"
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet 1020", NAME="usb/%k", \
+ SYMLINK+="hplj1020-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1020"
+#Own udev rule for HP Laserjet P1005
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet P1005", NAME="usb/%k", \
+ SYMLINK+="hpljP1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1005"
+#Own udev rule for HP Laserjet P1006
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet P1006", NAME="usb/%k", \
+ SYMLINK+="hpljP1006-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1006"
+#Own udev rule for HP Laserjet P1007
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet P1007", NAME="usb/%k", \
+ SYMLINK+="hpljP1007-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1007"
+#Own udev rule for HP Laserjet P1008
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet P1008", NAME="usb/%k", \
+ SYMLINK+="hpljP1008-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1008"
+#Own udev rule for HP Laserjet P1505
+KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+ SYSFS{product}=="HP LaserJet P1505", NAME="usb/%k", \
+ SYMLINK+="hpljP1505-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1505"
diff --git a/hplj10xx_gui.tcl b/hplj10xx_gui.tcl
new file mode 100755
index 0000000..7ecc206
--- /dev/null
+++ b/hplj10xx_gui.tcl
@@ -0,0 +1,87 @@
+#!/usr/bin/wish
+
+global share
+set share "/usr/share/foo2zjs"
+
+proc replaced {name} {
+ exec usb_printerid $name
+}
+
+proc main {w} {
+ global share
+
+ image create photo icon -file [file join $share hplj1020_icon.gif]
+
+ frame $w.frame
+ tixBalloon $w.frame.balloon
+
+ set n 0
+ set old 1
+ set pwd [pwd]
+
+ foreach file [lsort [glob -nocomplain /sys/class/usb/lp*/device]] {
+ set old 0
+ regsub /.*usb/(lp\[^/]*)/.* $file {\1} lp
+ cd $file
+ cd ..
+ set fp [open "product" "r"]
+ gets $fp product
+ close $fp
+ set fp [open "serial" "r"]
+ gets $fp serial
+ close $fp
+ cd $pwd
+ if {$product != "HP LaserJet 1020" && $product != "HP LaserJet 1018"} {
+ continue
+ }
+
+ set f $w.frame.frame$n
+ set prodsn [concat $product $serial]
+ frame $f
+ frame $f.sf$n
+ label $f.sf$n.label1 -text "$prodsn"
+ pack $f.sf$n.label1 -side top -fill y -expand 1
+ label $f.sf$n.label2 -text "Replaced the paper?"
+ pack $f.sf$n.label2 -side top -fill y -expand 1
+ pack $f.sf$n -side left -fill y
+
+ button $f.config$n -text "test" -image icon \
+ -command "replaced /dev/usb/$lp"
+ pack $f.config$n -side left -fill y
+ $w.frame.balloon bind $f.config$n -balloonmsg "Replaced Paper"
+ pack $f
+ incr n
+ }
+ if {$old == 1} {
+ foreach file [lsort [glob -nocomplain /dev/usb/lp?]] {
+ set f $w.frame.frame$n
+ frame $f
+ frame $f.sf$n
+ label $f.sf$n.label1 -text "$file"
+ pack $f.sf$n.label1 -side top -fill y -expand 1
+ label $f.sf$n.label2 -text "Replaced the paper?"
+ pack $f.sf$n.label2 -side top -fill y -expand 1
+ pack $f.sf$n -side left -fill y
+
+ button $f.config$n -text "test" -image icon \
+ -command "replaced $file"
+ pack $f.config$n -side left -fill y
+ $w.frame.balloon bind $f.config$n -balloonmsg "Replaced Paper"
+ pack $f
+ incr n
+ }
+ }
+ if {$n == 0} {
+ label $w.frame.label -text "No HP LaserJet 1018/1020"
+ pack $w.frame.label
+ puts "asdsd"
+ }
+
+ pack $w.frame -expand 1
+}
+
+wm title . "HP LaserJet 1018 and 1020 GUI"
+
+package require Tix
+
+main ""
diff --git a/icc2ps/COPYING b/icc2ps/COPYING
index ef5dab3..184e60a 100644..100755
--- a/icc2ps/COPYING
+++ b/icc2ps/COPYING
@@ -1,5 +1,5 @@
-Little cms
-Copyright (C) 1998-2004 Marti Maria
+Little CMS
+Copyright (c) 1998-2007 Marti Maria Saguer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
diff --git a/icc2ps/Makefile b/icc2ps/Makefile
index e899212..c6b38ec 100644
--- a/icc2ps/Makefile
+++ b/icc2ps/Makefile
@@ -1,3 +1,4 @@
+UNAME := $(shell uname)
PREFIX= /usr
BIN= $(PREFIX)/bin
SRC= icc2ps.c xgetopt.c
@@ -5,6 +6,11 @@ LIB= cmscam97.c cmscnvrt.c cmserr.c cmsgamma.c cmsgmt.c cmsintrp.c cmsio1.c \
cmslut.c cmsmatsh.c cmsmtrx.c cmsnamed.c cmspack.c cmspcs.c cmsps2.c \
cmssamp.c cmswtpnt.c cmsxform.c cmsio0.c cmsvirt.c
CFLAGS= -O3
+INSTALL=install
+ifeq ($(UNAME),SunOS)
+ INSTALL=/usr/ucb/install
+ CC=gcc
+endif
all: foo2zjs-icc2ps
@@ -12,9 +18,18 @@ foo2zjs-icc2ps: $(SRC) $(LIB)
$(CC) $(CFLAGS) $(SRC) $(LIB) -lm -o $@
install: all
- install -c foo2zjs-icc2ps $(BIN)
+ $(INSTALL) -c foo2zjs-icc2ps $(BIN)
clean:
rm -f *.o foo2zjs-icc2ps
foo2zjs-icc2ps: icc34.h lcms.h
+
+regress: all
+ @./foo2zjs-icc2ps a b 2>&1 | grep "little cms P"
+ @for i in ../icm/*.icm; do \
+ b=`basename $$i`; \
+ ./foo2zjs-icc2ps -o $$i -t0 | grep -v Created >$$b.ps; \
+ done
+ @md5sum *icm.ps
+ @rm -f *icm.ps
diff --git a/icc2ps/README b/icc2ps/README
index a4a2164..60ceeda 100644..100755
--- a/icc2ps/README
+++ b/icc2ps/README
@@ -1,9 +1,9 @@
- Read.me for release 1.15
+ Read.me for release 1.17
========================
Little cms
- Copyright (C) 1998-2005 Marti Maria
+ Copyright (C) 1998-2007 Marti Maria
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -31,7 +31,7 @@
See file COPYING. for details
- This is the 14th. public release the engine. It has been tested
+ This is the 15th. public release the engine. It has been tested
across several versions before, but it is possible some
bugs still arises. If so, sorry for the inconvenience, and
please feel free to submit any suggestion/solution (if you can
@@ -74,7 +74,7 @@
ICM Stress demo from microsoft. www.microsoft.com
sRGB from sRGB site www.srgb.com
- If you found some profile of these not to be in public domain,
+ If you found any of these not to be in public domain,
please notify me. I will remove the offending profile as soon as
posible.
diff --git a/icc2ps/README.foo2zjs b/icc2ps/README.foo2zjs
index b762ff2..fb898f2 100644
--- a/icc2ps/README.foo2zjs
+++ b/icc2ps/README.foo2zjs
@@ -5,3 +5,9 @@ If you would like the full lcms package, get it from here:
http://www.littlecms.com
-Rick
+
+Jan 22, 2008
+------------
+Bug:
+ cmsio1.c
+
diff --git a/icc2ps/cmscam02.c b/icc2ps/cmscam02.c
index ae6f2eb..bade0e0 100644..100755
--- a/icc2ps/cmscam02.c
+++ b/icc2ps/cmscam02.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -22,7 +22,7 @@
-// CIECAM 02 appearance model
+// CIECAM 02 appearance model. Many thanks to Jordi Vilar for the debugging.
#include "lcms.h"
@@ -167,6 +167,10 @@ CAM02COLOR NonlinearCompression(CAM02COLOR clr, LPcmsCIECAM02 pMod)
clr.RGBpa[i] = (400.0 * temp) / (temp + 27.13) + 0.1;
}
}
+
+ clr.A = (((2.0 * clr.RGBpa[0]) + clr.RGBpa[1] +
+ (clr.RGBpa[2] / 20.0)) - 0.305) * pMod->Nbb;
+
return clr;
}
@@ -220,9 +224,6 @@ CAM02COLOR ComputeCorrelates(CAM02COLOR clr, LPcmsCIECAM02 pMod)
clr.H = 300 + ((100*((clr.h - 237.53)/1.2)) / temp);
}
- clr.A = (((2.0 * clr.RGBpa[0]) + clr.RGBpa[1] +
- (clr.RGBpa[2] / 20.0)) - 0.305) * pMod->Nbb;
-
clr.J = 100.0 * pow((clr.A / pMod->adoptedWhite.A),
(pMod->c * pMod->z));
@@ -366,7 +367,7 @@ LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC)
LPcmsCIECAM02 lpMod;
- if((lpMod = (LPcmsCIECAM02) malloc(sizeof(cmsCIECAM02))) == NULL) {
+ if((lpMod = (LPcmsCIECAM02) _cmsMalloc(sizeof(cmsCIECAM02))) == NULL) {
return (LCMSHANDLE) NULL;
}
@@ -420,14 +421,19 @@ LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC)
lpMod -> z = compute_z(lpMod);
lpMod -> Nbb = computeNbb(lpMod);
lpMod -> FL = computeFL(lpMod);
+
+ if (lpMod -> D == D_CALCULATE ||
+ lpMod -> D == D_CALCULATE_DISCOUNT) {
+
lpMod -> D = computeD(lpMod);
+ }
+
lpMod -> Ncb = lpMod -> Nbb;
lpMod -> adoptedWhite = XYZtoCAT02(lpMod -> adoptedWhite);
lpMod -> adoptedWhite = ChromaticAdaptation(lpMod -> adoptedWhite, lpMod);
lpMod -> adoptedWhite = CAT02toHPE(lpMod -> adoptedWhite);
lpMod -> adoptedWhite = NonlinearCompression(lpMod -> adoptedWhite, lpMod);
- lpMod -> adoptedWhite = ComputeCorrelates(lpMod -> adoptedWhite, lpMod);
return (LCMSHANDLE) lpMod;
@@ -436,7 +442,7 @@ LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC)
void LCMSEXPORT cmsCIECAM02Done(LCMSHANDLE hModel)
{
LPcmsCIECAM02 lpMod = (LPcmsCIECAM02) (LPSTR) hModel;
- if (lpMod) free(lpMod);
+ if (lpMod) _cmsFree(lpMod);
}
diff --git a/icc2ps/cmscam97.c b/icc2ps/cmscam97.c
index 494fab0..0e8a79b 100644..100755
--- a/icc2ps/cmscam97.c
+++ b/icc2ps/cmscam97.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -145,7 +145,7 @@ typedef struct {
LCMSAPI void LCMSEXPORT cmsCIECAM97sDone(LCMSHANDLE hModel)
{
LPcmsCIECAM97s lpMod = (LPcmsCIECAM97s) (LPSTR) hModel;
- if (lpMod) free(lpMod);
+ if (lpMod) _cmsFree(lpMod);
}
// Partial discounting for adaptation degree computation
@@ -302,7 +302,7 @@ LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM97sInit(LPcmsViewingConditions pVC)
LPcmsCIECAM97s lpMod;
VEC3 tmp;
- if((lpMod = (LPcmsCIECAM97s) malloc(sizeof(cmsCIECAM97s))) == NULL) {
+ if((lpMod = (LPcmsCIECAM97s) _cmsMalloc(sizeof(cmsCIECAM97s))) == NULL) {
return (LCMSHANDLE) NULL;
}
@@ -420,7 +420,7 @@ LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM97sInit(LPcmsViewingConditions pVC)
// RGB_subw = [MlamRigg][WP/YWp]
#ifdef USE_CIECAM97s2
- MAT3eval(&lpMod -> RGB_subw, &lpMod -> MlamRigg, (LPVEC3) &lpMod -> WP);
+ MAT3eval(&lpMod -> RGB_subw, &lpMod -> MlamRigg, &lpMod -> WP);
#else
VEC3divK(&tmp, (LPVEC3) &lpMod -> WP, lpMod->WP.Y);
MAT3eval(&lpMod -> RGB_subw, &lpMod -> MlamRigg, &tmp);
diff --git a/icc2ps/cmscgats.c b/icc2ps/cmscgats.c
index 7c8f52c..3eb7006 100644
--- a/icc2ps/cmscgats.c
+++ b/icc2ps/cmscgats.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -36,22 +36,25 @@ LCMSAPI int LCMSEXPORT cmsIT8SetTable(LCMSHANDLE IT8, int nTable);
// Persistence
LCMSAPI LCMSHANDLE LCMSEXPORT cmsIT8LoadFromFile(const char* cFileName);
LCMSAPI LCMSHANDLE LCMSEXPORT cmsIT8LoadFromMem(void *Ptr, size_t len);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE IT8, const char* cFileName);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE IT8, const char* cFileName);
// Properties
LCMSAPI const char* LCMSEXPORT cmsIT8GetSheetType(LCMSHANDLE hIT8);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* cComment);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* cComment);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* cProp, const char *Str);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* cProp, const char *Str);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char* cSubProp, const char *Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer);
LCMSAPI const char* LCMSEXPORT cmsIT8GetProperty(LCMSHANDLE hIT8, const char* cProp);
LCMSAPI double LCMSEXPORT cmsIT8GetPropertyDbl(LCMSHANDLE hIT8, const char* cProp);
-LCMSAPI int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE IT8, char ***PropertyNames);
+LCMSAPI const char* LCMSEXPORT cmsIT8GetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char *cSubProp);
+LCMSAPI int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE IT8, const char ***PropertyNames);
+LCMSAPI int LCMSEXPORT cmsIT8EnumPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char*** SubpropertyNames);
// Datasets
@@ -60,10 +63,10 @@ LCMSAPI const char* LCMSEXPORT cmsIT8GetPatchName(LCMSHANDLE hIT8, int nPatc
LCMSAPI const char* LCMSEXPORT cmsIT8GetDataRowCol(LCMSHANDLE IT8, int row, int col);
LCMSAPI double LCMSEXPORT cmsIT8GetDataRowColDbl(LCMSHANDLE IT8, int col, int row);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col,
const char* Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col,
double Val);
LCMSAPI const char* LCMSEXPORT cmsIT8GetData(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
@@ -71,15 +74,15 @@ LCMSAPI const char* LCMSEXPORT cmsIT8GetData(LCMSHANDLE IT8, const char* cPa
LCMSAPI double LCMSEXPORT cmsIT8GetDataDbl(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE IT8, const char* cPatch,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE IT8, const char* cPatch,
const char* cSample,
const char *Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
const char* cSample,
double Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE IT8, int n, const char *Sample);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE IT8, int n, const char *Sample);
LCMSAPI int LCMSEXPORT cmsIT8EnumDataFormat(LCMSHANDLE IT8, char ***SampleNames);
LCMSAPI void LCMSEXPORT cmsIT8DefineDblFormat(LCMSHANDLE IT8, const char* Formatter);
@@ -97,7 +100,7 @@ LCMSAPI int LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const
// #define STRICT_CGATS 1
#define MAXID 128 // Max lenght of identifier
-#define MAXSTR 255 // Max lenght of string
+#define MAXSTR 1024 // Max lenght of string
#define MAXTABLES 255 // Max Number of tables in a single stream
#define MAXINCLUDE 20 // Max number of nested includes
@@ -108,6 +111,9 @@ LCMSAPI int LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const
#ifndef NON_WINDOWS
#include <io.h>
+#define DIR_CHAR '\\'
+#else
+#define DIR_CHAR '/'
#endif
// Symbols
@@ -131,6 +137,7 @@ typedef enum {
SEND_DATA,
SEND_DATA_FORMAT,
SKEYWORD,
+ SDATA_FORMAT_ID,
SINCLUDE
} SYMBOL;
@@ -142,7 +149,8 @@ typedef enum {
WRITE_UNCOOKED,
WRITE_STRINGIFY,
WRITE_HEXADECIMAL,
- WRITE_BINARY
+ WRITE_BINARY,
+ WRITE_PAIR
} WRITEMODE;
@@ -152,6 +160,8 @@ typedef struct _KeyVal {
struct _KeyVal* Next;
char* Keyword; // Name of variable
+ struct _KeyVal* NextSubkey; // If key is a dictionary, points to the next item
+ char* Subkey; // If key is a dictionary, points to the subkey name
char* Value; // Points to value
WRITEMODE WriteAs; // How to write the value
@@ -191,7 +201,12 @@ typedef struct _Table {
} TABLE, *LPTABLE;
+// File stream being parsed
+typedef struct _FileContext {
+ char FileName[MAX_PATH]; // File name if being readed from file
+ FILE* Stream; // File stream or NULL if holded in memory
+ } FILECTX, *LPFILECTX;
// This struct hold all information about an openened
// IT8 handler. Only one dataset is allowed.
@@ -228,9 +243,9 @@ typedef struct {
char* Source; // Points to loc. being parsed
int lineno; // line counter for error reporting
- char FileName[MAX_PATH]; // File name if being readed from file
- FILE* Stream[MAXINCLUDE]; // File stream or NULL if holded in memory
+ LPFILECTX FileStack[MAXINCLUDE]; // Stack of files being parsed
int IncludeSP; // Include Stack Pointer
+
char* MemoryBlock; // The stream if holded in memory
char DoubleFormatter[MAXID]; // Printf-like 'double' formatter
@@ -241,14 +256,14 @@ typedef struct {
typedef struct {
- FILE* stream; // For save-to-file behaviour
+ FILE* stream; // For save-to-file behaviour
- LPBYTE Base;
- LPBYTE Ptr; // For save-to-mem behaviour
- size_t Used;
- size_t Max;
+ LPBYTE Base;
+ LPBYTE Ptr; // For save-to-mem behaviour
+ size_t Used;
+ size_t Max;
- } SAVESTREAM, FAR* LPSAVESTREAM;
+ } SAVESTREAM, FAR* LPSAVESTREAM;
// ------------------------------------------------------ IT8 parsing routines
@@ -269,58 +284,104 @@ static const KEYWORD TabKeys[] = {
{".INCLUDE", SINCLUDE},
{"BEGIN_DATA", SBEGIN_DATA },
{"BEGIN_DATA_FORMAT", SBEGIN_DATA_FORMAT },
+ {"DATA_FORMAT_IDENTIFIER", SDATA_FORMAT_ID},
{"END_DATA", SEND_DATA},
{"END_DATA_FORMAT", SEND_DATA_FORMAT},
{"KEYWORD", SKEYWORD}
-
};
#define NUMKEYS (sizeof(TabKeys)/sizeof(KEYWORD))
// Predefined properties
-static const char* PredefinedProperties[] = {
-
- "NUMBER_OF_FIELDS", // Required - NUMBER OF FIELDS
- "NUMBER_OF_SETS", // Required - NUMBER OF SETS
- "ORIGINATOR", // Required - Identifies the specific system, organization or individual that created the data file.
- "CREATED", // Required - Indicates date of creation of the data file.
- "DESCRIPTOR", // Required - Describes the purpose or contents of the data file.
- "DIFFUSE_GEOMETRY", // The diffuse geometry used. Allowed values are "sphere" or "opal".
- "MANUFACTURER",
- "MANUFACTURE", // Some broken Fuji targets does store this value
- "PROD_DATE", // Identifies year and month of production of the target in the form yyyy:mm.
- "SERIAL", // Uniquely identifies individual physical target.
-
- "MATERIAL", // Identifies the material on which the target was produced using a code
+// A property
+typedef struct {
+ const char *id;
+ WRITEMODE as;
+ } PROPERTY;
+
+static PROPERTY PredefinedProperties[] = {
+
+ {"NUMBER_OF_FIELDS", WRITE_UNCOOKED}, // Required - NUMBER OF FIELDS
+ {"NUMBER_OF_SETS", WRITE_UNCOOKED}, // Required - NUMBER OF SETS
+ {"ORIGINATOR", WRITE_STRINGIFY}, // Required - Identifies the specific system, organization or individual that created the data file.
+ {"FILE_DESCRIPTOR", WRITE_STRINGIFY}, // Required - Describes the purpose or contents of the data file.
+ {"CREATED", WRITE_STRINGIFY}, // Required - Indicates date of creation of the data file.
+ {"DESCRIPTOR", WRITE_STRINGIFY}, // Required - Describes the purpose or contents of the data file.
+ {"DIFFUSE_GEOMETRY", WRITE_STRINGIFY}, // The diffuse geometry used. Allowed values are "sphere" or "opal".
+ {"MANUFACTURER", WRITE_STRINGIFY},
+ {"MANUFACTURE", WRITE_STRINGIFY}, // Some broken Fuji targets does store this value
+ {"PROD_DATE", WRITE_STRINGIFY}, // Identifies year and month of production of the target in the form yyyy:mm.
+ {"SERIAL", WRITE_STRINGIFY}, // Uniquely identifies individual physical target.
+
+ {"MATERIAL", WRITE_STRINGIFY}, // Identifies the material on which the target was produced using a code
// uniquely identifying th e material. This is intend ed to be used for IT8.7
// physical targets only (i.e . IT8.7/1 a nd IT8.7/2).
- "INSTRUMENTATION", // Used to report the specific instrumentation used (manufacturer and
+ {"INSTRUMENTATION", WRITE_STRINGIFY}, // Used to report the specific instrumentation used (manufacturer and
// model number) to generate the data reported. This data will often
// provide more information about the particular data collected than an
// extensive list of specific details. This is particularly important for
// spectral data or data derived from spectrophotometry.
- "MEASUREMENT_SOURCE", // Illumination used for spectral measurements. This data helps provide
+ {"MEASUREMENT_SOURCE", WRITE_STRINGIFY}, // Illumination used for spectral measurements. This data helps provide
// a guide to the potential for issues of paper fluorescence, etc.
- "PRINT_CONDITIONS", // Used to define the characteristics of the printed sheet being reported.
+ {"PRINT_CONDITIONS", WRITE_STRINGIFY}, // Used to define the characteristics of the printed sheet being reported.
// Where standard conditions have been defined (e.g., SWOP at nominal)
// named conditions may suffice. Otherwise, detailed information is
// needed.
- "SAMPLE_BACKING", // Identifies the backing material used behind the sample during
- // measurement. Allowed values are “black”, “white”, or "na".
-
- "CHISQ_DOF" // Degrees of freedom associated with the Chi squared statistic
+ {"SAMPLE_BACKING", WRITE_STRINGIFY}, // Identifies the backing material used behind the sample during
+ // measurement. Allowed values are “black”, “white”, or {"na".
+
+ {"CHISQ_DOF", WRITE_STRINGIFY}, // Degrees of freedom associated with the Chi squared statistic
+
+// new in recent specs:
+ {"MEASUREMENT_GEOMETRY", WRITE_STRINGIFY}, // The type of measurement, either reflection or transmission, should be indicated
+ // along with details of the geometry and the aperture size and shape. For example,
+ // for transmission measurements it is important to identify 0/diffuse, diffuse/0,
+ // opal or integrating sphere, etc. For reflection it is important to identify 0/45,
+ // 45/0, sphere (specular included or excluded), etc.
+
+ {"FILTER", WRITE_STRINGIFY}, // Identifies the use of physical filter(s) during measurement. Typically used to
+ // denote the use of filters such as none, D65, Red, Green or Blue.
+
+ {"POLARIZATION", WRITE_STRINGIFY}, // Identifies the use of a physical polarization filter during measurement. Allowed
+ // values are {"yes”, “white”, “none” or “na”.
+
+ {"WEIGHTING_FUNCTION", WRITE_PAIR}, // Indicates such functions as: the CIE standard observer functions used in the
+ // calculation of various data parameters (2 degree and 10 degree), CIE standard
+ // illuminant functions used in the calculation of various data parameters (e.g., D50,
+ // D65, etc.), density status response, etc. If used there shall be at least one
+ // name-value pair following the WEIGHTING_FUNCTION tag/keyword. The first attribute
+ // in the set shall be {"name" and shall identify the particular parameter used.
+ // The second shall be {"value" and shall provide the value associated with that name.
+ // For ASCII data, a string containing the Name and Value attribute pairs shall follow
+ // the weighting function keyword. A semi-colon separates attribute pairs from each
+ // other and within the attribute the name and value are separated by a comma.
+
+ {"COMPUTATIONAL_PARAMETER", WRITE_PAIR}, // Parameter that is used in computing a value from measured data. Name is the name
+ // of the calculation, parameter is the name of the parameter used in the calculation
+ // and value is the value of the parameter.
+
+ {"TARGET_TYPE", WRITE_STRINGIFY}, // The type of target being measured, e.g. IT8.7/1, IT8.7/3, user defined, etc.
+
+ {"COLORANT", WRITE_STRINGIFY}, // Identifies the colorant(s) used in creating the target.
+
+ {"TABLE_DESCRIPTOR", WRITE_STRINGIFY}, // Describes the purpose or contents of a data table.
+
+ {"TABLE_NAME", WRITE_STRINGIFY} // Provides a short name for a data table.
};
-#define NUMPREDEFINEDPROPS (sizeof(PredefinedProperties)/sizeof(char *))
+#define NUMPREDEFINEDPROPS (sizeof(PredefinedProperties)/sizeof(PROPERTY))
// Predefined sample types on dataset
static const char* PredefinedSampleID[] = {
+ "SAMPLE_ID", // Identifies sample that data represents
+ "STRING", // Identifies label, or other non-machine readable value.
+ // Value must begin and end with a " symbol
"CMYK_C", // Cyan component of CMYK data expressed as a percentage
"CMYK_M", // Magenta component of CMYK data expressed as a percentage
@@ -348,7 +409,7 @@ static const char* PredefinedSampleID[] = {
"LAB_B", // b* component of Lab data
"LAB_C", // C*ab component of Lab data
"LAB_H", // hab component of Lab data
- "LAB_DE" // CIE dE
+ "LAB_DE", // CIE dE
"LAB_DE_94", // CIE dE using CIE 94
"LAB_DE_CMC", // dE using CMC
"LAB_DE_2000", // CIE dE using CIE DE 2000
@@ -358,7 +419,7 @@ static const char* PredefinedSampleID[] = {
"STDEV_Y", // Standard deviation of Y (tristimulus data)
"STDEV_Z", // Standard deviation of Z (tristimulus data)
"STDEV_L", // Standard deviation of L*
- "STDEV_A" // Standard deviation of a*
+ "STDEV_A", // Standard deviation of a*
"STDEV_B", // Standard deviation of b*
"STDEV_DE", // Standard deviation of CIE dE
"CHI_SQD_PAR"}; // The average of the standard deviations of L*, a* and b*. It is
@@ -367,52 +428,119 @@ static const char* PredefinedSampleID[] = {
#define NUMPREDEFINEDSAMPLEID (sizeof(PredefinedSampleID)/sizeof(char *))
+//Forward declaration of some internal functions
+static
+void* AllocChunk(LPIT8 it8, size_t size);
-// Checks whatsever if c is a valid identifier middle char.
+// Checks if c is a separator
static
-BOOL isidchar(int c)
+LCMSBOOL isseparator(int c)
{
- return (isalnum(c) || c == '$' || c == '%' || c == '&' || c == '/' || c == '.' || c == '_');
+ return (c == ' ') || (c == '\t') || (c == '\r');
+}
+// Checks whatever if c is a valid identifier char
+static
+LCMSBOOL ismiddle(int c)
+{
+ return (!isseparator(c) && (c != '#') && (c !='\"') && (c != '\'') && (c > 32) && (c < 127));
+}
+
+// Checks whatsever if c is a valid identifier middle char.
+static
+LCMSBOOL isidchar(int c)
+{
+ return isalnum(c) || ismiddle(c);
}
// Checks whatsever if c is a valid identifier first char.
static
-BOOL isfirstidchar(int c)
+LCMSBOOL isfirstidchar(int c)
{
- return !isdigit(c) && isidchar(c);
+ return !isdigit(c) && ismiddle(c);
}
-// Checks if c is a separator
+// checks whether the supplied path looks like an absolute path
+// NOTE: this function doesn't checks if the path exists or even if it's legal
static
-BOOL isseparator(int c)
+LCMSBOOL isabsolutepath(const char *path)
{
- return (c == ' ' || c == '\t' || c == '\r');
+ if(path == NULL)
+ return FALSE;
+
+ if(path[0] == DIR_CHAR)
+ return TRUE;
+
+#ifndef NON_WINDOWS
+ if(isalpha(path[0]) && path[1] == ':')
+ return TRUE;
+#endif
+ return FALSE;
}
+// Makes a file path based on a given reference path
+// NOTE: buffer is assumed to point to at least MAX_PATH bytes
+// NOTE: both relPath and basePath are assumed to be no more than MAX_PATH characters long (including the null terminator!)
+// NOTE: this function doesn't check if the path exists or even if it's legal
+static
+LCMSBOOL _cmsMakePath(const char *relPath, const char *basePath, char *buffer)
+{
+ if (!isabsolutepath(relPath)) {
+
+ char *tail;
+
+ strncpy(buffer, basePath, MAX_PATH-1);
+ tail = strrchr(buffer, DIR_CHAR);
+ if (tail != NULL) {
+
+ size_t len = tail - buffer;
+ strncpy(tail + 1, relPath, MAX_PATH - len -1);
+ // TODO: if combined path is longer than MAX_PATH, this should return FALSE!
+ return TRUE;
+ }
+ }
+ strncpy(buffer, relPath, MAX_PATH - 1);
+ return TRUE;
+}
+
+
+// Make sure no exploit is being even tried
+
+static
+const char* NoMeta(const char* str)
+{
+ if (strchr(str, '%') != NULL)
+ return "**** CORRUPTED FORMAT STRING ***";
+
+ return str;
+}
+// Syntax error
static
-BOOL SynError(LPIT8 it8, const char *Txt, ...)
+LCMSBOOL SynError(LPIT8 it8, const char *Txt, ...)
{
char Buffer[256], ErrMsg[1024];
va_list args;
va_start(args, Txt);
- vsprintf(Buffer, Txt, args);
+ vsnprintf(Buffer, 255, Txt, args);
+ Buffer[255] = 0;
va_end(args);
- sprintf(ErrMsg, "%s: Line %d, %s", it8->FileName, it8->lineno, Buffer);
+ snprintf(ErrMsg, 1023, "%s: Line %d, %s", it8->FileStack[it8 ->IncludeSP]->FileName, it8->lineno, Buffer);
+ ErrMsg[1023] = 0;
it8->sy = SSYNERROR;
- cmsSignalError(LCMS_ERRC_ABORTED, ErrMsg);
+ cmsSignalError(LCMS_ERRC_ABORTED, "%s", ErrMsg);
return FALSE;
}
+// Check if current symbol is same as specified. issue an error else.
static
-BOOL Check(LPIT8 it8, SYMBOL sy, const char* Err)
+LCMSBOOL Check(LPIT8 it8, SYMBOL sy, const char* Err)
{
if (it8 -> sy != sy)
- return SynError(it8, Err);
+ return SynError(it8, NoMeta(Err));
return TRUE;
}
@@ -422,15 +550,15 @@ BOOL Check(LPIT8 it8, SYMBOL sy, const char* Err)
static
void NextCh(LPIT8 it8)
{
- if (it8 -> Stream[it8 ->IncludeSP]) {
+ if (it8 -> FileStack[it8 ->IncludeSP]->Stream) {
- it8 ->ch = fgetc(it8 ->Stream[it8 ->IncludeSP]);
+ it8 ->ch = fgetc(it8 ->FileStack[it8 ->IncludeSP]->Stream);
- if (feof(it8 -> Stream[it8 ->IncludeSP])) {
+ if (feof(it8 -> FileStack[it8 ->IncludeSP]->Stream)) {
if (it8 ->IncludeSP > 0) {
- fclose(it8 ->Stream[it8->IncludeSP--]);
+ fclose(it8 ->FileStack[it8->IncludeSP--]->Stream);
it8 -> ch = ' '; // Whitespace to be ignored
} else
@@ -441,7 +569,6 @@ void NextCh(LPIT8 it8)
}
else {
-
it8->ch = *it8->Source;
if (it8->ch) it8->Source++;
}
@@ -764,18 +891,39 @@ void InSymbol(LPIT8 it8)
if (it8 -> sy == SINCLUDE) {
- FILE* IncludeFile;
+ LPFILECTX FileNest;
+
+ if(it8 -> IncludeSP >= (MAXINCLUDE-1))
+ {
+ SynError(it8, "Too many recursion levels");
+ return;
+ }
InSymbol(it8);
if (!Check(it8, SSTRING, "Filename expected")) return;
- IncludeFile = fopen(it8 -> str, "rt");
- if (IncludeFile == NULL) {
- SynError(it8, "File %s not found", it8 ->str);
+ FileNest = it8 -> FileStack[it8 -> IncludeSP + 1];
+ if(FileNest == NULL)
+ {
+ FileNest = it8 ->FileStack[it8 -> IncludeSP + 1] = (LPFILECTX)AllocChunk(it8, sizeof(FILECTX));
+ //if(FileNest == NULL)
+ // TODO: how to manage out-of-memory conditions?
+ }
+
+ if(_cmsMakePath(it8->str, it8->FileStack[it8->IncludeSP]->FileName, FileNest->FileName) == FALSE)
+ {
+ SynError(it8, "File path too long");
+ return;
+ }
+
+ FileNest->Stream = fopen(FileNest->FileName, "rt");
+ if (FileNest->Stream == NULL) {
+
+ SynError(it8, "File %s not found", FileNest->FileName);
return;
}
+ it8->IncludeSP++;
- it8 -> Stream[++it8 -> IncludeSP] = IncludeFile;
it8 ->ch = ' ';
InSymbol(it8);
}
@@ -784,7 +932,7 @@ void InSymbol(LPIT8 it8)
// Checks end of line separator
static
-BOOL CheckEOLN(LPIT8 it8)
+LCMSBOOL CheckEOLN(LPIT8 it8)
{
if (!Check(it8, SEOLN, "Expected separator")) return FALSE;
while (it8 -> sy == SEOLN)
@@ -815,29 +963,36 @@ void SkipEOLN(LPIT8 it8)
// Returns a string holding current value
static
-BOOL GetVal(LPIT8 it8, char* Buffer, const char* ErrorTitle)
+LCMSBOOL GetVal(LPIT8 it8, char* Buffer, size_t max, const char* ErrorTitle)
{
switch (it8->sy) {
- case SIDENT: strncpy(Buffer, it8->id, MAXID-1); break;
- case SINUM: sprintf(Buffer, "%d", it8 -> inum); break;
- case SDNUM: sprintf(Buffer, it8->DoubleFormatter, it8 -> dnum); break;
- case SSTRING: strncpy(Buffer, it8->str, MAXSTR-1); break;
+ case SIDENT: strncpy(Buffer, it8->id, max); break;
+ case SINUM: snprintf(Buffer, max, "%d", it8 -> inum); break;
+ case SDNUM: snprintf(Buffer, max, it8->DoubleFormatter, it8 -> dnum); break;
+ case SSTRING: strncpy(Buffer, it8->str, max); break;
default:
- return SynError(it8, ErrorTitle);
+ return SynError(it8, "%s", ErrorTitle);
}
- return TRUE;
+ Buffer[max] = 0;
+ return TRUE;
}
// ---------------------------------------------------------- Table
static
LPTABLE GetTable(LPIT8 it8)
-{
- return it8 ->Tab + it8 ->nTable;
+{
+ if ((it8 -> nTable >= it8 ->TablesCount) || (it8 -> nTable < 0)) {
+
+ SynError(it8, "Table %d out of sequence", it8 -> nTable);
+ return it8 -> Tab;
+ }
+
+ return it8 ->Tab + it8 ->nTable;
}
// ---------------------------------------------------------- Memory management
@@ -861,15 +1016,15 @@ void LCMSEXPORT cmsIT8Free(LCMSHANDLE hIT8)
for (p = it8->MemorySink; p != NULL; p = n) {
n = p->Next;
- if (p->Ptr) free(p->Ptr);
- free(p);
+ if (p->Ptr) _cmsFree(p->Ptr);
+ _cmsFree(p);
}
}
if (it8->MemoryBlock)
- free(it8->MemoryBlock);
+ _cmsFree(it8->MemoryBlock);
- free(it8);
+ _cmsFree(it8);
}
@@ -878,16 +1033,16 @@ static
void* AllocBigBlock(LPIT8 it8, size_t size)
{
LPOWNEDMEM ptr1;
- void* ptr = malloc(size);
+ void* ptr = _cmsMalloc(size);
if (ptr) {
ZeroMemory(ptr, size);
- ptr1 = (LPOWNEDMEM) malloc(sizeof(OWNEDMEM));
+ ptr1 = (LPOWNEDMEM) _cmsMalloc(sizeof(OWNEDMEM));
if (ptr1 == NULL) {
- free(ptr);
+ _cmsFree(ptr);
return NULL;
}
@@ -951,8 +1106,9 @@ char *AllocString(LPIT8 it8, const char* str)
// Searches through linked list
static
-BOOL IsAvailableOnList(LPKEYVALUE p, const char* Key, LPKEYVALUE* LastPtr)
+LCMSBOOL IsAvailableOnList(LPKEYVALUE p, const char* Key, const char* Subkey, LPKEYVALUE* LastPtr)
{
+ if (LastPtr) *LastPtr = p;
for (; p != NULL; p = p->Next) {
@@ -961,8 +1117,22 @@ BOOL IsAvailableOnList(LPKEYVALUE p, const char* Key, LPKEYVALUE* LastPtr)
if (*Key != '#') { // Comments are ignored
if (stricmp(Key, p->Keyword) == 0)
- return TRUE;
+ break;
+ }
}
+
+ if (p == NULL)
+ return FALSE;
+
+ if (Subkey == 0)
+ return TRUE;
+
+ for (; p != NULL; p = p->NextSubkey) {
+
+ if (LastPtr) *LastPtr = p;
+
+ if (stricmp(Subkey, p->Subkey) == 0)
+ return TRUE;
}
return FALSE;
@@ -972,66 +1142,77 @@ BOOL IsAvailableOnList(LPKEYVALUE p, const char* Key, LPKEYVALUE* LastPtr)
// Add a property into a linked list
static
-BOOL AddToList(LPIT8 it8, LPKEYVALUE* Head, const char *Key, const char* xValue, WRITEMODE WriteAs)
+LPKEYVALUE AddToList(LPIT8 it8, LPKEYVALUE* Head, const char *Key, const char *Subkey, const char* xValue, WRITEMODE WriteAs)
{
LPKEYVALUE p;
- LPKEYVALUE last;
-
// Check if property is already in list (this is an error)
- if (IsAvailableOnList(*Head, Key, &last)) {
+ if (IsAvailableOnList(*Head, Key, Subkey, &p)) {
- // This may work for editing properties
+ // This may work for editing properties
- last->Value = AllocString(it8, xValue);
- last->WriteAs = WriteAs;
- return TRUE;
-
- // return SynError(it8, "duplicate key <%s>", Key);
+ // return SynError(it8, "duplicate key <%s>", Key);
}
+ else {
+ LPKEYVALUE last = p;
- // Allocate the container
+ // Allocate the container
p = (LPKEYVALUE) AllocChunk(it8, sizeof(KEYVALUE));
if (p == NULL)
{
- return SynError(it8, "AddToList: out of memory");
+ SynError(it8, "AddToList: out of memory");
+ return NULL;
}
// Store name and value
p->Keyword = AllocString(it8, Key);
-
- if (xValue != NULL) {
-
- p->Value = AllocString(it8, xValue);
+ p->Subkey = (Subkey == NULL) ? NULL : AllocString(it8, Subkey);
+
+ // Keep the container in our list
+ if (*Head == NULL)
+ *Head = p;
+ else
+ {
+ if(Subkey != 0 && last != 0) {
+ last->NextSubkey = p;
+
+ // If Subkey is not null, then last is the last property with the same key,
+ // but not necessarily is the last property in the list, so we need to move
+ // to the actual list end
+ while(last->Next != 0)
+ last = last->Next;
}
- else {
- p->Value = NULL;
+ last->Next = p;
}
p->Next = NULL;
+ p->NextSubkey = NULL;
+ }
+
p->WriteAs = WriteAs;
+ if (xValue != NULL) {
- // Keep the container in our list
- if (*Head == NULL)
- *Head = p;
- else
- last->Next = p;
+ p->Value = AllocString(it8, xValue);
+ }
+ else {
+ p->Value = NULL;
+ }
- return TRUE;
+ return p;
}
static
-BOOL AddAvailableProperty(LPIT8 it8, const char* Key)
+LPKEYVALUE AddAvailableProperty(LPIT8 it8, const char* Key, WRITEMODE as)
{
- return AddToList(it8, &it8->ValidKeywords, Key, NULL, WRITE_UNCOOKED);
+ return AddToList(it8, &it8->ValidKeywords, Key, NULL, NULL, as);
}
static
-BOOL AddAvailableSampleID(LPIT8 it8, const char* Key)
+LPKEYVALUE AddAvailableSampleID(LPIT8 it8, const char* Key)
{
- return AddToList(it8, &it8->ValidSampleID, Key, NULL, WRITE_UNCOOKED);
+ return AddToList(it8, &it8->ValidSampleID, Key, NULL, NULL, WRITE_UNCOOKED);
}
@@ -1079,7 +1260,7 @@ LCMSHANDLE LCMSEXPORT cmsIT8Alloc(void)
LPIT8 it8;
int i;
- it8 = (LPIT8) malloc(sizeof(IT8));
+ it8 = (LPIT8) malloc(sizeof(IT8));
if (it8 == NULL) return NULL;
ZeroMemory(it8, sizeof(IT8));
@@ -1087,8 +1268,6 @@ LCMSHANDLE LCMSEXPORT cmsIT8Alloc(void)
AllocTable(it8);
it8->MemoryBlock = NULL;
- it8->Stream[0] = NULL;
- it8->IncludeSP = 0;
it8->MemorySink = NULL;
it8 ->nTable = 0;
@@ -1106,6 +1285,8 @@ LCMSHANDLE LCMSEXPORT cmsIT8Alloc(void)
it8 -> inum = 0;
it8 -> dnum = 0.0;
+ it8->FileStack[0] = (LPFILECTX)AllocChunk(it8, sizeof(FILECTX));
+ it8->IncludeSP = 0;
it8 -> lineno = 1;
strcpy(it8->DoubleFormatter, DEFAULT_DBL_FORMAT);
@@ -1114,7 +1295,7 @@ LCMSHANDLE LCMSEXPORT cmsIT8Alloc(void)
// Initialize predefined properties & data
for (i=0; i < NUMPREDEFINEDPROPS; i++)
- AddAvailableProperty(it8, PredefinedProperties[i]);
+ AddAvailableProperty(it8, PredefinedProperties[i].id, PredefinedProperties[i].as);
for (i=0; i < NUMPREDEFINEDSAMPLEID; i++)
AddAvailableSampleID(it8, PredefinedSampleID[i]);
@@ -1132,7 +1313,7 @@ const char* LCMSEXPORT cmsIT8GetSheetType(LCMSHANDLE hIT8)
}
-BOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type)
+LCMSBOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type)
{
LPIT8 it8 = (LPIT8) hIT8;
@@ -1140,57 +1321,63 @@ BOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type)
return TRUE;
}
-BOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* Val)
{
LPIT8 it8 = (LPIT8) hIT8;
if (!Val) return FALSE;
if (!*Val) return FALSE;
- return AddToList(it8, &GetTable(it8)->HeaderList, "# ", Val, WRITE_UNCOOKED);
+ return AddToList(it8, &GetTable(it8)->HeaderList, "# ", NULL, Val, WRITE_UNCOOKED) != NULL;
}
// Sets a property
-BOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* Key, const char *Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* Key, const char *Val)
{
LPIT8 it8 = (LPIT8) hIT8;
if (!Val) return FALSE;
if (!*Val) return FALSE;
- return AddToList(it8, &GetTable(it8)->HeaderList, Key, Val, WRITE_STRINGIFY);
+ return AddToList(it8, &GetTable(it8)->HeaderList, Key, NULL, Val, WRITE_STRINGIFY) != NULL;
}
-BOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val)
{
LPIT8 it8 = (LPIT8) hIT8;
char Buffer[1024];
sprintf(Buffer, it8->DoubleFormatter, Val);
- return AddToList(it8, &GetTable(it8)->HeaderList, cProp, Buffer, WRITE_UNCOOKED);
+ return AddToList(it8, &GetTable(it8)->HeaderList, cProp, NULL, Buffer, WRITE_UNCOOKED) != NULL;
}
-BOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val)
{
LPIT8 it8 = (LPIT8) hIT8;
char Buffer[1024];
sprintf(Buffer, "%d", Val);
- return AddToList(it8, &GetTable(it8)->HeaderList, cProp, Buffer, WRITE_HEXADECIMAL);
+ return AddToList(it8, &GetTable(it8)->HeaderList, cProp, NULL, Buffer, WRITE_HEXADECIMAL) != NULL;
}
-BOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer)
+LCMSBOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer)
{
LPIT8 it8 = (LPIT8) hIT8;
- return AddToList(it8, &GetTable(it8)->HeaderList, Key, Buffer, WRITE_UNCOOKED);
+ return AddToList(it8, &GetTable(it8)->HeaderList, Key, NULL, Buffer, WRITE_UNCOOKED) != NULL;
}
+LCMSBOOL LCMSEXPORT cmsIT8SetPropertyMulti(LCMSHANDLE hIT8, const char* Key, const char* SubKey, const char *Buffer)
+{
+ LPIT8 it8 = (LPIT8) hIT8;
+
+ return AddToList(it8, &GetTable(it8)->HeaderList, Key, SubKey, Buffer, WRITE_PAIR) != NULL;
+}
// Gets a property
const char* LCMSEXPORT cmsIT8GetProperty(LCMSHANDLE hIT8, const char* Key)
@@ -1198,7 +1385,7 @@ const char* LCMSEXPORT cmsIT8GetProperty(LCMSHANDLE hIT8, const char* Key)
LPIT8 it8 = (LPIT8) hIT8;
LPKEYVALUE p;
- if (IsAvailableOnList(GetTable(it8) -> HeaderList, Key, &p))
+ if (IsAvailableOnList(GetTable(it8) -> HeaderList, Key, NULL, &p))
{
return p -> Value;
}
@@ -1214,6 +1401,18 @@ double LCMSEXPORT cmsIT8GetPropertyDbl(LCMSHANDLE hIT8, const char* cProp)
else return 0.0;
}
+const char* LCMSEXPORT cmsIT8GetPropertyMulti(LCMSHANDLE hIT8, const char* Key, const char *SubKey)
+{
+ LPIT8 it8 = (LPIT8) hIT8;
+ LPKEYVALUE p;
+
+ if (IsAvailableOnList(GetTable(it8) -> HeaderList, Key, SubKey, &p))
+ {
+ return p -> Value;
+ }
+ return NULL;
+}
+
// ----------------------------------------------------------------- Datasets
@@ -1252,10 +1451,17 @@ const char *GetDataFormat(LPIT8 it8, int n)
}
static
-BOOL SetDataFormat(LPIT8 it8, int n, const char *label)
+LCMSBOOL SetDataFormat(LPIT8 it8, int n, const char *label)
{
LPTABLE t = GetTable(it8);
+#ifdef STRICT_CGATS
+ if (!IsAvailableOnList(it8-> ValidSampleID, label, NULL, NULL)) {
+ SynError(it8, "Invalid data format '%s'.", label);
+ return FALSE;
+ }
+#endif
+
if (!t->DataFormat)
AllocateDataFormat(it8);
@@ -1273,7 +1479,7 @@ BOOL SetDataFormat(LPIT8 it8, int n, const char *label)
}
-BOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE h, int n, const char *Sample)
+LCMSBOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE h, int n, const char *Sample)
{
LPIT8 it8 = (LPIT8) h;
return SetDataFormat(it8, n, Sample);
@@ -1313,7 +1519,7 @@ char* GetData(LPIT8 it8, int nSet, int nField)
}
static
-BOOL SetData(LPIT8 it8, int nSet, int nField, const char *Val)
+LCMSBOOL SetData(LPIT8 it8, int nSet, int nField, const char *Val)
{
LPTABLE t = GetTable(it8);
@@ -1347,43 +1553,44 @@ BOOL SetData(LPIT8 it8, int nSet, int nField, const char *Val)
static
void WriteStr(LPSAVESTREAM f, const char *str)
{
-
- size_t len;
+
+ size_t len;
- if (str == NULL)
- str = " ";
-
- // Lenghth to write
- len = strlen(str);
+ if (str == NULL)
+ str = " ";
+
+ // Lenghth to write
+ len = strlen(str);
f ->Used += len;
-
-
- if (f ->stream) { // Should I write it to a file?
+
+
+ if (f ->stream) { // Should I write it to a file?
+
+ fwrite(str, 1, len, f->stream);
+
+ }
+ else { // Or to a memory block?
+
+
+ if (f ->Base) { // Am I just counting the bytes?
+
+ if (f ->Used > f ->Max) {
+
+ cmsSignalError(LCMS_ERRC_ABORTED, "Write to memory overflows in CGATS parser");
+ return;
+ }
+
+ CopyMemory(f ->Ptr, str, len);
+ f->Ptr += len;
+
+ }
+
+ }
+}
+
+
+// Write formatted
- fwrite(str, 1, len, f->stream);
-
- }
- else { // Or to a memory block?
-
-
- if (f ->Base) { // Am I just counting the bytes?
-
- if (f ->Used > f ->Max) {
-
- cmsSignalError(LCMS_ERRC_ABORTED, "Write to memory overflows in CGATS parser");
- return;
- }
-
- CopyMemory(f ->Ptr, str, len);
- f->Ptr += len;
-
- }
-
- }
-}
-
-
-//
static
void Writef(LPSAVESTREAM f, const char* frm, ...)
{
@@ -1391,7 +1598,8 @@ void Writef(LPSAVESTREAM f, const char* frm, ...)
va_list args;
va_start(args, frm);
- vsprintf(Buffer, frm, args);
+ vsnprintf(Buffer, 4095, frm, args);
+ Buffer[4095] = 0;
WriteStr(f, Buffer);
va_end(args);
@@ -1415,7 +1623,7 @@ void WriteHeader(LPIT8 it8, LPSAVESTREAM fp)
for (Pt = p ->Value; *Pt; Pt++) {
- Writef(fp, "%c", *Pt);
+ Writef(fp, "%c", *Pt);
if (*Pt == '\n') {
WriteStr(fp, "# ");
@@ -1427,7 +1635,7 @@ void WriteHeader(LPIT8 it8, LPSAVESTREAM fp)
}
- if (!IsAvailableOnList(it8-> ValidKeywords, p->Keyword, NULL)) {
+ if (!IsAvailableOnList(it8-> ValidKeywords, p->Keyword, NULL, NULL)) {
#ifdef STRICT_CGATS
WriteStr(fp, "KEYWORD\t\"");
@@ -1435,7 +1643,7 @@ void WriteHeader(LPIT8 it8, LPSAVESTREAM fp)
WriteStr(fp, "\"\n");
#endif
- AddAvailableProperty(it8, p->Keyword);
+ AddAvailableProperty(it8, p->Keyword, WRITE_UNCOOKED);
}
@@ -1460,6 +1668,10 @@ void WriteHeader(LPIT8 it8, LPSAVESTREAM fp)
Writef(fp, "\t0x%B", atoi(p ->Value));
break;
+ case WRITE_PAIR:
+ Writef(fp, "\t\"%s,%s\"", p->Subkey, p->Value);
+ break;
+
default: SynError(it8, "Unknown write mode %d", p ->WriteAs);
return;
}
@@ -1538,13 +1750,13 @@ void WriteData(LPSAVESTREAM fp, LPIT8 it8)
// Saves whole file
-BOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE hIT8, const char* cFileName)
+LCMSBOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE hIT8, const char* cFileName)
{
- SAVESTREAM sd;
+ SAVESTREAM sd;
int i;
LPIT8 it8 = (LPIT8) hIT8;
- ZeroMemory(&sd, sizeof(SAVESTREAM));
+ ZeroMemory(&sd, sizeof(SAVESTREAM));
sd.stream = fopen(cFileName, "wt");
if (!sd.stream) return FALSE;
@@ -1559,31 +1771,31 @@ BOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE hIT8, const char* cFileName)
WriteData(&sd, it8);
}
- fclose(sd.stream);
+ fclose(sd.stream);
return TRUE;
}
// Saves to memory
-BOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeeded)
+LCMSBOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeeded)
{
- SAVESTREAM sd;
+ SAVESTREAM sd;
int i;
LPIT8 it8 = (LPIT8) hIT8;
- ZeroMemory(&sd, sizeof(SAVESTREAM));
+ ZeroMemory(&sd, sizeof(SAVESTREAM));
sd.stream = NULL;
- sd.Base = MemPtr;
- sd.Ptr = sd.Base;
+ sd.Base = (LPBYTE) MemPtr;
+ sd.Ptr = sd.Base;
- sd.Used = 0;
+ sd.Used = 0;
- if (sd.Base)
- sd.Max = *BytesNeeded; // Write to memory?
- else
- sd.Max = 0; // Just counting the needed bytes
+ if (sd.Base)
+ sd.Max = *BytesNeeded; // Write to memory?
+ else
+ sd.Max = 0; // Just counting the needed bytes
WriteStr(&sd, it8->SheetType);
WriteStr(&sd, "\n");
@@ -1595,12 +1807,12 @@ BOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeed
WriteData(&sd, it8);
}
- sd.Used++; // The \0 at the very end
+ sd.Used++; // The \0 at the very end
- if (sd.Base)
- sd.Ptr = 0;
+ if (sd.Base)
+ sd.Ptr = 0;
- *BytesNeeded = sd.Used;
+ *BytesNeeded = sd.Used;
return TRUE;
}
@@ -1609,7 +1821,7 @@ BOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeed
// -------------------------------------------------------------- Higer level parsing
static
-BOOL DataFormatSection(LPIT8 it8)
+LCMSBOOL DataFormatSection(LPIT8 it8)
{
int iField = 0;
LPTABLE t = GetTable(it8);
@@ -1650,16 +1862,19 @@ BOOL DataFormatSection(LPIT8 it8)
static
-BOOL DataSection (LPIT8 it8)
+LCMSBOOL DataSection (LPIT8 it8)
{
int iField = 0;
int iSet = 0;
- char Buffer[256];
+ char Buffer[MAXSTR];
LPTABLE t = GetTable(it8);
InSymbol(it8); // Eats "BEGIN_DATA"
CheckEOLN(it8);
+ if (!t->Data)
+ AllocateDataSet(it8);
+
while (it8->sy != SEND_DATA && it8->sy != SEOF)
{
if (iField >= t -> nSamples) {
@@ -1670,7 +1885,7 @@ BOOL DataSection (LPIT8 it8)
if (it8->sy != SEND_DATA && it8->sy != SEOF) {
- if (!GetVal(it8, Buffer, "Sample data expected"))
+ if (!GetVal(it8, Buffer, 255, "Sample data expected"))
return FALSE;
if (!SetData(it8, iSet, iField, Buffer))
@@ -1699,10 +1914,11 @@ BOOL DataSection (LPIT8 it8)
static
-BOOL HeaderSection(LPIT8 it8)
+LCMSBOOL HeaderSection(LPIT8 it8)
{
char VarName[MAXID];
char Buffer[MAXSTR];
+ LPKEYVALUE Key;
while (it8->sy != SEOF &&
it8->sy != SSYNERROR &&
@@ -1714,8 +1930,16 @@ BOOL HeaderSection(LPIT8 it8)
case SKEYWORD:
InSymbol(it8);
- if (!GetVal(it8, Buffer, "Keyword expected")) return FALSE;
- if (!AddAvailableProperty(it8, Buffer)) return FALSE;
+ if (!GetVal(it8, Buffer, MAXSTR-1, "Keyword expected")) return FALSE;
+ if (!AddAvailableProperty(it8, Buffer, WRITE_UNCOOKED)) return FALSE;
+ InSymbol(it8);
+ break;
+
+
+ case SDATA_FORMAT_ID:
+ InSymbol(it8);
+ if (!GetVal(it8, Buffer, MAXSTR-1, "Keyword expected")) return FALSE;
+ if (!AddAvailableSampleID(it8, Buffer)) return FALSE;
InSymbol(it8);
break;
@@ -1723,22 +1947,62 @@ BOOL HeaderSection(LPIT8 it8)
case SIDENT:
strncpy(VarName, it8->id, MAXID-1);
- if (!IsAvailableOnList(it8-> ValidKeywords, VarName, NULL)) {
+ if (!IsAvailableOnList(it8-> ValidKeywords, VarName, NULL, &Key)) {
#ifdef STRICT_CGATS
return SynError(it8, "Undefined keyword '%s'", VarName);
#else
- if (!AddAvailableProperty(it8, VarName)) return FALSE;
+ Key = AddAvailableProperty(it8, VarName, WRITE_UNCOOKED);
+ if (Key == NULL) return FALSE;
#endif
}
InSymbol(it8);
- if (!GetVal(it8, Buffer, "Property data expected")) return FALSE;
-
-
- AddToList(it8, &GetTable(it8)->HeaderList, VarName, Buffer,
- (it8->sy == SSTRING) ? WRITE_STRINGIFY : WRITE_UNCOOKED);
-
+ if (!GetVal(it8, Buffer, MAXSTR-1, "Property data expected")) return FALSE;
+
+ if(Key->WriteAs != WRITE_PAIR) {
+ AddToList(it8, &GetTable(it8)->HeaderList, VarName, NULL, Buffer,
+ (it8->sy == SSTRING) ? WRITE_STRINGIFY : WRITE_UNCOOKED);
+ }
+ else {
+ const char *Subkey;
+ char *Nextkey;
+ if (it8->sy != SSTRING)
+ return SynError(it8, "Invalid value '%s' for property '%s'.", Buffer, VarName);
+
+ // chop the string as a list of "subkey, value" pairs, using ';' as a separator
+ for(Subkey = Buffer; Subkey != NULL; Subkey = Nextkey)
+ {
+ char *Value, *temp;
+
+ // identify token pair boundary
+ Nextkey = (char*) strchr(Subkey, ';');
+ if(Nextkey)
+ *Nextkey++ = '\0';
+
+ // for each pair, split the subkey and the value
+ Value = (char*) strrchr(Subkey, ',');
+ if(Value == NULL)
+ return SynError(it8, "Invalid value for property '%s'.", VarName);
+
+ // gobble the spaces before the coma, and the coma itself
+ temp = Value++;
+ do *temp-- = '\0'; while(temp >= Subkey && *temp == ' ');
+
+ // gobble any space at the right
+ temp = Value + strlen(Value) - 1;
+ while(*temp == ' ') *temp-- = '\0';
+
+ // trim the strings from the left
+ Subkey += strspn(Subkey, " ");
+ Value += strspn(Value, " ");
+
+ if(Subkey[0] == 0 || Value[0] == 0)
+ return SynError(it8, "Invalid value for property '%s'.", VarName);
+ AddToList(it8, &GetTable(it8)->HeaderList, VarName, Subkey, Value, WRITE_PAIR);
+ }
+ }
+
InSymbol(it8);
break;
@@ -1758,22 +2022,23 @@ BOOL HeaderSection(LPIT8 it8)
static
-BOOL ParseIT8(LPIT8 it8)
+LCMSBOOL ParseIT8(LPIT8 it8, LCMSBOOL nosheet)
{
- char* SheetTypePtr;
+ char* SheetTypePtr = it8 ->SheetType;
+
+ if (nosheet == 0) {
// First line is a very special case.
while (isseparator(it8->ch))
NextCh(it8);
- SheetTypePtr = it8 ->SheetType;
-
- while (it8->ch != '\r' && it8 ->ch != '\n' && it8 -> ch != -1) {
+ while (it8->ch != '\r' && it8 ->ch != '\n' && it8->ch != '\t' && it8 -> ch != -1) {
*SheetTypePtr++= (char) it8 ->ch;
NextCh(it8);
}
+ }
*SheetTypePtr = 0;
InSymbol(it8);
@@ -1834,6 +2099,12 @@ void CookPointers(LPIT8 it8)
for (idField = 0; idField < t -> nSamples; idField++)
{
+ if (t ->DataFormat == NULL) {
+ SynError(it8, "Undefined DATA_FORMAT");
+ return;
+
+ }
+
Fld = t->DataFormat[idField];
if (!Fld) continue;
@@ -1881,7 +2152,7 @@ void CookPointers(LPIT8 it8)
LPTABLE Table = it8 ->Tab + k;
LPKEYVALUE p;
- if (IsAvailableOnList(Table->HeaderList, Label, &p)) {
+ if (IsAvailableOnList(Table->HeaderList, Label, NULL, &p)) {
// Available, keep type and table
char Buffer[256];
@@ -1889,7 +2160,7 @@ void CookPointers(LPIT8 it8)
char *Type = p ->Value;
int nTable = k;
- sprintf(Buffer, "%s %d %s", Label, nTable, Type );
+ snprintf(Buffer, 255, "%s %d %s", Label, nTable, Type );
SetData(it8, i, idField, Buffer);
}
@@ -1913,8 +2184,9 @@ void CookPointers(LPIT8 it8)
// that should be something like some printable characters plus a \n
static
-BOOL IsMyBlock(LPBYTE Buffer, size_t n)
+int IsMyBlock(LPBYTE Buffer, size_t n)
{
+ int cols = 1, space = 0, quot = 0;
size_t i;
if (n < 10) return FALSE; // Too small
@@ -1924,9 +2196,26 @@ BOOL IsMyBlock(LPBYTE Buffer, size_t n)
for (i = 1; i < n; i++) {
- if (Buffer[i] == '\n' || Buffer[i] == '\r') return TRUE;
- if (Buffer[i] < 32) return FALSE;
-
+ switch(Buffer[i])
+ {
+ case '\n':
+ case '\r':
+ return quot == 1 || cols > 2 ? 0 : cols;
+ case '\t':
+ case ' ':
+ if(!quot && !space)
+ space = 1;
+ break;
+ case '\"':
+ quot = !quot;
+ break;
+ default:
+ if (Buffer[i] < 32) return 0;
+ if (Buffer[i] > 127) return 0;
+ cols += space;
+ space = 0;
+ break;
+ }
}
return FALSE;
@@ -1935,7 +2224,7 @@ BOOL IsMyBlock(LPBYTE Buffer, size_t n)
static
-BOOL IsMyFile(const char* FileName)
+int IsMyFile(const char* FileName)
{
FILE *fp;
size_t Size;
@@ -1963,21 +2252,22 @@ LCMSHANDLE LCMSEXPORT cmsIT8LoadFromMem(void *Ptr, size_t len)
LCMSHANDLE hIT8;
LPIT8 it8;
- if (!IsMyBlock((LPBYTE) Ptr, len)) return NULL;
+ int type = IsMyBlock((LPBYTE) Ptr, len);
+ if (type == 0) return NULL;
hIT8 = cmsIT8Alloc();
if (!hIT8) return NULL;
it8 = (LPIT8) hIT8;
- it8 ->MemoryBlock = (char*) malloc(len + 1);
+ it8 ->MemoryBlock = (char*) _cmsMalloc(len + 1);
strncpy(it8 ->MemoryBlock, (const char*) Ptr, len);
it8 ->MemoryBlock[len] = 0;
- strncpy(it8->FileName, "", MAX_PATH-1);
+ strncpy(it8->FileStack[0]->FileName, "", MAX_PATH-1);
it8-> Source = it8 -> MemoryBlock;
- if (!ParseIT8(it8)) {
+ if (!ParseIT8(it8, type-1)) {
cmsIT8Free(hIT8);
return FALSE;
@@ -1986,7 +2276,7 @@ LCMSHANDLE LCMSEXPORT cmsIT8LoadFromMem(void *Ptr, size_t len)
CookPointers(it8);
it8 ->nTable = 0;
- free(it8->MemoryBlock);
+ _cmsFree(it8->MemoryBlock);
it8 -> MemoryBlock = NULL;
return hIT8;
@@ -2001,26 +2291,27 @@ LCMSHANDLE LCMSEXPORT cmsIT8LoadFromFile(const char* cFileName)
LCMSHANDLE hIT8;
LPIT8 it8;
- if (!IsMyFile(cFileName)) return NULL;
+ int type = IsMyFile(cFileName);
+ if (type == 0) return NULL;
hIT8 = cmsIT8Alloc();
it8 = (LPIT8) hIT8;
if (!hIT8) return NULL;
- it8 ->Stream[0] = fopen(cFileName, "rt");
+ it8 ->FileStack[0]->Stream = fopen(cFileName, "rt");
- if (!it8 ->Stream[0]) {
+ if (!it8 ->FileStack[0]->Stream) {
cmsIT8Free(hIT8);
return NULL;
}
- strncpy(it8->FileName, cFileName, MAX_PATH-1);
+ strncpy(it8->FileStack[0]->FileName, cFileName, MAX_PATH-1);
- if (!ParseIT8(it8)) {
+ if (!ParseIT8(it8, type-1)) {
- fclose(it8 ->Stream[0]);
+ fclose(it8 ->FileStack[0]->Stream);
cmsIT8Free(hIT8);
return NULL;
}
@@ -2028,7 +2319,7 @@ LCMSHANDLE LCMSEXPORT cmsIT8LoadFromFile(const char* cFileName)
CookPointers(it8);
it8 ->nTable = 0;
- fclose(it8 ->Stream[0]);
+ fclose(it8 ->FileStack[0]->Stream);
return hIT8;
}
@@ -2043,12 +2334,12 @@ int LCMSEXPORT cmsIT8EnumDataFormat(LCMSHANDLE hIT8, char ***SampleNames)
}
-int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, char ***PropertyNames)
+int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, const char ***PropertyNames)
{
LPIT8 it8 = (LPIT8) hIT8;
LPKEYVALUE p;
int n;
- char **Props;
+ const char **Props;
LPTABLE t = GetTable(it8);
// Pass#1 - count properties
@@ -2059,7 +2350,7 @@ int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, char ***PropertyNames)
}
- Props = (char **) malloc(sizeof(char *) * n);
+ Props = (const char **) AllocChunk(it8, sizeof(char *) * n);
// Pass#2 - Fill pointers
n = 0;
@@ -2071,6 +2362,41 @@ int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, char ***PropertyNames)
return n;
}
+int LCMSEXPORT cmsIT8EnumPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char ***SubpropertyNames)
+{
+ LPIT8 it8 = (LPIT8) hIT8;
+ LPKEYVALUE p, tmp;
+ int n;
+ const char **Props;
+ LPTABLE t = GetTable(it8);
+
+ if(!IsAvailableOnList(t->HeaderList, cProp, NULL, &p)) {
+ *SubpropertyNames = 0;
+ return 0;
+ }
+
+ // Pass#1 - count properties
+
+ n = 0;
+ for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) {
+ if(tmp->Subkey != NULL)
+ n++;
+ }
+
+
+ Props = (const char **) AllocChunk(it8, sizeof(char *) * n);
+
+ // Pass#2 - Fill pointers
+ n = 0;
+ for (tmp = p; tmp != NULL; tmp = tmp->NextSubkey) {
+ if(tmp->Subkey != NULL)
+ Props[n++] = p ->Subkey;
+ }
+
+ *SubpropertyNames = Props;
+ return n;
+}
+
static
int LocatePatch(LPIT8 it8, const char* cPatch)
{
@@ -2166,7 +2492,7 @@ double LCMSEXPORT cmsIT8GetDataRowColDbl(LCMSHANDLE hIT8, int row, int col)
}
-BOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col, const char* Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col, const char* Val)
{
LPIT8 it8 = (LPIT8) hIT8;
@@ -2174,7 +2500,7 @@ BOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col, const cha
}
-BOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col, double Val)
+LCMSBOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col, double Val)
{
LPIT8 it8 = (LPIT8) hIT8;
char Buff[256];
@@ -2225,7 +2551,7 @@ double LCMSEXPORT cmsIT8GetDataDbl(LCMSHANDLE it8, const char* cPatch, const cha
-BOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE hIT8, const char* cPatch,
+LCMSBOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE hIT8, const char* cPatch,
const char* cSample,
const char *Val)
{
@@ -2270,18 +2596,19 @@ BOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE hIT8, const char* cPatch,
}
-BOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
+LCMSBOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
const char* cSample,
double Val)
{
LPIT8 it8 = (LPIT8) hIT8;
char Buff[256];
- sprintf(Buff, it8->DoubleFormatter, Val);
+ snprintf(Buff, 255, it8->DoubleFormatter, Val);
return cmsIT8SetData(hIT8, cPatch, cSample, Buff);
}
+// Buffer should get MAXSTR at least
const char* LCMSEXPORT cmsIT8GetPatchName(LCMSHANDLE hIT8, int nPatch, char* buffer)
{
@@ -2292,10 +2619,15 @@ const char* LCMSEXPORT cmsIT8GetPatchName(LCMSHANDLE hIT8, int nPatch, char* buf
if (!Data) return NULL;
if (!buffer) return Data;
- strcpy(buffer, Data);
+ strncpy(buffer, Data, MAXSTR-1);
return buffer;
}
+int LCMSEXPORT cmsIT8GetPatchByName(LCMSHANDLE hIT8, const char *cPatch)
+{
+ return LocatePatch((LPIT8)hIT8, cPatch);
+}
+
int LCMSEXPORT cmsIT8TableCount(LCMSHANDLE hIT8)
{
LPIT8 it8 = (LPIT8) hIT8;
@@ -2321,7 +2653,7 @@ int LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const char* cSet, const ch
cLabelFld = cmsIT8GetData(hIT8, cSet, cField);
if (!cLabelFld) return -1;
- if (sscanf(cLabelFld, "%s %d %s", Label, &nTable, Type) != 3)
+ if (sscanf(cLabelFld, "%255s %d %255s", Label, &nTable, Type) != 3)
return -1;
if (ExpectedType != NULL && *ExpectedType == 0)
@@ -2336,6 +2668,19 @@ int LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const char* cSet, const ch
}
+LCMSBOOL LCMSEXPORT cmsIT8SetIndexColumn(LCMSHANDLE hIT8, const char* cSample)
+{
+ LPIT8 it8 = (LPIT8) hIT8;
+
+ int pos = LocateSample(it8, cSample);
+ if(pos == -1)
+ return FALSE;
+
+ it8->Tab[it8->nTable].SampleID = pos;
+ return TRUE;
+}
+
+
void LCMSEXPORT cmsIT8DefineDblFormat(LCMSHANDLE hIT8, const char* Formatter)
{
LPIT8 it8 = (LPIT8) hIT8;
diff --git a/icc2ps/cmscnvrt.c b/icc2ps/cmscnvrt.c
index 587ac57..7a4b23d 100644..100755
--- a/icc2ps/cmscnvrt.c
+++ b/icc2ps/cmscnvrt.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -227,7 +227,7 @@ void ComputeBlackPointCompensationFactors(LPcmsCIEXYZ BlackPointIn,
// Return TRUE if both m and of are empy -- "m" being identity and "of" being 0
static
-BOOL IdentityParameters(LPWMAT3 m, LPWVEC3 of)
+LCMSBOOL IdentityParameters(LPWMAT3 m, LPWVEC3 of)
{
WVEC3 wv0;
diff --git a/icc2ps/cmserr.c b/icc2ps/cmserr.c
index 16a1fa2..3fb7941 100644..100755
--- a/icc2ps/cmserr.c
+++ b/icc2ps/cmserr.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -28,7 +28,9 @@
// errors.
void cdecl cmsSignalError(int ErrorCode, const char *ErrorText, ...);
+
int LCMSEXPORT cmsErrorAction(int lAbort);
+void LCMSEXPORT cmsSetErrorHandler(cmsErrorHandlerFunction Fn);
// ******************************************************************
@@ -47,7 +49,7 @@ int LCMSEXPORT cmsErrorAction(int nAction)
void LCMSEXPORT cmsSetErrorHandler(cmsErrorHandlerFunction Fn)
{
- UserErrorHandler = Fn;
+ UserErrorHandler = Fn;
}
@@ -57,7 +59,6 @@ void LCMSEXPORT cmsSetErrorHandler(cmsErrorHandlerFunction Fn)
void cmsSignalError(int ErrorCode, const char *ErrorText, ...)
{
va_list args;
-
if (nDoAbort == LCMS_ERROR_IGNORE) return;
@@ -66,15 +67,15 @@ void cmsSignalError(int ErrorCode, const char *ErrorText, ...)
if (UserErrorHandler != NULL) {
char Buffer[1024];
-
- vsprintf(Buffer, ErrorText, args);
+
+ vsnprintf(Buffer, 1023, ErrorText, args);
va_end(args);
if (UserErrorHandler(ErrorCode, Buffer)) {
-
+
return;
- }
- }
+ }
+ }
#if defined( __CONSOLE__ ) || defined( NON_WINDOWS )
@@ -89,8 +90,8 @@ void cmsSignalError(int ErrorCode, const char *ErrorText, ...)
char Buffer1[1024];
char Buffer2[256];
- sprintf(Buffer1, "Error #%x; ", ErrorCode);
- vsprintf(Buffer2, ErrorText, args);
+ snprintf(Buffer1, 767, "Error #%x; ", ErrorCode);
+ vsnprintf(Buffer2, 255, ErrorText, args);
strcat(Buffer1, Buffer2);
MessageBox(NULL, Buffer1, "Little cms",
MB_OK|MB_ICONSTOP|MB_TASKMODAL);
@@ -104,7 +105,6 @@ void cmsSignalError(int ErrorCode, const char *ErrorText, ...)
FatalAppExit(0, "lcms is terminating application");
}
-
}
#endif
}
diff --git a/icc2ps/cmsgamma.c b/icc2ps/cmsgamma.c
index d74bfe8..f362dc0 100644..100755
--- a/icc2ps/cmsgamma.c
+++ b/icc2ps/cmsgamma.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -34,9 +34,9 @@ LPGAMMATABLE LCMSEXPORT cmsReverseGamma(int nResultSamples, LPGAMMATABLE InGamma
LPGAMMATABLE LCMSEXPORT cmsBuildParametricGamma(int nEntries, int Type, double Params[]);
LPGAMMATABLE LCMSEXPORT cmsJoinGamma(LPGAMMATABLE InGamma, LPGAMMATABLE OutGamma);
LPGAMMATABLE LCMSEXPORT cmsJoinGammaEx(LPGAMMATABLE InGamma, LPGAMMATABLE OutGamma, int nPoints);
-BOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda);
+LCMSBOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda);
-BOOL cdecl _cmsSmoothEndpoints(LPWORD Table, int nPoints);
+LCMSBOOL cdecl _cmsSmoothEndpoints(LPWORD Table, int nPoints);
// Sampled curves
@@ -45,7 +45,7 @@ LPSAMPLEDCURVE cdecl cmsAllocSampledCurve(int nItems);
void cdecl cmsFreeSampledCurve(LPSAMPLEDCURVE p);
void cdecl cmsEndpointsOfSampledCurve(LPSAMPLEDCURVE p, double* Min, double* Max);
void cdecl cmsClampSampledCurve(LPSAMPLEDCURVE p, double Min, double Max);
-BOOL cdecl cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double SmoothingLambda);
+LCMSBOOL cdecl cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double SmoothingLambda);
void cdecl cmsRescaleSampledCurve(LPSAMPLEDCURVE p, double Min, double Max, int nPoints);
LPSAMPLEDCURVE cdecl cmsJoinSampledCurves(LPSAMPLEDCURVE X, LPSAMPLEDCURVE Y, int nResultingPoints);
@@ -55,7 +55,6 @@ double LCMSEXPORT cmsEstimateGammaEx(LPWORD GammaTable, int nEntries, double The
// ----------------------------------------------------------------------------------------
-// #define DEBUG 1
#define MAX_KNOTS 4096
typedef float vec[MAX_KNOTS+1];
@@ -100,10 +99,10 @@ unsigned int _cmsCrc32OfGammaTable(LPGAMMATABLE Table)
{
unsigned int crc = ~0U;
- crc = Crc32(crc, &Table -> Birth.Type, sizeof(int));
- crc = Crc32(crc, Table ->Birth.Params, sizeof(double)*10);
- crc = Crc32(crc, &Table ->nEntries, sizeof(int));
- crc = Crc32(crc, Table ->GammaTable, sizeof(WORD) * Table -> nEntries);
+ crc = Crc32(crc, &Table -> Seed.Type, sizeof(int));
+ crc = Crc32(crc, Table ->Seed.Params, sizeof(double)*10);
+ crc = Crc32(crc, &Table ->nEntries, sizeof(int));
+ crc = Crc32(crc, Table ->GammaTable, sizeof(WORD) * Table -> nEntries);
return ~crc;
@@ -115,19 +114,19 @@ LPGAMMATABLE LCMSEXPORT cmsAllocGamma(int nEntries)
LPGAMMATABLE p;
size_t size;
- if (nEntries > 65530) {
- cmsSignalError(LCMS_ERRC_WARNING, "Couldn't create gammatable of more than 65530 entries; 65530 assumed");
- nEntries = 65530;
+ if (nEntries > 65530 || nEntries <= 0) {
+ cmsSignalError(LCMS_ERRC_ABORTED, "Couldn't create gammatable of more than 65530 entries");
+ return NULL;
}
size = sizeof(GAMMATABLE) + (sizeof(WORD) * (nEntries-1));
- p = (LPGAMMATABLE) malloc(size);
+ p = (LPGAMMATABLE) _cmsMalloc(size);
if (!p) return NULL;
ZeroMemory(p, size);
- p -> Birth.Type = 0;
+ p -> Seed.Type = 0;
p -> nEntries = nEntries;
return p;
@@ -135,7 +134,7 @@ LPGAMMATABLE LCMSEXPORT cmsAllocGamma(int nEntries)
void LCMSEXPORT cmsFreeGamma(LPGAMMATABLE Gamma)
{
- if (Gamma) free(Gamma);
+ if (Gamma) _cmsFree(Gamma);
}
@@ -249,6 +248,15 @@ LPGAMMATABLE LCMSEXPORT cmsReverseGamma(int nResultSamples, LPGAMMATABLE InGamma
LPWORD InPtr;
LPGAMMATABLE p;
+ // Try to reverse it analytically whatever possible
+ if (InGamma -> Seed.Type > 0 && InGamma -> Seed.Type <= 5 &&
+ _cmsCrc32OfGammaTable(InGamma) == InGamma -> Seed.Crc32) {
+
+ return cmsBuildParametricGamma(nResultSamples, -(InGamma -> Seed.Type), InGamma ->Seed.Params);
+ }
+
+
+ // Nope, reverse the table
p = cmsAllocGamma(nResultSamples);
if (!p) return NULL;
@@ -286,9 +294,9 @@ LPGAMMATABLE LCMSEXPORT cmsBuildParametricGamma(int nEntries, int Type, double P
Table = cmsAllocGamma(nEntries);
if (NULL == Table) return NULL;
- Table -> Birth.Type = Type;
+ Table -> Seed.Type = Type;
- CopyMemory(Table ->Birth.Params, Params, ParamsByType[abs(Type)] * sizeof(double));
+ CopyMemory(Table ->Seed.Params, Params, ParamsByType[abs(Type)] * sizeof(double));
for (i=0; i < nEntries; i++) {
@@ -439,7 +447,7 @@ LPGAMMATABLE LCMSEXPORT cmsBuildParametricGamma(int nEntries, int Type, double P
Table->GammaTable[i] = (WORD) floor(dval);
}
- Table -> Birth.Crc32 = _cmsCrc32OfGammaTable(Table);
+ Table -> Seed.Crc32 = _cmsCrc32OfGammaTable(Table);
return Table;
}
@@ -499,7 +507,7 @@ void smooth2(vec w, vec y, vec z, float lambda, int m)
// Smooths a curve sampled at regular intervals
-BOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda)
+LCMSBOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda)
{
vec w, y, z;
@@ -611,13 +619,13 @@ LPSAMPLEDCURVE cmsAllocSampledCurve(int nItems)
{
LPSAMPLEDCURVE pOut;
- pOut = (LPSAMPLEDCURVE) malloc(sizeof(SAMPLEDCURVE));
+ pOut = (LPSAMPLEDCURVE) _cmsMalloc(sizeof(SAMPLEDCURVE));
if (pOut == NULL)
return NULL;
- if((pOut->Values = (double *) malloc(nItems * sizeof(double))) == NULL)
+ if((pOut->Values = (double *) _cmsMalloc(nItems * sizeof(double))) == NULL)
{
- free(pOut);
+ _cmsFree(pOut);
return NULL;
}
@@ -630,8 +638,8 @@ LPSAMPLEDCURVE cmsAllocSampledCurve(int nItems)
void cmsFreeSampledCurve(LPSAMPLEDCURVE p)
{
- free((LPVOID) p -> Values);
- free((LPVOID) p);
+ _cmsFree((LPVOID) p -> Values);
+ _cmsFree((LPVOID) p);
}
@@ -702,7 +710,7 @@ void cmsClampSampledCurve(LPSAMPLEDCURVE p, double Min, double Max)
// Smooths a curve sampled at regular intervals
-BOOL cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double lambda)
+LCMSBOOL cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double lambda)
{
vec w, y, z;
int i, nItems;
@@ -886,14 +894,11 @@ LPSAMPLEDCURVE cmsConvertGammaToSampledCurve(LPGAMMATABLE Gamma, int nPoints)
// Smooth endpoints (used in Black/White compensation)
-BOOL _cmsSmoothEndpoints(LPWORD Table, int nEntries)
+LCMSBOOL _cmsSmoothEndpoints(LPWORD Table, int nEntries)
{
vec w, y, z;
int i, Zeros, Poles;
-#ifdef DEBUG
- ASAVE(Table, nEntries, "nonsmt.txt");
-#endif
if (cmsIsLinear(Table, nEntries)) return FALSE; // Nothing to do
diff --git a/icc2ps/cmsgmt.c b/icc2ps/cmsgmt.c
index a9ca80b..74cde8b 100644..100755
--- a/icc2ps/cmsgmt.c
+++ b/icc2ps/cmsgmt.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -23,8 +23,6 @@
#include "lcms.h"
-// #define DEBUG 1
-
/*
Gamut check by default is a catching of 0xFFFF/0xFFFF/0xFFFF PCS values, used
internally by lcms to hold invalid values. Matrix LUT's, operates in a way that
@@ -39,7 +37,7 @@ to use highlights, then it will be lost.
*/
-BOOL _cmsEndPointsBySpace(icColorSpaceSignature Space, WORD **White, WORD **Black,
+LCMSBOOL _cmsEndPointsBySpace(icColorSpaceSignature Space, WORD **White, WORD **Black,
int *nOutputs)
{
// Only most common spaces
@@ -349,8 +347,7 @@ double LCMSEXPORT cmsCIE2000DeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2,
double bs = Lab2 ->b;
double Cs = sqrt( Sqr(as) + Sqr(bs) );
-
- double G = 0.5 * ( 1 - sqrt(pow((C + Cs) / 2 , 7) / (pow((C + Cs) / 2, 7) + pow(25, 7) ) ));
+ double G = 0.5 * ( 1 - sqrt(pow((C + Cs) / 2 , 7.0) / (pow((C + Cs) / 2, 7.0) + pow(25.0, 7.0) ) ));
double a_p = (1 + G ) * a1;
double b_p = b1;
@@ -362,16 +359,22 @@ double LCMSEXPORT cmsCIE2000DeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2,
double b_ps = bs;
double C_ps = sqrt(Sqr(a_ps) + Sqr(b_ps));
double h_ps = atan2deg(a_ps, b_ps);
-
-
-
+
double meanC_p =(C_p + C_ps) / 2;
- double meanh_p = fabs(h_ps-h_p) <= 180 ? (h_ps + h_p)/2 : (h_ps+h_p-360)/2;
+ double hps_plus_hp = h_ps + h_p;
+ double hps_minus_hp = h_ps - h_p;
+
+ double meanh_p = fabs(hps_minus_hp) <= 180.000001 ? (hps_plus_hp)/2 :
+ (hps_plus_hp) < 360 ? (hps_plus_hp + 360)/2 :
+ (hps_plus_hp - 360)/2;
+
+ double delta_h = (hps_minus_hp) <= -180.000001 ? (hps_minus_hp + 360) :
+ (hps_minus_hp) > 180 ? (hps_minus_hp - 360) :
+ (hps_minus_hp);
+ double delta_L = (Ls - L1);
+ double delta_C = (C_ps - C_p );
- double delta_h = fabs(h_p - h_ps) <= 180 ? fabs(h_p - h_ps) : 360 - fabs(h_p - h_ps);
- double delta_L = fabs(L1 - Ls);
- double delta_C = fabs(C_p - C_ps);
double delta_H =2 * sqrt(C_ps*C_p) * sin(RADIANES(delta_h) / 2);
@@ -387,7 +390,7 @@ double LCMSEXPORT cmsCIE2000DeltaE(LPcmsCIELab Lab1, LPcmsCIELab Lab2,
double delta_ro = 30 * exp( -Sqr(((meanh_p - 275 ) / 25)));
- double Rc = 2 * sqrt(( pow(meanC_p, 7) )/( pow(meanC_p , 7 ) + pow(25, 7)));
+ double Rc = 2 * sqrt(( pow(meanC_p, 7.0) )/( pow(meanC_p, 7.0) + pow(25.0, 7.0)));
double Rt = -sin(2 * RADIANES(delta_ro)) * Rc;
@@ -1002,29 +1005,6 @@ LPLUT _cmsComputeSoftProofLUT(cmsHPROFILE hProfile, int nIntent)
}
-
-#ifdef DEBUG
-static
-void ASAVE(LPGAMMATABLE p, const char* dump)
-{
- FILE* f;
- int i;
-
- f = fopen(dump, "wt");
- if (!f)
- return;
-
- if (p) {
-
- for (i=0; i < p -> nEntries; i++)
- fprintf(f, "%g\n", (double) p -> GammaTable[i]);
- }
-
- fclose(f);
-}
-#endif
-
-
static
int MostlyLinear(WORD Table[], int nEntries)
{
@@ -1061,7 +1041,7 @@ void SlopeLimiting(WORD Table[], int nEntries)
// Check for monotonicity.
static
-BOOL IsMonotonic(LPGAMMATABLE t)
+LCMSBOOL IsMonotonic(LPGAMMATABLE t)
{
int n = t -> nEntries;
int i, last;
@@ -1084,7 +1064,7 @@ BOOL IsMonotonic(LPGAMMATABLE t)
// Check for endpoints
static
-BOOL HasProperEndpoints(LPGAMMATABLE t)
+LCMSBOOL HasProperEndpoints(LPGAMMATABLE t)
{
if (t ->GammaTable[0] != 0) return FALSE;
if (t ->GammaTable[t ->nEntries-1] != 0xFFFF) return FALSE;
@@ -1105,7 +1085,7 @@ void _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTransfor
unsigned int t, i, v;
int j;
WORD In[MAXCHANNELS], Out[MAXCHANNELS];
- BOOL lIsSuitable;
+ LCMSBOOL lIsSuitable;
_LPcmsTRANSFORM InputXForm = (_LPcmsTRANSFORM) h[0];
_LPcmsTRANSFORM OutputXForm = (_LPcmsTRANSFORM) h[nTransforms-1];
@@ -1122,10 +1102,10 @@ void _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTransfor
}
- // Do nothing on all but RGB to RGB transforms
+ // Do nothing on all but Gray/RGB to Gray/RGB transforms
- if ((InputXForm ->EntryColorSpace != icSigRgbData) ||
- (OutputXForm->ExitColorSpace != icSigRgbData)) return;
+ if (((InputXForm ->EntryColorSpace != icSigRgbData) && (InputXForm ->EntryColorSpace != icSigGrayData)) ||
+ ((OutputXForm->ExitColorSpace != icSigRgbData) && (OutputXForm->ExitColorSpace != icSigGrayData))) return;
for (t = 0; t < Grid -> InputChan; t++)
@@ -1165,32 +1145,21 @@ void _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTransfor
if (!HasProperEndpoints(Trans[t]))
lIsSuitable = FALSE;
+ /*
// Exclude if transfer function is not smooth enough
// to be modelled as a gamma function, or the gamma is reversed
-
+
if (cmsEstimateGamma(Trans[t]) < 1.0)
lIsSuitable = FALSE;
+ */
}
if (lIsSuitable) {
-
for (t = 0; t < Grid ->InputChan; t++)
SlopeLimiting(Trans[t]->GammaTable, Trans[t]->nEntries);
}
-
-
-
-
-#ifdef DEBUG
- if (lIsSuitable) {
- ASAVE(Trans[0], "\\gammar.txt");
- ASAVE(Trans[1], "\\gammag.txt");
- ASAVE(Trans[2], "\\gammab.txt");
- }
-#endif
-
if (lIsSuitable) cmsAllocLinearTable(Grid, Trans, 1);
@@ -1202,9 +1171,10 @@ void _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTransfor
}
-// Compute K -> L* relationship
+// Compute K -> L* relationship. Flags may include black point compensation. In this case,
+// the relationship is assumed from the profile with BPC to a black point zero.
static
-LPGAMMATABLE ComputeKToLstar(cmsHPROFILE hProfile, int nPoints, int Intent)
+LPGAMMATABLE ComputeKToLstar(cmsHPROFILE hProfile, int nPoints, int Intent, DWORD dwFlags)
{
LPGAMMATABLE out;
int i;
@@ -1212,7 +1182,7 @@ LPGAMMATABLE ComputeKToLstar(cmsHPROFILE hProfile, int nPoints, int Intent)
cmsHPROFILE hLab = cmsCreateLabProfile(NULL);
cmsHTRANSFORM xform = cmsCreateTransform(hProfile, TYPE_CMYK_16,
hLab, TYPE_Lab_16,
- Intent, cmsFLAGS_NOTPRECALC);
+ Intent, (dwFlags|cmsFLAGS_NOTPRECALC));
out = cmsAllocGamma(nPoints);
@@ -1237,7 +1207,7 @@ LPGAMMATABLE ComputeKToLstar(cmsHPROFILE hProfile, int nPoints, int Intent)
// Compute Black tone curve on a CMYK -> CMYK transform. This is done by
// using the proof direction on both profiles to find K->L* relationship
-// then joining both curves
+// then joining both curves. dwFlags may include black point compensation.
LPGAMMATABLE _cmsBuildKToneCurve(cmsHTRANSFORM hCMYK2CMYK, int nPoints)
{
@@ -1250,19 +1220,14 @@ LPGAMMATABLE _cmsBuildKToneCurve(cmsHTRANSFORM hCMYK2CMYK, int nPoints)
if (p -> EntryColorSpace != icSigCmykData ||
p -> ExitColorSpace != icSigCmykData) return NULL;
- // Create individual curves
- in = ComputeKToLstar(p ->InputProfile, nPoints, p->Intent);
- out = ComputeKToLstar(p ->OutputProfile, nPoints, p->Intent);
+ // Create individual curves. BPC works also as each K to L* is
+ // computed as a BPC to zero black point in case of L*
+ in = ComputeKToLstar(p ->InputProfile, nPoints, p->Intent, p -> dwOriginalFlags);
+ out = ComputeKToLstar(p ->OutputProfile, nPoints, p->Intent, p -> dwOriginalFlags);
// Build the relationship
KTone = cmsJoinGamma(in, out);
-#ifdef DEBUG
- ASAVE(in, "\\in.txt");
- ASAVE(out, "\\out.txt");
- ASAVE(KTone, "\\KTone.txt");
-#endif
-
cmsFreeGamma(in); cmsFreeGamma(out);
// Make sure it is monotonic
@@ -1274,7 +1239,5 @@ LPGAMMATABLE _cmsBuildKToneCurve(cmsHTRANSFORM hCMYK2CMYK, int nPoints)
}
-
-
return KTone;
}
diff --git a/icc2ps/cmsintrp.c b/icc2ps/cmsintrp.c
index d9dc95f..7894f18 100644..100755
--- a/icc2ps/cmsintrp.c
+++ b/icc2ps/cmsintrp.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -253,7 +253,7 @@ void Eval8Inputs(WORD StageABC[], WORD StageLMN[], WORD LutTable[], LPL16PARAMS
// Fills optimization parameters
void cmsCalcCLUT16ParamsEx(int nSamples, int InputChan, int OutputChan,
- BOOL lUseTetrahedral, LPL16PARAMS p)
+ LCMSBOOL lUseTetrahedral, LPL16PARAMS p)
{
int clutPoints;
@@ -418,6 +418,7 @@ WORD cmsLinearInterpLUT16(WORD Value1, WORD LutTable[], LPL16PARAMS p)
#ifdef _MSC_VER
#pragma warning(disable : 4033)
+#pragma warning(disable : 4035)
#endif
WORD cmsLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p)
@@ -477,8 +478,9 @@ WORD cmsLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p)
RET((WORD) _EAX);
}
-#ifndef __BORLANDC__
+#ifdef _MSC_VER
#pragma warning(default : 4033)
+#pragma warning(default : 4035)
#endif
#endif
@@ -548,7 +550,7 @@ WORD cmsReverseLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p)
// Identify if value fall downto 0 or FFFF zone
if (Value == 0) return 0;
- if (Value == 0xFFFF) return 0xFFFF;
+ // if (Value == 0xFFFF) return 0xFFFF;
// else restrict to valid zone
@@ -600,7 +602,7 @@ WORD cmsReverseLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p)
a = (y1 - y0) / (x1 - x0);
b = y0 - a * x0;
- if (a == 0) return (WORD) x;
+ if (fabs(a) < 0.01) return (WORD) x;
f = ((Value - b) / a);
@@ -732,7 +734,7 @@ void cmsTrilinearInterp16(WORD Input[], WORD Output[],
X0 = p -> opta3 * x0;
X1 = X0 + (Input[0] == 0xFFFFU ? 0 : p->opta3);
- Y0 = p -> opta2 * y0;
+ Y0 = p -> opta2 * y0;
Y1 = Y0 + (Input[1] == 0xFFFFU ? 0 : p->opta2);
Z0 = p -> opta1 * z0;
@@ -878,21 +880,23 @@ void cmsTetrahedralInterp16(WORD Input[],
#define DENS(i,j,k) (LutTable[(i)+(j)+(k)+OutChan])
+
void cmsTetrahedralInterp16(WORD Input[],
WORD Output[],
- WORD LutTable[],
+ WORD LutTable1[],
LPL16PARAMS p)
{
Fixed32 fx, fy, fz;
Fixed32 rx, ry, rz;
int x0, y0, z0;
- Fixed32 c1, c2, c3, Rest;
+ Fixed32 c0, c1, c2, c3, Rest;
int OutChan;
- register Fixed32 X0, X1, Y0, Y1, Z0, Z1;
+ Fixed32 X0, X1, Y0, Y1, Z0, Z1;
int TotalOut = p -> nOutputs;
+ register LPWORD LutTable = LutTable1;
-
+
fx = ToFixedDomain((int) Input[0] * p -> Domain);
fy = ToFixedDomain((int) Input[1] * p -> Domain);
@@ -909,20 +913,22 @@ void cmsTetrahedralInterp16(WORD Input[],
X0 = p -> opta3 * x0;
X1 = X0 + (Input[0] == 0xFFFFU ? 0 : p->opta3);
- Y0 = p -> opta2 * y0;
+ Y0 = p -> opta2 * y0;
Y1 = Y0 + (Input[1] == 0xFFFFU ? 0 : p->opta2);
Z0 = p -> opta1 * z0;
Z1 = Z0 + (Input[2] == 0xFFFFU ? 0 : p->opta1);
-
+
// These are the 6 Tetrahedral
for (OutChan=0; OutChan < TotalOut; OutChan++) {
-
+
+ c0 = DENS(X0, Y0, Z0);
+
if (rx >= ry && ry >= rz) {
- c1 = DENS(X1, Y0, Z0) - DENS(X0, Y0, Z0);
+ c1 = DENS(X1, Y0, Z0) - c0;
c2 = DENS(X1, Y1, Z0) - DENS(X1, Y0, Z0);
c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
@@ -930,7 +936,7 @@ void cmsTetrahedralInterp16(WORD Input[],
else
if (rx >= rz && rz >= ry) {
- c1 = DENS(X1, Y0, Z0) - DENS(X0, Y0, Z0);
+ c1 = DENS(X1, Y0, Z0) - c0;
c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
c3 = DENS(X1, Y0, Z1) - DENS(X1, Y0, Z0);
@@ -940,14 +946,14 @@ void cmsTetrahedralInterp16(WORD Input[],
c1 = DENS(X1, Y0, Z1) - DENS(X0, Y0, Z1);
c2 = DENS(X1, Y1, Z1) - DENS(X1, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - DENS(X0, Y0, Z0);
+ c3 = DENS(X0, Y0, Z1) - c0;
}
else
if (ry >= rx && rx >= rz) {
c1 = DENS(X1, Y1, Z0) - DENS(X0, Y1, Z0);
- c2 = DENS(X0, Y1, Z0) - DENS(X0, Y0, Z0);
+ c2 = DENS(X0, Y1, Z0) - c0;
c3 = DENS(X1, Y1, Z1) - DENS(X1, Y1, Z0);
}
@@ -955,7 +961,7 @@ void cmsTetrahedralInterp16(WORD Input[],
if (ry >= rz && rz >= rx) {
c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
- c2 = DENS(X0, Y1, Z0) - DENS(X0, Y0, Z0);
+ c2 = DENS(X0, Y1, Z0) - c0;
c3 = DENS(X0, Y1, Z1) - DENS(X0, Y1, Z0);
}
@@ -964,7 +970,7 @@ void cmsTetrahedralInterp16(WORD Input[],
c1 = DENS(X1, Y1, Z1) - DENS(X0, Y1, Z1);
c2 = DENS(X0, Y1, Z1) - DENS(X0, Y0, Z1);
- c3 = DENS(X0, Y0, Z1) - DENS(X0, Y0, Z0);
+ c3 = DENS(X0, Y0, Z1) - c0;
}
else {
@@ -974,11 +980,11 @@ void cmsTetrahedralInterp16(WORD Input[],
Rest = c1 * rx + c2 * ry + c3 * rz;
- // There is a lot of math hidden in this expression. The rest is in fixed domain
- // and the result in 0..ffff domain. So the complete expression should be
- // ROUND_FIXED_TO_INT(ToFixedDomain(Rest)) But that can be optimized as (Rest + 0x7FFF) / 0xFFFF
+ // There is a lot of math hidden in this expression. The rest is in fixed domain
+ // and the result in 0..ffff domain. So the complete expression should be
+ // ROUND_FIXED_TO_INT(ToFixedDomain(Rest)) But that can be optimized as (Rest + 0x7FFF) / 0xFFFF
- Output[OutChan] = (WORD) (DENS(X0,Y0,Z0) + ((Rest + 0x7FFF) / 0xFFFF));
+ Output[OutChan] = (WORD) (c0 + ((Rest + 0x7FFF) / 0xFFFF));
}
diff --git a/icc2ps/cmsio0.c b/icc2ps/cmsio0.c
index 8925468..0e791fa 100644
--- a/icc2ps/cmsio0.c
+++ b/icc2ps/cmsio0.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -33,7 +33,7 @@
typedef struct {
LPBYTE Block; // Points to allocated memory
size_t Size; // Size of allocated memory
- int Pointer; // Points to current location
+ size_t Pointer; // Points to current location
int FreeBlockOnClose; // As title
} FILEMEM;
@@ -41,18 +41,19 @@ typedef struct {
static
LPVOID MemoryOpen(LPBYTE Block, size_t Size, char Mode)
{
- FILEMEM* fm = (FILEMEM*) malloc(sizeof(FILEMEM));
+ FILEMEM* fm = (FILEMEM*) _cmsMalloc(sizeof(FILEMEM));
+ if (fm == NULL) return NULL;
+
ZeroMemory(fm, sizeof(FILEMEM));
if (Mode == 'r') {
- fm ->Block = (LPBYTE) malloc(Size);
+ fm ->Block = (LPBYTE) _cmsMalloc(Size);
if (fm ->Block == NULL) {
- free(fm);
+ _cmsFree(fm);
return NULL;
}
-
CopyMemory(fm->Block, Block, Size);
fm ->FreeBlockOnClose = TRUE;
}
@@ -74,13 +75,23 @@ size_t MemoryRead(LPVOID buffer, size_t size, size_t count, struct _lcms_iccprof
FILEMEM* ResData = (FILEMEM*) Icc ->stream;
LPBYTE Ptr;
size_t len = size * count;
-
-
- if (ResData -> Pointer + len > ResData -> Size){
+ size_t extent = ResData -> Pointer + len;
+
+ if (len < size || len < count) {
+ cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Integer overflow with count / size.");
+ return 0;
+ }
+
+ if (extent < len || extent < ResData -> Pointer) {
+ cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Integer overflow with len.");
+ return 0;
+ }
+
+ if (ResData -> Pointer + len > ResData -> Size) {
len = (ResData -> Size - ResData -> Pointer);
- cmsSignalError(LCMS_ERRC_WARNING, "Read from memory error. Got %d bytes, block should be of %d bytes", len * size, count * size);
-
+ cmsSignalError(LCMS_ERRC_ABORTED, "Read from memory error. Got %d bytes, block should be of %d bytes", len * size, count * size);
+ return 0;
}
Ptr = ResData -> Block;
@@ -94,12 +105,14 @@ size_t MemoryRead(LPVOID buffer, size_t size, size_t count, struct _lcms_iccprof
// SEEK_CUR is assumed
static
-BOOL MemorySeek(struct _lcms_iccprofile_struct* Icc, size_t offset)
+LCMSBOOL MemorySeek(struct _lcms_iccprofile_struct* Icc, size_t offset)
{
FILEMEM* ResData = (FILEMEM*) Icc ->stream;
- if (offset > ResData ->Size)
+ if (offset > ResData ->Size) {
cmsSignalError(LCMS_ERRC_ABORTED, "Pointer error; probably corrupted file");
+ return TRUE;
+ }
ResData ->Pointer = (DWORD) offset;
return FALSE;
@@ -116,10 +129,10 @@ size_t MemoryTell(struct _lcms_iccprofile_struct* Icc)
}
-// Writes data to memory, also keeps used space for further reference
+// Writes data to memory, also keeps used space for further reference. NO CHECK IS PERFORMED
static
-BOOL MemoryWrite(struct _lcms_iccprofile_struct* Icc, size_t size, void *Ptr)
+LCMSBOOL MemoryWrite(struct _lcms_iccprofile_struct* Icc, size_t size, void *Ptr)
{
FILEMEM* ResData = (FILEMEM*) Icc ->stream;
@@ -135,15 +148,15 @@ BOOL MemoryWrite(struct _lcms_iccprofile_struct* Icc, size_t size, void *Ptr)
static
-BOOL MemoryClose(struct _lcms_iccprofile_struct* Icc)
+LCMSBOOL MemoryClose(struct _lcms_iccprofile_struct* Icc)
{
FILEMEM* ResData = (FILEMEM*) Icc ->stream;
if (ResData ->FreeBlockOnClose) {
- if (ResData ->Block) free(ResData ->Block);
+ if (ResData ->Block) _cmsFree(ResData ->Block);
}
- free(ResData);
+ _cmsFree(ResData);
return 0;
}
@@ -161,7 +174,8 @@ size_t FileRead(void *buffer, size_t size, size_t count, struct _lcms_iccprofile
{
size_t nReaded = fread(buffer, size, count, (FILE*) Icc->stream);
if (nReaded != count) {
- cmsSignalError(LCMS_ERRC_WARNING, "Read error. Got %d bytes, block should be of %d bytes", nReaded * size, count * size);
+ cmsSignalError(LCMS_ERRC_ABORTED, "Read error. Got %d bytes, block should be of %d bytes", nReaded * size, count * size);
+ return 0;
}
return nReaded;
@@ -169,7 +183,7 @@ size_t FileRead(void *buffer, size_t size, size_t count, struct _lcms_iccprofile
static
-BOOL FileSeek(struct _lcms_iccprofile_struct* Icc, size_t offset)
+LCMSBOOL FileSeek(struct _lcms_iccprofile_struct* Icc, size_t offset)
{
if (fseek((FILE*) Icc ->stream, (long) offset, SEEK_SET) != 0) {
@@ -191,7 +205,7 @@ size_t FileTell(struct _lcms_iccprofile_struct* Icc)
static
-BOOL FileWrite(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr)
+LCMSBOOL FileWrite(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr)
{
if (size == 0) return TRUE;
@@ -207,7 +221,7 @@ BOOL FileWrite(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr)
static
-BOOL FileClose(struct _lcms_iccprofile_struct* Icc)
+LCMSBOOL FileClose(struct _lcms_iccprofile_struct* Icc)
{
return fclose((FILE*) Icc ->stream);
}
@@ -220,7 +234,7 @@ BOOL FileClose(struct _lcms_iccprofile_struct* Icc)
cmsHPROFILE _cmsCreateProfilePlaceholder(void)
{
- LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) malloc(sizeof(LCMSICCPROFILE));
+ LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) _cmsMalloc(sizeof(LCMSICCPROFILE));
if (Icc == NULL) return NULL;
// Empty values
@@ -258,7 +272,7 @@ icTagSignature LCMSEXPORT cmsGetTagSignature(cmsHPROFILE hProfile, icInt32Number
// Search for a specific tag in tag dictionary
// Returns position or -1 if tag not found
-icInt32Number _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, BOOL lSignalError)
+icInt32Number _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, LCMSBOOL lSignalError)
{
icInt32Number i;
@@ -279,7 +293,7 @@ icInt32Number _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, BOOL l
// Check existance
-BOOL LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig)
+LCMSBOOL LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
return _cmsSearchTag(Icc, sig, FALSE) >= 0;
@@ -298,7 +312,7 @@ LPVOID _cmsInitTag(LPLCMSICCPROFILE Icc, icTagSignature sig, size_t size, const
if (i >=0) {
- if (Icc -> TagPtrs[i]) free(Icc -> TagPtrs[i]);
+ if (Icc -> TagPtrs[i]) _cmsFree(Icc -> TagPtrs[i]);
}
else {
@@ -309,11 +323,14 @@ LPVOID _cmsInitTag(LPLCMSICCPROFILE Icc, icTagSignature sig, size_t size, const
cmsSignalError(LCMS_ERRC_ABORTED, "Too many tags (%d)", MAX_TABLE_TAG);
Icc ->TagCount = MAX_TABLE_TAG-1;
+ return NULL;
}
}
- Ptr = malloc(size);
+ Ptr = _cmsMalloc(size);
+ if (Ptr == NULL) return NULL;
+
CopyMemory(Ptr, Init, size);
Icc ->TagNames[i] = sig;
@@ -344,6 +361,8 @@ LPLCMSICCPROFILE _cmsCreateProfileFromFilePlaceholder(const char* FileName)
if (NewIcc == NULL) return NULL;
strncpy(NewIcc -> PhysicalFile, FileName, MAX_PATH-1);
+ NewIcc -> PhysicalFile[MAX_PATH-1] = 0;
+
NewIcc ->stream = ICCfile;
NewIcc ->Read = FileRead;
@@ -444,7 +463,7 @@ void _cmsSetSaveToMemory(LPLCMSICCPROFILE Icc, LPVOID MemPtr, size_t dwSize)
-BOOL LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
*Dest = Icc -> MediaWhitePoint;
@@ -452,14 +471,14 @@ BOOL LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
}
-BOOL LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
*Dest = Icc -> MediaBlackPoint;
return TRUE;
}
-BOOL LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
*Dest = Icc -> Illuminant;
@@ -517,7 +536,7 @@ void LCMSEXPORT cmsSetProfileID(cmsHPROFILE hProfile, LPBYTE ProfileID)
}
-BOOL LCMSEXPORT cmsTakeCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
CopyMemory(Dest, &Icc ->Created, sizeof(struct tm));
@@ -538,23 +557,18 @@ void LCMSEXPORT cmsSetPCS(cmsHPROFILE hProfile, icColorSpaceSignature pcs)
Icc -> PCS = pcs;
}
-
-
icColorSpaceSignature LCMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
return Icc -> ColorSpace;
}
-
-
void LCMSEXPORT cmsSetColorSpace(cmsHPROFILE hProfile, icColorSpaceSignature sig)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
Icc -> ColorSpace = sig;
}
-
icProfileClassSignature LCMSEXPORT cmsGetDeviceClass(cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
@@ -567,7 +581,6 @@ DWORD LCMSEXPORT cmsGetProfileICCversion(cmsHPROFILE hProfile)
return (DWORD) Icc -> Version;
}
-
void LCMSEXPORT cmsSetProfileICCversion(cmsHPROFILE hProfile, DWORD Version)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) hProfile;
@@ -606,7 +619,7 @@ LPVOID DupBlock(LPLCMSICCPROFILE Icc, LPVOID Block, size_t size)
// This is tricky, since LUT structs does have pointers
-BOOL LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile, icTagSignature sig, LPVOID lut)
+LCMSBOOL LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile, icTagSignature sig, const void* lut)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
LPLUT Orig, Stored;
@@ -634,7 +647,7 @@ BOOL LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile, icTagSignature sig, LPVOID l
}
-BOOL LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* XYZ)
+LCMSBOOL LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* XYZ)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -643,7 +656,7 @@ BOOL LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile, icTagSignature sig, const cm
}
-BOOL LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile, icTagSignature sig, const char* Text)
+LCMSBOOL LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile, icTagSignature sig, const char* Text)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -651,7 +664,7 @@ BOOL LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile, icTagSignature sig, const c
return TRUE;
}
-BOOL LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMMATABLE TransferFunction)
+LCMSBOOL LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMMATABLE TransferFunction)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -660,7 +673,7 @@ BOOL LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMM
}
-BOOL LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIExyYTRIPLE Chrm)
+LCMSBOOL LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIExyYTRIPLE Chrm)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -669,7 +682,7 @@ BOOL LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig,
}
-BOOL LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsSEQ pseq)
+LCMSBOOL LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsSEQ pseq)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -679,29 +692,40 @@ BOOL LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignatu
}
-BOOL LCMSEXPORT _cmsAddNamedColorTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc)
+LCMSBOOL LCMSEXPORT _cmsAddNamedColorTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
_cmsInitTag(Icc, sig, sizeof(cmsNAMEDCOLORLIST) + (nc ->nColors - 1) * sizeof(cmsNAMEDCOLOR), nc);
- return FALSE;
+ return TRUE;
}
-BOOL LCMSEXPORT _cmsAddDateTimeTag(cmsHPROFILE hProfile, icTagSignature sig, struct tm *DateTime)
+LCMSBOOL LCMSEXPORT _cmsAddDateTimeTag(cmsHPROFILE hProfile, icTagSignature sig, struct tm *DateTime)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
_cmsInitTag(Icc, sig, sizeof(struct tm), DateTime);
- return FALSE;
+ return TRUE;
}
-BOOL LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc)
+LCMSBOOL LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
_cmsInitTag(Icc, sig, sizeof(cmsNAMEDCOLORLIST) + (nc ->nColors - 1) * sizeof(cmsNAMEDCOLOR), nc);
- return FALSE;
+ return TRUE;
+}
+
+
+LCMSBOOL LCMSEXPORT _cmsAddChromaticAdaptationTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* mat)
+{
+ LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
+
+ _cmsInitTag(Icc, sig, 3*sizeof(cmsCIEXYZ), mat);
+ return TRUE;
+
}
+
diff --git a/icc2ps/cmsio1.c b/icc2ps/cmsio1.c
index d5f38b8..a3b183e 100755
--- a/icc2ps/cmsio1.c
+++ b/icc2ps/cmsio1.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -120,6 +120,7 @@ void AdjustEndianessArray16(LPWORD p, size_t num_words)
#endif
+
// Transports to properly encoded values - note that icc profiles does use
// big endian notation.
@@ -259,13 +260,17 @@ void EvalCHRM(LPcmsCIEXYZ Dest, LPMAT3 Chrm, LPcmsCIEXYZ Src)
// Read profile header and validate it
static
-LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
+LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc,
+ LCMSBOOL lIsFromMemory,
+ DWORD dwSize)
{
icTag Tag;
icHeader Header;
icInt32Number TagCount, i;
+ icUInt32Number extent;
- Icc -> Read(&Header, sizeof(icHeader), 1, Icc);
+ if (Icc -> Read(&Header, sizeof(icHeader), 1, Icc) != 1)
+ goto ErrorCleanup;
// Convert endian
@@ -277,14 +282,17 @@ LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
AdjustEndianess32((LPBYTE) &Header.pcs);
AdjustEndianess32((LPBYTE) &Header.magic);
AdjustEndianess32((LPBYTE) &Header.flags);
- AdjustEndianess32((LPBYTE) &Header.attributes[0]);
+ AdjustEndianess32((LPBYTE) &Header.attributes[0]);
AdjustEndianess32((LPBYTE) &Header.renderingIntent);
// Validate it
if (Header.magic != icMagicNumber) goto ErrorCleanup;
-
-
+
+ if (dwSize && dwSize != Header.size) {
+ goto ErrorCleanup;
+ }
+
if (Icc ->Read(&TagCount, sizeof(icInt32Number), 1, Icc) != 1)
goto ErrorCleanup;
@@ -295,7 +303,7 @@ LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
Icc -> PCS = Header.pcs;
Icc -> RenderingIntent = (icRenderingIntent) Header.renderingIntent;
Icc -> flags = Header.flags;
- Icc -> attributes = Header.attributes[0];
+ Icc -> attributes = Header.attributes[0];
Icc -> Illuminant.X = Convert15Fixed16(Header.illuminant.X);
Icc -> Illuminant.Y = Convert15Fixed16(Header.illuminant.Y);
Icc -> Illuminant.Z = Convert15Fixed16(Header.illuminant.Z);
@@ -319,7 +327,7 @@ LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
// Read tag directory
- if (TagCount > MAX_TABLE_TAG) {
+ if (TagCount > MAX_TABLE_TAG || TagCount < 0) {
cmsSignalError(LCMS_ERRC_ABORTED, "Too many tags (%d)", TagCount);
goto ErrorCleanup;
@@ -328,12 +336,18 @@ LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
Icc -> TagCount = TagCount;
for (i=0; i < TagCount; i++) {
- Icc ->Read(&Tag, sizeof(icTag), 1, Icc);
+ if (Icc ->Read(&Tag, sizeof(icTag), 1, Icc) != 1)
+ goto ErrorCleanup;
AdjustEndianess32((LPBYTE) &Tag.offset);
AdjustEndianess32((LPBYTE) &Tag.size);
AdjustEndianess32((LPBYTE) &Tag.sig); // Signature
+ // Perform some sanity check. Offset + size should fall inside file.
+ extent = Tag.offset + Tag.size;
+ if (extent > Header.size || extent < Tag.offset)
+ goto ErrorCleanup;
+
Icc -> TagNames[i] = Tag.sig;
Icc -> TagOffsets[i] = Tag.offset;
Icc -> TagSizes[i] = Tag.size;
@@ -345,19 +359,17 @@ LPLCMSICCPROFILE ReadHeader(LPLCMSICCPROFILE Icc, BOOL lIsFromMemory)
ErrorCleanup:
Icc ->Close(Icc);
- free(Icc);
if (lIsFromMemory)
cmsSignalError(LCMS_ERRC_ABORTED, "Corrupted memory profile");
else
cmsSignalError(LCMS_ERRC_ABORTED, "Corrupted profile: '%s'", Icc->PhysicalFile);
+
+ _cmsFree(Icc);
return NULL;
}
-
-
-
static
unsigned int uipow(unsigned int a, unsigned int b) {
unsigned int rv = 1;
@@ -467,7 +479,7 @@ void FixLUT8bothSides(LPLUT Lut, size_t nTabSize)
// The infamous LUT 8
static
-void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
+LCMSBOOL ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
{
icLut8 LUT8;
LPBYTE Temp;
@@ -476,7 +488,7 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
unsigned int AllLinear;
LPWORD PtrW;
- Icc ->Read(&LUT8, sizeof(icLut8) - SIZEOF_UINT8_ALIGNED, 1, Icc);
+ if (Icc ->Read(&LUT8, sizeof(icLut8) - SIZEOF_UINT8_ALIGNED, 1, Icc) != 1) return FALSE;
NewLUT -> wFlags = LUT_HASTL1|LUT_HASTL2|LUT_HAS3DGRID;
NewLUT -> cLutPoints = LUT8.clutPoints;
@@ -485,6 +497,10 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
NewLUT -> InputEntries = 256;
NewLUT -> OutputEntries = 256;
+ // Do some checking
+ if (!_cmsValidateLUT(NewLUT)) {
+ return FALSE;
+ }
AdjustEndianess32((LPBYTE) &LUT8.e00);
AdjustEndianess32((LPBYTE) &LUT8.e01);
@@ -512,7 +528,7 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
// Only operates if not identity...
- if (!MAT3isIdentity(&NewLUT -> Matrix, 0.0001)) {
+ if ((NewLUT -> InputChan == 3) && !MAT3isIdentity(&NewLUT -> Matrix, 0.0001)) {
NewLUT -> wFlags |= LUT_HASMATRIX;
}
@@ -520,13 +536,24 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
// Copy input tables
- Temp = (LPBYTE) malloc(256);
+ Temp = (LPBYTE) _cmsMalloc(256);
+ if (Temp == NULL) return FALSE;
+
AllLinear = 0;
for (i=0; i < NewLUT -> InputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * 256);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * 256);
+ if (PtrW == NULL) {
+ _cmsFree(Temp);
+ return FALSE;
+ }
+
NewLUT -> L1[i] = PtrW;
- Icc ->Read(Temp, 1, 256, Icc);
+ if (Icc ->Read(Temp, 1, 256, Icc) != 256) {
+ _cmsFree(Temp);
+ return FALSE;
+ }
+
for (j=0; j < 256; j++)
PtrW[j] = TO16_TAB(Temp[j]);
AllLinear += cmsIsLinear(NewLUT -> L1[i], NewLUT -> InputEntries);
@@ -539,7 +566,7 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
NewLUT -> wFlags &= ~LUT_HASTL1;
}
- free(Temp);
+ _cmsFree(Temp);
// Copy 3D CLUT
@@ -548,9 +575,20 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
if (nTabSize > 0) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * nTabSize);
- Temp = (LPBYTE) malloc(nTabSize);
- Icc ->Read(Temp, 1, nTabSize, Icc);
+ PtrW = (LPWORD) _cmsCalloc(sizeof(WORD), nTabSize);
+ if (PtrW == NULL) return FALSE;
+
+ Temp = (LPBYTE) _cmsMalloc(nTabSize);
+ if (Temp == NULL) {
+ _cmsFree(PtrW);
+ return FALSE;
+ }
+
+ if (Icc ->Read(Temp, 1, nTabSize, Icc) != nTabSize) {
+ _cmsFree(Temp);
+ _cmsFree(PtrW);
+ return FALSE;
+ }
NewLUT -> T = PtrW;
NewLUT -> Tsize = (unsigned int) (nTabSize * sizeof(WORD));
@@ -559,25 +597,37 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
*PtrW++ = TO16_TAB(Temp[i]);
}
- free(Temp);
+ _cmsFree(Temp);
}
else {
NewLUT ->T = NULL;
NewLUT ->Tsize = 0;
- NewLUT -> wFlags &= ~LUT_HAS3DGRID;
+ NewLUT ->wFlags &= ~LUT_HAS3DGRID;
}
-
// Copy output tables
- Temp = (LPBYTE) malloc(256);
+ Temp = (LPBYTE) _cmsMalloc(256);
+ if (Temp == NULL) {
+ return FALSE;
+ }
+
AllLinear = 0;
for (i=0; i < NewLUT -> OutputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * 256);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * 256);
+ if (PtrW == NULL) {
+ _cmsFree(Temp);
+ return FALSE;
+ }
+
NewLUT -> L2[i] = PtrW;
- Icc ->Read(Temp, 1, 256, Icc);
+ if (Icc ->Read(Temp, 1, 256, Icc) != 256) {
+ _cmsFree(Temp);
+ return FALSE;
+ }
+
for (j=0; j < 256; j++)
PtrW[j] = TO16_TAB(Temp[j]);
AllLinear += cmsIsLinear(NewLUT -> L2[i], 256);
@@ -591,7 +641,7 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
}
- free(Temp);
+ _cmsFree(Temp);
cmsCalcL16Params(NewLUT -> InputEntries, &NewLUT -> In16params);
cmsCalcL16Params(NewLUT -> OutputEntries, &NewLUT -> Out16params);
@@ -616,6 +666,15 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
// some profiles does claim to do that. Poor lcms will try
// to detect such condition and fix up "on the fly".
+ switch (sig) {
+
+ case icSigBToA0Tag:
+ case icSigBToA1Tag:
+ case icSigBToA2Tag:
+ case icSigGamutTag:
+ case icSigPreview0Tag:
+ case icSigPreview1Tag:
+ case icSigPreview2Tag:
{
LPWORD WhiteLab, ExpectedWhite;
WORD WhiteFixed[MAXCHANNELS], WhiteUnfixed[MAXCHANNELS];
@@ -655,9 +714,13 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
}
}
+ break;
+ default:;
+ }
}
+ return TRUE;
}
@@ -666,7 +729,7 @@ void ReadLUT8(LPLCMSICCPROFILE Icc, LPLUT NewLUT, icTagSignature sig)
// Case LUT 16
static
-void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
+LCMSBOOL ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
{
icLut16 LUT16;
size_t nTabSize;
@@ -675,7 +738,8 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
LPWORD PtrW;
- Icc ->Read(&LUT16, sizeof(icLut16)- SIZEOF_UINT16_ALIGNED, 1, Icc);
+ if (Icc ->Read(&LUT16, sizeof(icLut16)- SIZEOF_UINT16_ALIGNED, 1, Icc) != 1)
+ return FALSE;
NewLUT -> wFlags = LUT_HASTL1 | LUT_HASTL2 | LUT_HAS3DGRID;
NewLUT -> cLutPoints = LUT16.clutPoints;
@@ -688,6 +752,9 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
NewLUT -> InputEntries = LUT16.inputEnt;
NewLUT -> OutputEntries = LUT16.outputEnt;
+ if (!_cmsValidateLUT(NewLUT)) {
+ return FALSE;
+ }
// Matrix handling
@@ -713,7 +780,7 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
// Only operates if not identity...
- if (!MAT3isIdentity(&NewLUT -> Matrix, 0.0001)) {
+ if ((NewLUT -> InputChan == 3) && !MAT3isIdentity(&NewLUT -> Matrix, 0.0001)) {
NewLUT -> wFlags |= LUT_HASMATRIX;
}
@@ -724,9 +791,14 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
AllLinear = 0;
for (i=0; i < NewLUT -> InputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> InputEntries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> InputEntries);
+ if (PtrW == NULL) return FALSE;
+
NewLUT -> L1[i] = PtrW;
- Icc ->Read(PtrW, sizeof(WORD), NewLUT -> InputEntries, Icc);
+ if (Icc ->Read(PtrW, sizeof(WORD), NewLUT -> InputEntries, Icc) != NewLUT -> InputEntries) {
+ return FALSE;
+ }
+
AdjustEndianessArray16(PtrW, NewLUT -> InputEntries);
AllLinear += cmsIsLinear(NewLUT -> L1[i], NewLUT -> InputEntries);
}
@@ -745,12 +817,19 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
NewLUT->InputChan));
if (nTabSize > 0) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * nTabSize);
+ PtrW = (LPWORD) _cmsCalloc(sizeof(WORD), nTabSize);
+ if (PtrW == NULL) {
+ _cmsFree(PtrW);
+ return FALSE;
+ }
NewLUT -> T = PtrW;
NewLUT -> Tsize = (unsigned int) (nTabSize * sizeof(WORD));
- Icc -> Read(PtrW, sizeof(WORD), nTabSize, Icc);
+ if (Icc -> Read(PtrW, sizeof(WORD), nTabSize, Icc) != nTabSize) {
+ return FALSE;
+ }
+
AdjustEndianessArray16(NewLUT -> T, nTabSize);
}
else {
@@ -764,9 +843,16 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
AllLinear = 0;
for (i=0; i < NewLUT -> OutputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> OutputEntries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> OutputEntries);
+ if (PtrW == NULL) {
+ return FALSE;
+ }
+
NewLUT -> L2[i] = PtrW;
- Icc ->Read(PtrW, sizeof(WORD), NewLUT -> OutputEntries, Icc);
+ if (Icc ->Read(PtrW, sizeof(WORD), NewLUT -> OutputEntries, Icc) != NewLUT -> OutputEntries) {
+ return FALSE;
+ }
+
AdjustEndianessArray16(PtrW, NewLUT -> OutputEntries);
AllLinear += cmsIsLinear(NewLUT -> L2[i], NewLUT -> OutputEntries);
}
@@ -784,6 +870,8 @@ void ReadLUT16(LPLCMSICCPROFILE Icc, LPLUT NewLUT)
cmsCalcCLUT16Params(NewLUT -> cLutPoints, NewLUT -> InputChan,
NewLUT -> OutputChan,
&NewLUT -> CLut16params);
+
+ return TRUE;
}
@@ -799,18 +887,16 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE Icc)
int n;
- BaseType = ReadBase(Icc);
-
+ BaseType = ReadBase(Icc);
switch (BaseType) {
- case 0x9478ee00L: // Monaco 2 profiler is BROKEN!
+ case ((icTagTypeSignature) 0x9478ee00): // Monaco 2 profiler is BROKEN!
case icSigCurveType:
- Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc) != 1) return NULL;
AdjustEndianess32((LPBYTE) &Count);
-
switch (Count) {
case 0: // Linear.
@@ -825,7 +911,7 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE Icc)
{
WORD SingleGammaFixed;
- Icc ->Read(&SingleGammaFixed, sizeof(WORD), 1, Icc);
+ if (Icc ->Read(&SingleGammaFixed, sizeof(WORD), 1, Icc) != 1) return NULL;
AdjustEndianess16((LPBYTE) &SingleGammaFixed);
return cmsBuildGamma(4096, Convert8Fixed8(SingleGammaFixed));
}
@@ -835,10 +921,9 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE Icc)
NewGamma = cmsAllocGamma(Count);
if (!NewGamma) return NULL;
- Icc ->Read(NewGamma -> GammaTable, sizeof(WORD), Count, Icc);
-
+ if (Icc ->Read(NewGamma -> GammaTable, sizeof(WORD), Count, Icc) != Count)
+ return NULL;
AdjustEndianessArray16(NewGamma -> GammaTable, Count);
-
return NewGamma;
}
}
@@ -855,8 +940,8 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE Icc)
icUInt16Number Type;
int i;
- Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc);
- Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc);
+ if (Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
+ if (Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
AdjustEndianess16((LPBYTE) &Type);
if (Type > 5) {
@@ -870,7 +955,7 @@ LPGAMMATABLE ReadCurve(LPLCMSICCPROFILE Icc)
for (i=0; i < n; i++) {
Num = 0;
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
+ if (Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc) != 1) return NULL;
Params[i] = Convert15Fixed16(Num);
}
@@ -908,7 +993,7 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
case 0x9478ee00L: // Monaco 2 profiler is BROKEN!
case icSigCurveType:
- Icc -> Read(&Count, sizeof(icUInt32Number), 1, Icc);
+ if (Icc -> Read(&Count, sizeof(icUInt32Number), 1, Icc) != 1) return NULL;
AdjustEndianess32((LPBYTE) &Count);
@@ -918,6 +1003,7 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
NewGamma = cmsAllocGamma(2);
if (!NewGamma) return NULL;
+
NewGamma -> GammaTable[0] = 0;
NewGamma -> GammaTable[1] = 0xFFFF;
return NewGamma;
@@ -925,7 +1011,7 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
case 1: {
WORD SingleGammaFixed;
- Icc -> Read(&SingleGammaFixed, sizeof(WORD), 1, Icc);
+ if (Icc -> Read(&SingleGammaFixed, sizeof(WORD), 1, Icc) != 1) return NULL;
AdjustEndianess16((LPBYTE) &SingleGammaFixed);
return cmsBuildGamma(4096, 1./Convert8Fixed8(SingleGammaFixed));
}
@@ -935,7 +1021,8 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
NewGamma = cmsAllocGamma(Count);
if (!NewGamma) return NULL;
- Icc -> Read(NewGamma -> GammaTable, sizeof(WORD), Count, Icc);
+ if (Icc -> Read(NewGamma -> GammaTable, sizeof(WORD), Count, Icc) != Count)
+ return NULL;
AdjustEndianessArray16(NewGamma -> GammaTable, Count);
@@ -962,8 +1049,8 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
int i;
- Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc);
- Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc);
+ if (Icc -> Read(&Type, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
+ if (Icc -> Read(&Reserved, sizeof(icUInt16Number), 1, Icc) != 1) return NULL;
AdjustEndianess16((LPBYTE) &Type);
if (Type > 5) {
@@ -976,7 +1063,7 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
n = ParamsByType[Type];
for (i=0; i < n; i++) {
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
+ if (Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc) != 1) return NULL;
Params[i] = Convert15Fixed16(Num);
}
@@ -998,7 +1085,7 @@ LPGAMMATABLE ReadCurveReversed(LPLCMSICCPROFILE Icc)
// V4 stuff. Read matrix for LutAtoB and LutBtoA
static
-BOOL ReadMatrixOffset(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, DWORD dwFlags)
+LCMSBOOL ReadMatrixOffset(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, DWORD dwFlags)
{
icS15Fixed16Number All[12];
@@ -1008,7 +1095,8 @@ BOOL ReadMatrixOffset(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, DWORD d
if (Icc -> Seek(Icc, Offset)) return FALSE;
- Icc ->Read(All, sizeof(icS15Fixed16Number), 12, Icc);
+ if (Icc ->Read(All, sizeof(icS15Fixed16Number), 12, Icc) != 12)
+ return FALSE;
for (i=0; i < 12; i++)
AdjustEndianess32((LPBYTE) &All[i]);
@@ -1037,17 +1125,26 @@ BOOL ReadMatrixOffset(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, DWORD d
// V4 stuff. Read CLUT part for LutAtoB and LutBtoA
static
-BOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT)
+LCMSBOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT)
{
-
+ unsigned int j;
icCLutStruct CLUT;
if (Icc -> Seek(Icc, Offset)) return FALSE;
- Icc ->Read(&CLUT, sizeof(icCLutStruct), 1, Icc);
+ if (Icc ->Read(&CLUT, sizeof(icCLutStruct), 1, Icc) != 1) return FALSE;
- cmsAlloc3DGrid(NewLUT, CLUT.gridPoints[0], NewLUT ->InputChan,
- NewLUT ->OutputChan);
+ for (j=1; j < NewLUT ->InputChan; j++) {
+ if (CLUT.gridPoints[0] != CLUT.gridPoints[j]) {
+ cmsSignalError(LCMS_ERRC_ABORTED, "CLUT with different granulatity is currently unsupported.");
+ return FALSE;
+ }
+
+
+ }
+
+ if (cmsAlloc3DGrid(NewLUT, CLUT.gridPoints[0], NewLUT ->InputChan,
+ NewLUT ->OutputChan) == NULL) return FALSE;
// Precission can be 1 or 2 bytes
@@ -1057,7 +1154,7 @@ BOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT)
unsigned int i;
for (i=0; i < NewLUT->Tsize / sizeof(WORD); i++) {
- Icc ->Read(&v, sizeof(BYTE), 1, Icc);
+ if (Icc ->Read(&v, sizeof(BYTE), 1, Icc) != 1) return FALSE;
NewLUT->T[i] = TO16_TAB(v);
}
@@ -1065,10 +1162,10 @@ BOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT)
else
if (CLUT.prec == 2) {
- Icc ->Read(NewLUT ->T, sizeof(WORD),
- NewLUT->Tsize / sizeof(WORD), Icc);
+ size_t n = NewLUT->Tsize / sizeof(WORD);
- AdjustEndianessArray16(NewLUT ->T, NewLUT->Tsize / sizeof(WORD));
+ if (Icc ->Read(NewLUT ->T, sizeof(WORD), n, Icc) != n) return FALSE;
+ AdjustEndianessArray16(NewLUT ->T, NewLUT->Tsize / sizeof(WORD));
}
else {
cmsSignalError(LCMS_ERRC_ABORTED, "Unknow precission of '%d'", CLUT.prec);
@@ -1080,6 +1177,22 @@ BOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT)
static
+void ResampleCurves(LPGAMMATABLE Curves[], int nCurves)
+{
+ int i;
+ LPSAMPLEDCURVE sc;
+
+ for (i=0; i < nCurves; i++) {
+ sc = cmsConvertGammaToSampledCurve(Curves[i], 4096);
+ cmsFreeGamma(Curves[i]);
+ Curves[i] = cmsConvertSampledCurveToGamma(sc, 0xFFFF);
+ cmsFreeSampledCurve(sc);
+ }
+
+}
+
+
+static
void SkipAlignment(LPLCMSICCPROFILE Icc)
{
BYTE Buffer[4];
@@ -1091,7 +1204,7 @@ void SkipAlignment(LPLCMSICCPROFILE Icc)
// Read a set of curves from specific offset
static
-BOOL ReadSetOfCurves(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, int nLocation)
+LCMSBOOL ReadSetOfCurves(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, int nLocation)
{
LPGAMMATABLE Curves[MAXCHANNELS];
unsigned int i, nCurves;
@@ -1104,11 +1217,22 @@ BOOL ReadSetOfCurves(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, int nLoc
else
nCurves = NewLUT ->OutputChan;
+ ZeroMemory(Curves, sizeof(Curves));
for (i=0; i < nCurves; i++) {
Curves[i] = ReadCurve(Icc);
+ if (Curves[i] == NULL) goto Error;
SkipAlignment(Icc);
-
+ }
+
+ // March-26'08: some V4 profiles may have different sampling
+ // rates, in this case resample all curves to maximum
+
+ for (i=1; i < nCurves; i++) {
+ if (Curves[i]->nEntries != Curves[0]->nEntries) {
+ ResampleCurves(Curves, nCurves);
+ break;
+ }
}
NewLUT = cmsAllocLinearTable(NewLUT, Curves, nLocation);
@@ -1118,6 +1242,16 @@ BOOL ReadSetOfCurves(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, int nLoc
return TRUE;
+Error:
+ for (i=0; i < nCurves; i++) {
+
+ if (Curves[i])
+ cmsFreeGamma(Curves[i]);
+ }
+
+ return FALSE;
+
+
}
// V4 stuff. LutAtoB type
@@ -1130,22 +1264,28 @@ BOOL ReadSetOfCurves(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT, int nLoc
// L2 = B curves
static
-BOOL ReadLUT_A2B(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSignature sig)
+LCMSBOOL ReadLUT_A2B(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSignature sig)
{
icLutAtoB LUT16;
- Icc ->Read(&LUT16, sizeof(icLutAtoB), 1, Icc);
+ if (Icc ->Read(&LUT16, sizeof(icLutAtoB), 1, Icc) != 1) return FALSE;
NewLUT -> InputChan = LUT16.inputChan;
NewLUT -> OutputChan = LUT16.outputChan;
+ // Validate the NewLUT here to avoid excessive number of channels
+ // (leading to stack-based buffer overflow in ReadSetOfCurves).
+ // Needs revalidation after table size is filled in.
+ if (!_cmsValidateLUT(NewLUT)) {
+ return FALSE;
+ }
+
AdjustEndianess32((LPBYTE) &LUT16.offsetB);
AdjustEndianess32((LPBYTE) &LUT16.offsetMat);
AdjustEndianess32((LPBYTE) &LUT16.offsetM);
AdjustEndianess32((LPBYTE) &LUT16.offsetC);
AdjustEndianess32((LPBYTE) &LUT16.offsetA);
-
-
+
if (LUT16.offsetB != 0)
ReadSetOfCurves(Icc, BaseOffset + LUT16.offsetB, NewLUT, 2);
@@ -1190,15 +1330,22 @@ BOOL ReadLUT_A2B(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSig
// V4 stuff. LutBtoA type
static
-BOOL ReadLUT_B2A(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSignature sig)
+LCMSBOOL ReadLUT_B2A(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSignature sig)
{
icLutBtoA LUT16;
- Icc ->Read(&LUT16, sizeof(icLutBtoA), 1, Icc);
+ if (Icc ->Read(&LUT16, sizeof(icLutBtoA), 1, Icc) != 1) return FALSE;
NewLUT -> InputChan = LUT16.inputChan;
NewLUT -> OutputChan = LUT16.outputChan;
+ // Validate the NewLUT here to avoid excessive number of channels
+ // (leading to stack-based buffer overflow in ReadSetOfCurves).
+ // Needs revalidation after table size is filled in.
+ if (!_cmsValidateLUT(NewLUT)) {
+ return FALSE;
+ }
+
AdjustEndianess32((LPBYTE) &LUT16.offsetB);
AdjustEndianess32((LPBYTE) &LUT16.offsetMat);
AdjustEndianess32((LPBYTE) &LUT16.offsetM);
@@ -1211,8 +1358,7 @@ BOOL ReadLUT_B2A(LPLCMSICCPROFILE Icc, LPLUT NewLUT, size_t BaseOffset, icTagSi
if (LUT16.offsetMat != 0)
ReadMatrixOffset(Icc, BaseOffset + LUT16.offsetMat, NewLUT, LUT_HASMATRIX3);
-
-
+
if (LUT16.offsetM != 0)
ReadSetOfCurves(Icc, BaseOffset + LUT16.offsetM, NewLUT, 3);
@@ -1264,7 +1410,7 @@ LPLUT LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig)
// If is in memory, the LUT is already there, so throw a copy
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
return cmsDupLUT((LPLUT) Icc ->TagPtrs[n]);
}
@@ -1278,8 +1424,8 @@ LPLUT LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig)
NewLUT = cmsAllocLUT();
- if (!NewLUT)
- {
+ if (!NewLUT) {
+
cmsSignalError(LCMS_ERRC_ABORTED, "cmsAllocLUT() failed");
return NULL;
}
@@ -1287,11 +1433,29 @@ LPLUT LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig)
switch (BaseType) {
- case icSigLut8Type: ReadLUT8(Icc, NewLUT, sig); break;
- case icSigLut16Type: ReadLUT16(Icc, NewLUT); break;
-
- case icSiglutAtoBType: ReadLUT_A2B(Icc, NewLUT, offset, sig); break;
- case icSiglutBtoAType: ReadLUT_B2A(Icc, NewLUT, offset, sig); break;
+ case icSigLut8Type: if (!ReadLUT8(Icc, NewLUT, sig)) {
+ cmsFreeLUT(NewLUT);
+ return NULL;
+ }
+ break;
+
+ case icSigLut16Type: if (!ReadLUT16(Icc, NewLUT)) {
+ cmsFreeLUT(NewLUT);
+ return NULL;
+ }
+ break;
+
+ case icSiglutAtoBType: if (!ReadLUT_A2B(Icc, NewLUT, offset, sig)) {
+ cmsFreeLUT(NewLUT);
+ return NULL;
+ }
+ break;
+
+ case icSiglutBtoAType: if (!ReadLUT_B2A(Icc, NewLUT, offset, sig)) {
+ cmsFreeLUT(NewLUT);
+ return NULL;
+ }
+ break;
default: cmsSignalError(LCMS_ERRC_ABORTED, "Bad tag signature %lx found.", BaseType);
cmsFreeLUT(NewLUT);
@@ -1305,25 +1469,31 @@ LPLUT LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig)
// Sets the language & country preferences. Used only in ICC 4.0 profiles
-void LCMSEXPORT cmsSetLanguage(int LanguageCode, int CountryCode)
+void LCMSEXPORT cmsSetLanguage(const char LanguageCode[4], const char CountryCode[4])
{
- GlobalLanguageCode = LanguageCode;
- GlobalCountryCode = CountryCode;
+
+ int LanguageCodeInt = *(int *) LanguageCode;
+ int CountryCodeInt = *(int *) CountryCode;
+
+ AdjustEndianess32((LPBYTE) &LanguageCodeInt);
+ AdjustEndianess32((LPBYTE) &CountryCodeInt);
+
+ GlobalLanguageCode = LanguageCodeInt;
+ GlobalCountryCode = CountryCodeInt;
}
// Some tags (e.g, 'pseq') can have text tags embedded. This function
-// handles such special case.
+// handles such special case. Returns -1 on error, or the number of bytes left on success.
static
-int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
+int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name, size_t size_max)
{
icTagTypeSignature BaseType;
- BaseType = ReadBase(Icc);
-
+ BaseType = ReadBase(Icc);
size -= sizeof(icTagBase);
switch (BaseType) {
@@ -1335,52 +1505,76 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
icUInt16Number ScriptCodeCode, Dummy;
icUInt8Number ScriptCodeCount;
- Icc ->Read(&AsciiCount, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&AsciiCount, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
+
+ if (size < sizeof(icUInt32Number)) return (int) size;
size -= sizeof(icUInt32Number);
AdjustEndianess32((LPBYTE) &AsciiCount);
- Icc ->Read(Name, 1, AsciiCount, Icc);
+ Icc ->Read(Name, 1,
+ (AsciiCount >= size_max) ? (size_max-1) : AsciiCount, Icc);
+
+ if (size < AsciiCount) return (int) size;
size -= AsciiCount;
// Skip Unicode code
- Icc ->Read(&UnicodeCode, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&UnicodeCode, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
+ if (size < sizeof(icUInt32Number)) return (int) size;
size -= sizeof(icUInt32Number);
- Icc ->Read(&UnicodeCount, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&UnicodeCount, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
+ if (size < sizeof(icUInt32Number)) return (int) size;
size -= sizeof(icUInt32Number);
AdjustEndianess32((LPBYTE) &UnicodeCount);
if (UnicodeCount > size) return (int) size;
- for (i=0; i < UnicodeCount; i++)
- Icc ->Read(&Dummy, sizeof(icUInt16Number), 1, Icc);
-
- size -= UnicodeCount * sizeof(icUInt16Number);
-
+ for (i=0; i < UnicodeCount; i++) {
+ size_t nread = Icc ->Read(&Dummy, sizeof(icUInt16Number), 1, Icc);
+ if (nread != 1) return (int) size;
+ size -= sizeof(icUInt16Number);
+ }
+
// Skip ScriptCode code
- Icc ->Read(&ScriptCodeCode, sizeof(icUInt16Number), 1, Icc);
+ if (Icc ->Read(&ScriptCodeCode, sizeof(icUInt16Number), 1, Icc) != 1) return -1;
size -= sizeof(icUInt16Number);
- Icc ->Read(&ScriptCodeCount, sizeof(icUInt8Number), 1, Icc);
+ if (Icc ->Read(&ScriptCodeCount, sizeof(icUInt8Number), 1, Icc) != 1) return -1;
size -= sizeof(icUInt8Number);
- if (size < 67) return (int) size;
+ // Should remain 67 bytes as filler
- for (i=0; i < 67; i++)
- Icc ->Read(&Dummy, sizeof(icUInt8Number), 1, Icc);
+ if (size < 67) return (int) size;
- size -= 67;
+ for (i=0; i < 67; i++) {
+ size_t nread = Icc ->Read(&Dummy, sizeof(icUInt8Number), 1, Icc);
+ if (nread != 1) return (int) size;
+ size --;
+ }
}
break;
case icSigCopyrightTag: // Broken profiles from agfa does store copyright info in such type
case icSigTextType:
-
- Icc -> Read(Name, 1, size, Icc);
- break;
+ {
+ char Dummy;
+ size_t i, Missing = 0;
+
+ if (size >= size_max) {
+
+ Missing = size - size_max + 1;
+ size = size_max - 1;
+ }
+
+ if (Icc -> Read(Name, 1, size, Icc) != size) return -1;
+
+ for (i=0; i < Missing; i++)
+ Icc -> Read(&Dummy, 1, 1, Icc);
+ }
+ break;
// MultiLocalizedUnicodeType, V4 only
@@ -1395,9 +1589,9 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
wchar_t* wchar = L"";
- Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
AdjustEndianess32((LPBYTE) &Count);
- Icc ->Read(&RecLen, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&RecLen, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
AdjustEndianess32((LPBYTE) &RecLen);
if (RecLen != 12) {
@@ -1408,15 +1602,15 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
for (i=0; i < Count; i++) {
- Icc ->Read(&Language, sizeof(icUInt16Number), 1, Icc);
+ if (Icc ->Read(&Language, sizeof(icUInt16Number), 1, Icc) != 1) return -1;
AdjustEndianess16((LPBYTE) &Language);
- Icc ->Read(&Country, sizeof(icUInt16Number), 1, Icc);
+ if (Icc ->Read(&Country, sizeof(icUInt16Number), 1, Icc) != 1) return -1;
AdjustEndianess16((LPBYTE) &Country);
- Icc ->Read(&ThisLen, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&ThisLen, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
AdjustEndianess32((LPBYTE) &ThisLen);
- Icc ->Read(&ThisOffset, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&ThisOffset, sizeof(icUInt32Number), 1, Icc) != 1) return -1;
AdjustEndianess32((LPBYTE) &ThisOffset);
if (Language == GlobalLanguageCode || Offset == 0) {
@@ -1442,24 +1636,30 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
for (i=0; i < Offset; i++) {
char Discard;
-
+ // No return checking; could lead to large loop in
+ // combination with int oflow above computing Offset.
Icc ->Read(&Discard, 1, 1, Icc);
}
- wchar = (wchar_t*) malloc(Len+2);
+
+ // Bound len
+ if (Len < 0) Len = 0;
+ if (Len > 20*1024) Len = 20 * 1024;
+
+ wchar = (wchar_t*) _cmsMalloc(Len*sizeof(wchar_t)+2);
if (!wchar) return -1;
- Icc ->Read(wchar, 1, Len, Icc);
+ if (Icc ->Read(wchar, 1, Len, Icc) != Len) return -1;
AdjustEndianessArray16((LPWORD) wchar, Len / 2);
wchar[Len / 2] = L'\0';
- i = wcstombs(Name, wchar, 2047 );
+ i = wcstombs(Name, wchar, size_max );
if (i == ((size_t) -1)) {
Name[0] = 0; // Error
}
- free((void*) wchar);
+ _cmsFree((void*) wchar);
}
break;
@@ -1472,10 +1672,10 @@ int ReadEmbeddedTextTag(LPLCMSICCPROFILE Icc, size_t size, char* Name)
}
-// Take an ASCII item
+// Take an ASCII item. Takes at most LCMS_DESC_MAX
-int LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Name)
+int LCMSEXPORT cmsReadICCTextEx(cmsHPROFILE hProfile, icTagSignature sig, char *Name, size_t size_max)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
size_t offset, size;
@@ -1485,7 +1685,7 @@ int LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Na
if (n < 0)
return -1;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
CopyMemory(Name, Icc -> TagPtrs[n], Icc -> TagSizes[n]);
return (int) Icc -> TagSizes[n];
@@ -1497,16 +1697,21 @@ int LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Na
if (Icc -> Seek(Icc, offset))
return -1;
- return ReadEmbeddedTextTag(Icc, size, Name);
-
+ return ReadEmbeddedTextTag(Icc, size, Name, size_max);
}
+// Keep compatibility with older versions
+
+int LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Text)
+{
+ return cmsReadICCTextEx(hProfile, sig, Text, LCMS_DESC_MAX);
+}
// Take an XYZ item
static
-int ReadICCXYZ(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIEXYZ Value, BOOL lIsFatal)
+int ReadICCXYZ(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIEXYZ Value, LCMSBOOL lIsFatal)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
icTagTypeSignature BaseType;
@@ -1518,7 +1723,7 @@ int ReadICCXYZ(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIEXYZ Value, BOOL
if (n < 0)
return -1;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
CopyMemory(Value, Icc -> TagPtrs[n], Icc -> TagSizes[n]);
return (int) Icc -> TagSizes[n];
@@ -1573,7 +1778,7 @@ int ReadICCXYZArray(cmsHPROFILE hProfile, icTagSignature sig, LPMAT3 v)
if (n < 0)
return -1; // Not found
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
CopyMemory(v, Icc -> TagPtrs[n], Icc -> TagSizes[n]);
return (int) Icc -> TagSizes[n];
@@ -1622,7 +1827,7 @@ int ReadICCXYZArray(cmsHPROFILE hProfile, icTagSignature sig, LPMAT3 v)
// Primaries are to be in xyY notation
-BOOL LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile)
{
if (ReadICCXYZ(hProfile, icSigRedColorantTag, &Dest -> Red, TRUE) < 0) return FALSE;
if (ReadICCXYZ(hProfile, icSigGreenColorantTag, &Dest -> Green, TRUE) < 0) return FALSE;
@@ -1632,7 +1837,7 @@ BOOL LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile)
}
-BOOL cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile)
+LCMSBOOL cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile)
{
cmsCIEXYZTRIPLE Primaries;
@@ -1649,7 +1854,7 @@ BOOL cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile)
// Always return a suitable matrix
-BOOL cmsReadChromaticAdaptationMatrix(LPMAT3 r, cmsHPROFILE hProfile)
+LCMSBOOL cmsReadChromaticAdaptationMatrix(LPMAT3 r, cmsHPROFILE hProfile)
{
if (ReadICCXYZArray(hProfile, icSigChromaticAdaptationTag, r) < 0) {
@@ -1686,7 +1891,7 @@ LPGAMMATABLE LCMSEXPORT cmsReadICCGamma(cmsHPROFILE hProfile, icTagSignature sig
if (n < 0)
return NULL;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
return cmsDupGamma((LPGAMMATABLE) Icc -> TagPtrs[n]);
}
@@ -1714,7 +1919,7 @@ LPGAMMATABLE LCMSEXPORT cmsReadICCGammaReversed(cmsHPROFILE hProfile, icTagSigna
if (n < 0)
return NULL;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
return cmsReverseGamma(256, (LPGAMMATABLE) Icc -> TagPtrs[n]);
}
@@ -1730,7 +1935,7 @@ LPGAMMATABLE LCMSEXPORT cmsReadICCGammaReversed(cmsHPROFILE hProfile, icTagSigna
// Check Named color header
static
-BOOL CheckHeader(LPcmsNAMEDCOLORLIST v, icNamedColor2* nc2)
+LCMSBOOL CheckHeader(LPcmsNAMEDCOLORLIST v, icNamedColor2* nc2)
{
if (v ->Prefix[0] == 0 && v ->Suffix[0] == 0 && v ->ColorantCount == 0) return TRUE;
@@ -1754,13 +1959,13 @@ int cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSig
if (n < 0)
return 0;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
// This replaces actual named color list.
size_t size = Icc -> TagSizes[n];
if (v ->NamedColorList) cmsFreeNamedColorList(v ->NamedColorList);
- v -> NamedColorList = (LPcmsNAMEDCOLORLIST) malloc(size);
+ v -> NamedColorList = (LPcmsNAMEDCOLORLIST) _cmsMalloc(size);
CopyMemory(v -> NamedColorList, Icc ->TagPtrs[n], size);
return v ->NamedColorList->nColors;
}
@@ -1789,13 +1994,19 @@ int cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSig
icNamedColor2 nc2;
unsigned int i, j;
- Icc -> Read(&nc2, sizeof(icNamedColor2) - SIZEOF_UINT8_ALIGNED, 1, Icc);
+ if (Icc -> Read(&nc2, sizeof(icNamedColor2) - SIZEOF_UINT8_ALIGNED, 1, Icc) != 1) return 0;
AdjustEndianess32((LPBYTE) &nc2.vendorFlag);
AdjustEndianess32((LPBYTE) &nc2.count);
AdjustEndianess32((LPBYTE) &nc2.nDeviceCoords);
if (!CheckHeader(v->NamedColorList, &nc2)) {
cmsSignalError(LCMS_ERRC_WARNING, "prefix/suffix/device for named color profiles mismatch.");
+ return 0;
+ }
+
+ if (nc2.nDeviceCoords > MAXCHANNELS) {
+ cmsSignalError(LCMS_ERRC_WARNING, "Too many device coordinates.");
+ return 0;
}
strncpy(v ->NamedColorList->Prefix, (const char*) nc2.prefix, 32);
@@ -1811,6 +2022,8 @@ int cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSig
char Root[33];
ZeroMemory(Colorant, sizeof(WORD) * MAXCHANNELS);
+ // No return value checking; could cause trouble with
+ // large count.
Icc -> Read(Root, 1, 32, Icc);
Icc -> Read(PCS, 3, sizeof(WORD), Icc);
@@ -1843,8 +2056,9 @@ int cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSig
// Read colorant tables
LPcmsNAMEDCOLORLIST LCMSEXPORT cmsReadColorantTable(cmsHPROFILE hProfile, icTagSignature sig)
-{
- icInt32Number n, Count, i;
+{
+ icInt32Number n;
+ icUInt32Number Count, i;
size_t offset;
icTagTypeSignature BaseType;
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -1854,10 +2068,12 @@ LPcmsNAMEDCOLORLIST LCMSEXPORT cmsReadColorantTable(cmsHPROFILE hProfile, icTagS
if (n < 0)
return NULL; // Not found
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
size_t size = Icc -> TagSizes[n];
- void* v = malloc(size);
+ void* v = _cmsMalloc(size);
+
+ if (v == NULL) return NULL;
CopyMemory(v, Icc -> TagPtrs[n], size);
return (LPcmsNAMEDCOLORLIST) v;
}
@@ -1876,13 +2092,17 @@ LPcmsNAMEDCOLORLIST LCMSEXPORT cmsReadColorantTable(cmsHPROFILE hProfile, icTagS
}
- Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc);
+ if (Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc) != 1) return NULL;
AdjustEndianess32((LPBYTE) &Count);
+ if (Count > MAXCHANNELS) {
+ cmsSignalError(LCMS_ERRC_ABORTED, "Too many colorants '%lx'", Count);
+ return NULL;
+ }
+
List = cmsAllocNamedColorList(Count);
for (i=0; i < Count; i++) {
-
if (!Icc ->Read(List->List[i].Name, 1, 32 , Icc)) goto Error;
if (!Icc ->Read(List->List[i].PCS, sizeof(icUInt16Number), 3, Icc)) goto Error;
AdjustEndianessArray16(List->List[i].PCS, 3);
@@ -1903,13 +2123,13 @@ Error:
const char* LCMSEXPORT cmsTakeManufacturer(cmsHPROFILE hProfile)
{
- static char Manufacturer[512] = "";
+ static char Manufacturer[LCMS_DESC_MAX] = "";
Manufacturer[0] = 0;
if (cmsIsTag(hProfile, icSigDeviceMfgDescTag)) {
- cmsReadICCText(hProfile, icSigDeviceMfgDescTag, Manufacturer);
+ cmsReadICCTextEx(hProfile, icSigDeviceMfgDescTag, Manufacturer, LCMS_DESC_MAX);
}
return Manufacturer;
@@ -1920,13 +2140,13 @@ const char* LCMSEXPORT cmsTakeManufacturer(cmsHPROFILE hProfile)
const char* LCMSEXPORT cmsTakeModel(cmsHPROFILE hProfile)
{
- static char Model[512] = "";
+ static char Model[LCMS_DESC_MAX] = "";
Model[0] = 0;
if (cmsIsTag(hProfile, icSigDeviceModelDescTag)) {
- cmsReadICCText(hProfile, icSigDeviceModelDescTag, Model);
+ cmsReadICCTextEx(hProfile, icSigDeviceModelDescTag, Model, LCMS_DESC_MAX);
}
return Model;
@@ -1936,13 +2156,12 @@ const char* LCMSEXPORT cmsTakeModel(cmsHPROFILE hProfile)
const char* LCMSEXPORT cmsTakeCopyright(cmsHPROFILE hProfile)
{
- static char Copyright[512] = "";
+ static char Copyright[LCMS_DESC_MAX] = "";
Copyright[0] = 0;
-
if (cmsIsTag(hProfile, icSigCopyrightTag)) {
- cmsReadICCText(hProfile, icSigCopyrightTag, Copyright);
+ cmsReadICCTextEx(hProfile, icSigCopyrightTag, Copyright, LCMS_DESC_MAX);
}
return Copyright;
@@ -1953,27 +2172,27 @@ const char* LCMSEXPORT cmsTakeCopyright(cmsHPROFILE hProfile)
const char* LCMSEXPORT cmsTakeProductName(cmsHPROFILE hProfile)
{
- static char Name[2048];
- char Manufacturer[512], Model[512];
+ static char Name[LCMS_DESC_MAX*2+4];
+ char Manufacturer[LCMS_DESC_MAX], Model[LCMS_DESC_MAX];
Name[0] = '\0';
Manufacturer[0] = Model[0] = '\0';
if (cmsIsTag(hProfile, icSigDeviceMfgDescTag)) {
- cmsReadICCText(hProfile, icSigDeviceMfgDescTag, Manufacturer);
+ cmsReadICCTextEx(hProfile, icSigDeviceMfgDescTag, Manufacturer, LCMS_DESC_MAX);
}
if (cmsIsTag(hProfile, icSigDeviceModelDescTag)) {
- cmsReadICCText(hProfile, icSigDeviceModelDescTag, Model);
+ cmsReadICCTextEx(hProfile, icSigDeviceModelDescTag, Model, LCMS_DESC_MAX);
}
if (!Manufacturer[0] && !Model[0]) {
if (cmsIsTag(hProfile, icSigProfileDescriptionTag)) {
- cmsReadICCText(hProfile, icSigProfileDescriptionTag, Name);
+ cmsReadICCTextEx(hProfile, icSigProfileDescriptionTag, Name, LCMS_DESC_MAX);
return Name;
}
else return "{no name}";
@@ -2030,7 +2249,7 @@ const char* LCMSEXPORT cmsTakeProductInfo(cmsHPROFILE hProfile)
if (cmsIsTag(hProfile, icSigCopyrightTag))
{
- char Copyright[2048];
+ char Copyright[LCMS_DESC_MAX];
cmsReadICCText(hProfile, icSigCopyrightTag, Copyright);
strcat(Info, Copyright);
@@ -2047,7 +2266,7 @@ const char* LCMSEXPORT cmsTakeProductInfo(cmsHPROFILE hProfile)
if (cmsIsTag(hProfile, K007))
{
- char MonCal[1024];
+ char MonCal[LCMS_DESC_MAX];
cmsReadICCText(hProfile, K007, MonCal);
strcat(Info, MonCal);
@@ -2073,7 +2292,7 @@ const char* LCMSEXPORT cmsTakeProductInfo(cmsHPROFILE hProfile)
// Extract the target data as a big string. Does not signal if tag is not present.
-BOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t* len)
+LCMSBOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t* len)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
int n;
@@ -2086,7 +2305,11 @@ BOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t*
*len = Icc -> TagSizes[n];
- *Data = (char*) malloc(*len + 1);
+
+ // Make sure that is reasonable (600K)
+ if (*len > 600*1024) *len = 600*1024;
+
+ *Data = (char*) _cmsMalloc(*len + 1); // Plus zero marker
if (!*Data) {
@@ -2094,7 +2317,7 @@ BOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t*
return FALSE;
}
- if (cmsReadICCText(hProfile, icSigCharTargetTag, *Data) < 0)
+ if (cmsReadICCTextEx(hProfile, icSigCharTargetTag, *Data, *len) < 0)
return FALSE;
(*Data)[*len] = 0; // Force a zero marker. Shouldn't be needed, but is
@@ -2106,7 +2329,7 @@ BOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t*
-BOOL LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
int n;
@@ -2114,8 +2337,8 @@ BOOL LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile
n = _cmsSearchTag(Icc, icSigCalibrationDateTimeTag, FALSE);
if (n < 0) return FALSE;
- if (!Icc ->stream)
- {
+ if (Icc ->TagPtrs[n]) {
+
CopyMemory(Dest, Icc ->TagPtrs[n], sizeof(struct tm));
}
else
@@ -2156,9 +2379,10 @@ LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile)
size = Icc -> TagSizes[n];
if (size < 12) return NULL;
- if (!Icc -> stream) {
+ if (Icc -> TagPtrs[n]) {
- OutSeq = (LPcmsSEQ) malloc(size);
+ OutSeq = (LPcmsSEQ) _cmsMalloc(size);
+ if (OutSeq == NULL) return NULL;
CopyMemory(OutSeq, Icc ->TagPtrs[n], size);
return OutSeq;
}
@@ -2174,9 +2398,14 @@ LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile)
Icc ->Read(&Count, sizeof(icUInt32Number), 1, Icc);
AdjustEndianess32((LPBYTE) &Count);
-
+
+ if (Count > 1000) {
+ return NULL;
+ }
+
size = sizeof(int) + Count * sizeof(cmsPSEQDESC);
- OutSeq = (LPcmsSEQ) malloc(size);
+ OutSeq = (LPcmsSEQ) _cmsMalloc(size);
+ if (OutSeq == NULL) return NULL;
OutSeq ->n = Count;
@@ -2200,8 +2429,8 @@ LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile)
sec ->deviceModel = DescStruct.deviceModel;
sec ->technology = DescStruct.technology;
- if (ReadEmbeddedTextTag(Icc, size, sec ->Manufacturer) < 0) return NULL;
- if (ReadEmbeddedTextTag(Icc, size, sec ->Model) < 0) return NULL;
+ if (ReadEmbeddedTextTag(Icc, size, sec ->Manufacturer, LCMS_DESC_MAX) < 0) return NULL;
+ if (ReadEmbeddedTextTag(Icc, size, sec ->Model, LCMS_DESC_MAX) < 0) return NULL;
}
@@ -2209,177 +2438,14 @@ LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile)
}
-
-// Extended gamut -- an HP extension
-
-
-LPcmsGAMUTEX LCMSEXPORT cmsReadExtendedGamut(cmsHPROFILE hProfile, int index)
+void LCMSEXPORT cmsFreeProfileSequenceDescription(LPcmsSEQ pseq)
{
- LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
- size_t size, offset;
- icUInt32Number off_samp, off_desc, off_vc;
- int n;
- icTagTypeSignature BaseType;
- icColorSpaceSignature CoordSig;
- icUInt16Number Method, Usage;
- icUInt32Number GamutCount, SamplesCount;
- LPcmsGAMUTEX gex;
- size_t Offsets[256];
- size_t i, Actual, Loc;
- icS15Fixed16Number Num;
- icUInt16Number Surround;
-
-
- n = _cmsSearchTag(Icc, icSigHPGamutDescTag, FALSE);
- if (n < 0) return NULL;
-
- if (!Icc ->stream) return NULL; // In memory is not supported
-
- // Read the header
-
- offset = Icc -> TagOffsets[n];
-
- if (Icc -> Seek(Icc, offset))
- return NULL;
-
- // Here is the beginning of tag
- Actual = Icc ->Tell(Icc);
-
-
- BaseType = ReadBase(Icc);
-
- if (BaseType != icSigHPGamutDescType) {
- cmsSignalError(LCMS_ERRC_ABORTED, "Bad tag signature '%lx' found.", BaseType);
- return NULL;
- }
-
-
- // Read the gamut descriptors count
- Icc ->Read(&GamutCount, sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &GamutCount);
-
-
- if (GamutCount >= 256) {
- cmsSignalError(LCMS_ERRC_ABORTED, "Too many gamut structures '%d'.", GamutCount);
- return NULL;
- }
-
- // Read the directory
-
- for (i=0; i < GamutCount; i++) {
-
- Icc ->Read(&Offsets[i], sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &Offsets[i]);
- }
-
-
- // Is there such element?
- if (index >= (int) GamutCount) return NULL;
- Loc = Actual + Offsets[index];
-
-
- // Go to specified index
- if (Icc -> Seek(Icc, Loc))
- return NULL;
-
-
- // Read all members
- Icc ->Read(&CoordSig, sizeof(icColorSpaceSignature), 1, Icc);
- AdjustEndianess32((LPBYTE) &CoordSig);
-
- Icc ->Read(&Method, sizeof(icUInt16Number), 1, Icc);
- AdjustEndianess16((LPBYTE) &Method);
-
- Icc ->Read(&Usage, sizeof(icUInt16Number), 1, Icc);
- AdjustEndianess16((LPBYTE) &Usage);
-
- Icc ->Read(&SamplesCount, sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &SamplesCount);
-
- Icc ->Read(&off_samp, sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &off_samp);
-
- Icc ->Read(&off_desc, sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &off_desc);
-
- Icc ->Read(&off_vc, sizeof(icUInt32Number), 1, Icc);
- AdjustEndianess32((LPBYTE) &off_vc);
-
-
- size = sizeof(cmsGAMUTEX) + (SamplesCount - 1) * sizeof(double);
-
- gex = (LPcmsGAMUTEX) malloc(size);
- if (gex == NULL) return NULL;
-
-
- gex ->CoordSig = CoordSig;
- gex ->Method = Method;
- gex ->Usage = Usage;
- gex ->Count = SamplesCount;
-
-
- // Read data
- if (Icc -> Seek(Icc, Loc + off_samp))
- return NULL;
-
- for (i=0; i < SamplesCount; i++) {
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Data[i] = Convert15Fixed16(Num);
- }
-
-
- // Read mluc
- if (Icc -> Seek(Icc, Loc + off_desc)) {
-
- free(gex);
- return NULL;
- }
-
- ReadEmbeddedTextTag(Icc, 256, gex ->Description);
-
-
- // Read viewing conditions
- if (Icc -> Seek(Icc, Loc + off_vc)) {
- free(gex);
- return NULL;
- }
-
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.whitePoint.X = Convert15Fixed16(Num);
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.whitePoint.Y = Convert15Fixed16(Num);
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.whitePoint.Z = Convert15Fixed16(Num);
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.La = Convert15Fixed16(Num);
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.Yb = Convert15Fixed16(Num);
-
- Icc -> Read(&Num, sizeof(icS15Fixed16Number), 1, Icc);
- gex ->Vc.D_value = Convert15Fixed16(Num);
-
- Icc -> Read(&Surround, sizeof(icUInt16Number), 1, Icc);
- AdjustEndianess16((LPBYTE) &Surround);
- gex ->Vc.surround = Surround;
-
-
- // All OK
- return gex;
-
+ if (pseq)
+ _cmsFree(pseq);
}
-void LCMSEXPORT cmsFreeExtendedGamut(LPcmsGAMUTEX gex)
-{
- if (gex)
- free(gex);
-}
// Read a few tags that are hardly required
@@ -2501,6 +2567,7 @@ cmsHPROFILE LCMSEXPORT cmsOpenProfileFromFile(const char *lpFileName, const char
NewIcc = (LPLCMSICCPROFILE) (LPSTR) hEmpty;
NewIcc -> IsWrite = TRUE;
strncpy(NewIcc ->PhysicalFile, lpFileName, MAX_PATH-1);
+ NewIcc ->PhysicalFile[MAX_PATH-1] = 0;
// Save LUT as 8 bit
@@ -2516,7 +2583,7 @@ cmsHPROFILE LCMSEXPORT cmsOpenProfileFromFile(const char *lpFileName, const char
NewIcc = _cmsCreateProfileFromFilePlaceholder(lpFileName);
if (!NewIcc) return NULL;
- if (!ReadHeader(NewIcc, FALSE)) return NULL;
+ if (!ReadHeader(NewIcc, FALSE, 0)) return NULL;
ReadCriticalTags(NewIcc);
@@ -2536,7 +2603,7 @@ cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize)
NewIcc = _cmsCreateProfileFromMemPlaceholder(MemPtr, dwSize);
if (!NewIcc) return NULL;
- if (!ReadHeader(NewIcc, TRUE)) return NULL;
+ if (!ReadHeader(NewIcc, TRUE, dwSize)) return NULL;
ReadCriticalTags(NewIcc);
@@ -2546,36 +2613,30 @@ cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize)
-BOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
- BOOL rc = TRUE;
+ LCMSBOOL rc = TRUE;
+ icInt32Number i;
if (!Icc) return FALSE;
-
// Was open in write mode?
if (Icc ->IsWrite) {
Icc ->IsWrite = FALSE; // Assure no further writting
rc = _cmsSaveProfile(hProfile, Icc ->PhysicalFile);
}
-
- if (Icc -> stream == NULL) { // Was a memory (i.e. not serialized) profile?
-
-
- icInt32Number i; // Yes, free tags
-
- for (i=0; i < Icc -> TagCount; i++) {
+ for (i=0; i < Icc -> TagCount; i++) {
if (Icc -> TagPtrs[i])
- free(Icc -> TagPtrs[i]);
- }
-
+ free(Icc -> TagPtrs[i]);
}
- else Icc -> Close(Icc); // No, close the stream
-
+
+ if (Icc -> stream != NULL) { // Was a memory (i.e. not serialized) profile?
+ Icc -> Close(Icc); // No, close the stream
+ }
free(Icc); // Free placeholder memory
@@ -2589,11 +2650,11 @@ BOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile)
static
-BOOL SaveWordsTable(int nEntries, LPWORD Tab, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveWordsTable(int nEntries, LPWORD Tab, LPLCMSICCPROFILE Icc)
{
size_t nTabSize = sizeof(WORD) * nEntries;
- LPWORD PtrW = (LPWORD) malloc(nTabSize);
- BOOL rc;
+ LPWORD PtrW = (LPWORD) _cmsMalloc(nTabSize);
+ LCMSBOOL rc;
if (!PtrW) return FALSE;
CopyMemory(PtrW, Tab, nTabSize);
@@ -2609,7 +2670,7 @@ BOOL SaveWordsTable(int nEntries, LPWORD Tab, LPLCMSICCPROFILE Icc)
// Saves profile header
static
-BOOL SaveHeader(LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveHeader(LPLCMSICCPROFILE Icc)
{
icHeader Header;
time_t now = time(NULL);
@@ -2664,7 +2725,7 @@ BOOL SaveHeader(LPLCMSICCPROFILE Icc)
// Setup base marker
static
-BOOL SetupBase(icTagTypeSignature sig, LPLCMSICCPROFILE Icc)
+LCMSBOOL SetupBase(icTagTypeSignature sig, LPLCMSICCPROFILE Icc)
{
icTagBase Base;
@@ -2674,10 +2735,10 @@ BOOL SetupBase(icTagTypeSignature sig, LPLCMSICCPROFILE Icc)
}
-// Store an XYZ tag
+// Store a XYZ tag
static
-BOOL SaveXYZNumber(LPcmsCIEXYZ Value, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveXYZNumber(LPcmsCIEXYZ Value, LPLCMSICCPROFILE Icc)
{
icXYZNumber XYZ;
@@ -2693,72 +2754,97 @@ BOOL SaveXYZNumber(LPcmsCIEXYZ Value, LPLCMSICCPROFILE Icc)
}
+// Store a XYZ array.
+
+static
+LCMSBOOL SaveXYZArray(int n, LPcmsCIEXYZ Value, LPLCMSICCPROFILE Icc)
+{
+ int i;
+ icXYZNumber XYZ;
+
+ if (!SetupBase(icSigS15Fixed16ArrayType, Icc)) return FALSE;
+
+ for (i=0; i < n; i++) {
+
+ XYZ.X = TransportValue32(DOUBLE_TO_FIXED(Value -> X));
+ XYZ.Y = TransportValue32(DOUBLE_TO_FIXED(Value -> Y));
+ XYZ.Z = TransportValue32(DOUBLE_TO_FIXED(Value -> Z));
+
+ if (!Icc -> Write(Icc, sizeof(icXYZNumber), &XYZ)) return FALSE;
+
+ Value++;
+ }
+
+ return TRUE;
+}
+
+
// Save a gamma structure as a table
static
-BOOL SaveGammaTable(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveGammaTable(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
{
- icInt32Number Count;
+ icInt32Number Count;
- if (!SetupBase(icSigCurveType, Icc)) return FALSE;
-
- Count = TransportValue32(Gamma->nEntries);
+ if (!SetupBase(icSigCurveType, Icc)) return FALSE;
+
+ Count = TransportValue32(Gamma->nEntries);
- if (!Icc ->Write(Icc, sizeof(icInt32Number), &Count)) return FALSE;
+ if (!Icc ->Write(Icc, sizeof(icInt32Number), &Count)) return FALSE;
- return SaveWordsTable(Gamma->nEntries, Gamma ->GammaTable, Icc);
+ return SaveWordsTable(Gamma->nEntries, Gamma ->GammaTable, Icc);
}
// Save a gamma structure as a one-value
static
-BOOL SaveGammaOneValue(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
-{
- icInt32Number Count;
- Fixed32 GammaFixed32;
- WORD GammaFixed8;
-
- if (!SetupBase(icSigCurveType, Icc)) return FALSE;
-
- Count = TransportValue32(1);
- if (!Icc ->Write(Icc, sizeof(icInt32Number), &Count)) return FALSE;
-
- GammaFixed32 = DOUBLE_TO_FIXED(Gamma ->Birth.Params[0]);
- GammaFixed8 = (WORD) ((GammaFixed32 >> 8) & 0xFFFF);
- GammaFixed8 = TransportValue16(GammaFixed8);
-
- return Icc ->Write(Icc, sizeof(icInt16Number), &GammaFixed8);
+LCMSBOOL SaveGammaOneValue(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
+{
+ icInt32Number Count;
+ Fixed32 GammaFixed32;
+ WORD GammaFixed8;
+
+ if (!SetupBase(icSigCurveType, Icc)) return FALSE;
+
+ Count = TransportValue32(1);
+ if (!Icc ->Write(Icc, sizeof(icInt32Number), &Count)) return FALSE;
+
+ GammaFixed32 = DOUBLE_TO_FIXED(Gamma ->Seed.Params[0]);
+ GammaFixed8 = (WORD) ((GammaFixed32 >> 8) & 0xFFFF);
+ GammaFixed8 = TransportValue16(GammaFixed8);
+
+ return Icc ->Write(Icc, sizeof(icInt16Number), &GammaFixed8);
}
// Save a gamma structure as a parametric gamma
static
-BOOL SaveGammaParametric(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
-{
- icUInt16Number Type, Reserved;
- int i, nParams;
- int ParamsByType[] = { 1, 3, 4, 5, 7 };
+LCMSBOOL SaveGammaParametric(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
+{
+ icUInt16Number Type, Reserved;
+ int i, nParams;
+ int ParamsByType[] = { 1, 3, 4, 5, 7 };
- if (!SetupBase(icSigParametricCurveType, Icc)) return FALSE;
-
- nParams = ParamsByType[Gamma -> Birth.Type];
+ if (!SetupBase(icSigParametricCurveType, Icc)) return FALSE;
+
+ nParams = ParamsByType[Gamma -> Seed.Type];
- Type = (icUInt16Number) TransportValue16((WORD) Gamma -> Birth. Type);
- Reserved = (icUInt16Number) TransportValue16((WORD) 0);
+ Type = (icUInt16Number) TransportValue16((WORD) Gamma -> Seed. Type);
+ Reserved = (icUInt16Number) TransportValue16((WORD) 0);
- Icc -> Write(Icc, sizeof(icInt16Number), &Type);
- Icc -> Write(Icc, sizeof(icUInt16Number), &Reserved);
+ Icc -> Write(Icc, sizeof(icInt16Number), &Type);
+ Icc -> Write(Icc, sizeof(icUInt16Number), &Reserved);
- for (i=0; i < nParams; i++) {
+ for (i=0; i < nParams; i++) {
- icInt32Number val = TransportValue32(DOUBLE_TO_FIXED(Gamma -> Birth.Params[i]));
- Icc ->Write(Icc, sizeof(icInt32Number), &val);
- }
+ icInt32Number val = TransportValue32(DOUBLE_TO_FIXED(Gamma -> Seed.Params[i]));
+ Icc ->Write(Icc, sizeof(icInt32Number), &val);
+ }
-
- return TRUE;
+
+ return TRUE;
}
@@ -2766,29 +2852,29 @@ BOOL SaveGammaParametric(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
// Save a gamma table
static
-BOOL SaveGamma(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveGamma(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
{
- // Is the gamma curve type supported by ICC format?
-
- if (Gamma -> Birth.Type < 0 || Gamma -> Birth.Type > 5 ||
-
- // has been modified by user?
+ // Is the gamma curve type supported by ICC format?
+
+ if (Gamma -> Seed.Type < 0 || Gamma -> Seed.Type > 5 ||
+
+ // has been modified by user?
- _cmsCrc32OfGammaTable(Gamma) != Gamma -> Birth.Crc32) {
+ _cmsCrc32OfGammaTable(Gamma) != Gamma -> Seed.Crc32) {
- return SaveGammaTable(Gamma, Icc);
- }
+ return SaveGammaTable(Gamma, Icc);
+ }
- if (Gamma -> Birth.Type == 1) return SaveGammaOneValue(Gamma, Icc);
+ if (Gamma -> Seed.Type == 1) return SaveGammaOneValue(Gamma, Icc);
- // Only v4 profiles are allowed to hold parametric curves
+ // Only v4 profiles are allowed to hold parametric curves
- if (cmsGetProfileICCversion((cmsHPROFILE) Icc) >= 0x4000000)
- return SaveGammaParametric(Gamma, Icc);
-
- // Defaults to save as table
+ if (cmsGetProfileICCversion((cmsHPROFILE) Icc) >= 0x4000000)
+ return SaveGammaParametric(Gamma, Icc);
+
+ // Defaults to save as table
- return SaveGammaTable(Gamma, Icc);
+ return SaveGammaTable(Gamma, Icc);
}
@@ -2798,7 +2884,7 @@ BOOL SaveGamma(LPGAMMATABLE Gamma, LPLCMSICCPROFILE Icc)
// Save an DESC Tag
static
-BOOL SaveDescription(const char *Text, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveDescription(const char *Text, LPLCMSICCPROFILE Icc)
{
icUInt32Number len, Count, TotalSize, AlignedSize;
@@ -2830,6 +2916,11 @@ BOOL SaveDescription(const char *Text, LPLCMSICCPROFILE Icc)
if (!Icc ->Write(Icc, len, (LPVOID)Text)) return FALSE;
AlignedSize -= len;
+ if (AlignedSize < 0)
+ AlignedSize = 0;
+ if (AlignedSize > 255)
+ AlignedSize = 255;
+
ZeroMemory(Filler, AlignedSize);
if (!Icc ->Write(Icc, AlignedSize, Filler)) return FALSE;
@@ -2839,7 +2930,7 @@ BOOL SaveDescription(const char *Text, LPLCMSICCPROFILE Icc)
// Save an ASCII Tag
static
-BOOL SaveText(const char *Text, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveText(const char *Text, LPLCMSICCPROFILE Icc)
{
size_t len = strlen(Text) + 1;
@@ -2852,7 +2943,7 @@ BOOL SaveText(const char *Text, LPLCMSICCPROFILE Icc)
// Save one of these new chromaticity values
static
-BOOL SaveOneChromaticity(double x, double y, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveOneChromaticity(double x, double y, LPLCMSICCPROFILE Icc)
{
Fixed32 xf, yf;
@@ -2869,7 +2960,7 @@ BOOL SaveOneChromaticity(double x, double y, LPLCMSICCPROFILE Icc)
// New tag added in Addendum II of old spec.
static
-BOOL SaveChromaticities(LPcmsCIExyYTRIPLE chrm, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveChromaticities(LPcmsCIExyYTRIPLE chrm, LPLCMSICCPROFILE Icc)
{
WORD nChans, Table;
@@ -2889,7 +2980,7 @@ BOOL SaveChromaticities(LPcmsCIExyYTRIPLE chrm, LPLCMSICCPROFILE Icc)
static
-BOOL SaveSequenceDescriptionTag(LPcmsSEQ seq, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveSequenceDescriptionTag(LPcmsSEQ seq, LPLCMSICCPROFILE Icc)
{
icUInt32Number nSeqs;
icDescStruct DescStruct;
@@ -2926,7 +3017,7 @@ BOOL SaveSequenceDescriptionTag(LPcmsSEQ seq, LPLCMSICCPROFILE Icc)
// Saves a timestamp tag
static
-BOOL SaveDateTimeNumber(const struct tm *DateTime, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveDateTimeNumber(const struct tm *DateTime, LPLCMSICCPROFILE Icc)
{
icDateTimeNumber Dest;
@@ -2940,14 +3031,14 @@ BOOL SaveDateTimeNumber(const struct tm *DateTime, LPLCMSICCPROFILE Icc)
// Saves a named color list into a named color profile
static
-BOOL SaveNamedColorList(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveNamedColorList(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
{
icUInt32Number vendorFlag; // Bottom 16 bits for IC use
icUInt32Number count; // Count of named colors
icUInt32Number nDeviceCoords; // Num of device coordinates
- icInt8Number prefix[32]; // Prefix for each color name
- icInt8Number suffix[32]; // Suffix for each color name
+ char prefix[32]; // Prefix for each color name
+ char suffix[32]; // Suffix for each color name
int i;
if (!SetupBase(icSigNamedColor2Type, Icc)) return FALSE;
@@ -2956,9 +3047,11 @@ BOOL SaveNamedColorList(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc
count = TransportValue32(NamedColorList ->nColors);
nDeviceCoords = TransportValue32(NamedColorList ->ColorantCount);
- strncpy((char *) prefix, (const char*) NamedColorList->Prefix, 32);
- strncpy((char *) suffix, (const char*) NamedColorList->Suffix, 32);
+ strncpy(prefix, (const char*) NamedColorList->Prefix, 32);
+ strncpy(suffix, (const char*) NamedColorList->Suffix, 32);
+ suffix[31] = prefix[31] = 0;
+
if (!Icc ->Write(Icc, sizeof(icUInt32Number), &vendorFlag)) return FALSE;
if (!Icc ->Write(Icc, sizeof(icUInt32Number), &count)) return FALSE;
if (!Icc ->Write(Icc, sizeof(icUInt32Number), &nDeviceCoords)) return FALSE;
@@ -2967,15 +3060,17 @@ BOOL SaveNamedColorList(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc
for (i=0; i < NamedColorList ->nColors; i++) {
- icUInt16Number PCS[3];
- icUInt16Number Colorant[MAXCHANNELS];
- icInt8Number root[32];
+ icUInt16Number PCS[3];
+ icUInt16Number Colorant[MAXCHANNELS];
+ char root[32];
LPcmsNAMEDCOLOR Color;
int j;
Color = NamedColorList ->List + i;
- strncpy((char*) root, Color ->Name, 32);
+ strncpy(root, Color ->Name, 32);
+ Color ->Name[32] = 0;
+
if (!Icc ->Write(Icc, 32 , root)) return FALSE;
for (j=0; j < 3; j++)
@@ -2999,7 +3094,7 @@ BOOL SaveNamedColorList(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc
// Saves a colorant table. It is using the named color structure for simplicity sake
static
-BOOL SaveColorantTable(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveColorantTable(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
{
icUInt32Number count; // Count of named colors
int i;
@@ -3013,13 +3108,15 @@ BOOL SaveColorantTable(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
for (i=0; i < NamedColorList ->nColors; i++) {
icUInt16Number PCS[3];
- icInt8Number root[32];
+ icInt8Number root[33];
LPcmsNAMEDCOLOR Color;
int j;
Color = NamedColorList ->List + i;
strncpy((char*) root, Color ->Name, 32);
+ root[32] = 0;
+
if (!Icc ->Write(Icc, 32 , root)) return FALSE;
for (j=0; j < 3; j++)
@@ -3036,7 +3133,7 @@ BOOL SaveColorantTable(LPcmsNAMEDCOLORLIST NamedColorList, LPLCMSICCPROFILE Icc)
// Does serialization of LUT16 and writes it.
static
-BOOL SaveLUT(const LUT* NewLUT, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveLUT(const LUT* NewLUT, LPLCMSICCPROFILE Icc)
{
icLut16 LUT16;
unsigned int i;
@@ -3126,7 +3223,7 @@ BOOL SaveLUT(const LUT* NewLUT, LPLCMSICCPROFILE Icc)
// Does serialization of LUT8 and writes it
static
-BOOL SaveLUT8(const LUT* NewLUT, LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveLUT8(const LUT* NewLUT, LPLCMSICCPROFILE Icc)
{
icLut8 LUT8;
unsigned int i, j;
@@ -3260,7 +3357,7 @@ void LCMSEXPORT _cmsSetLUTdepth(cmsHPROFILE hProfile, int depth)
// Saves Tag directory
static
-BOOL SaveTagDirectory(LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveTagDirectory(LPLCMSICCPROFILE Icc)
{
icInt32Number i;
icTag Tag;
@@ -3293,7 +3390,7 @@ BOOL SaveTagDirectory(LPLCMSICCPROFILE Icc)
// Dump tag contents
static
-BOOL SaveTags(LPLCMSICCPROFILE Icc)
+LCMSBOOL SaveTags(LPLCMSICCPROFILE Icc, LPLCMSICCPROFILE FileOrig)
{
LPBYTE Data;
@@ -3321,8 +3418,31 @@ BOOL SaveTags(LPLCMSICCPROFILE Icc)
Icc -> TagOffsets[i] = Begin = Icc ->UsedSpace;
Data = (LPBYTE) Icc -> TagPtrs[i];
- if (!Data)
+ if (!Data) {
+
+ // Reach here if we are copying a tag from a disk-based ICC profile which has not been modified by user.
+ // In this case a blind copy of the block data is performed
+
+ if (Icc -> TagOffsets[i]) {
+
+ size_t TagSize = FileOrig -> TagSizes[i];
+ size_t TagOffset = FileOrig -> TagOffsets[i];
+ void* Mem;
+
+ if (FileOrig ->Seek(FileOrig, TagOffset)) return FALSE;
+
+ Mem = _cmsMalloc(TagSize);
+
+ if (FileOrig ->Read(Mem, TagSize, 1, FileOrig) != 1) return FALSE;
+ if (!Icc ->Write(Icc, TagSize, Mem)) return FALSE;
+
+ Icc -> TagSizes[i] = (Icc ->UsedSpace - Begin);
+ free(Mem);
+ }
+
continue;
+ }
+
switch (Icc -> TagNames[i]) {
@@ -3401,6 +3521,10 @@ BOOL SaveTags(LPLCMSICCPROFILE Icc)
break;
+ case icSigChromaticAdaptationTag:
+ if (!SaveXYZArray(3, (LPcmsCIEXYZ) Data, Icc)) return FALSE;
+ break;
+
default:
return FALSE;
}
@@ -3417,9 +3541,9 @@ BOOL SaveTags(LPLCMSICCPROFILE Icc)
// Add tags to profile structure
-BOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, LPVOID Tag)
+LCMSBOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, const void* Tag)
{
- BOOL rc;
+ LCMSBOOL rc;
switch (sig) {
@@ -3480,6 +3604,11 @@ BOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, LPVOID Tag)
rc = _cmsAddColorantTableTag(hProfile, sig, (LPcmsNAMEDCOLORLIST) Tag);
break;
+
+ case icSigChromaticAdaptationTag:
+ rc = _cmsAddChromaticAdaptationTag(hProfile, sig, (const cmsCIEXYZ*) Tag);
+ break;
+
default:
cmsSignalError(LCMS_ERRC_ABORTED, "cmsAddTag: Tag '%x' is unsupported", sig);
return FALSE;
@@ -3505,11 +3634,11 @@ BOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, LPVOID Tag)
// Low-level save to disk. It closes the profile on exit
-BOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName)
+LCMSBOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
LCMSICCPROFILE Keep;
- BOOL rc;
+ LCMSBOOL rc;
CopyMemory(&Keep, Icc, sizeof(LCMSICCPROFILE));
_cmsSetSaveToDisk(Icc, NULL);
@@ -3518,7 +3647,7 @@ BOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName)
if (!SaveHeader(Icc)) return FALSE;
if (!SaveTagDirectory(Icc)) return FALSE;
- if (!SaveTags(Icc)) return FALSE;
+ if (!SaveTags(Icc, &Keep)) return FALSE;
_cmsSetSaveToDisk(Icc, FileName);
@@ -3528,7 +3657,7 @@ BOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName)
if (!SaveHeader(Icc)) goto CleanUp;
if (!SaveTagDirectory(Icc)) goto CleanUp;
- if (!SaveTags(Icc)) goto CleanUp;
+ if (!SaveTags(Icc, &Keep)) goto CleanUp;
rc = (Icc ->Close(Icc) == 0);
CopyMemory(Icc, &Keep, sizeof(LCMSICCPROFILE));
@@ -3545,7 +3674,7 @@ BOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName)
// Low-level save from open stream
-BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
+LCMSBOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
size_t* BytesNeeded)
{
LPLCMSICCPROFILE Icc = (LPLCMSICCPROFILE) (LPSTR) hProfile;
@@ -3560,18 +3689,20 @@ BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
if (!SaveHeader(Icc)) return FALSE;
if (!SaveTagDirectory(Icc)) return FALSE;
- if (!SaveTags(Icc)) return FALSE;
+ if (!SaveTags(Icc, &Keep)) return FALSE;
if (!MemPtr) {
// update BytesSaved so caller knows how many bytes are needed for MemPtr
*BytesNeeded = Icc ->UsedSpace;
+ CopyMemory(Icc, &Keep, sizeof(LCMSICCPROFILE));
return TRUE;
}
if (*BytesNeeded < Icc ->UsedSpace) {
// need at least UsedSpace in MemPtr to continue
+ CopyMemory(Icc, &Keep, sizeof(LCMSICCPROFILE));
return FALSE;
}
@@ -3581,7 +3712,7 @@ BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
// Pass #2 does save to file into supplied stream
if (!SaveHeader(Icc)) goto CleanUp;
if (!SaveTagDirectory(Icc)) goto CleanUp;
- if (!SaveTags(Icc)) goto CleanUp;
+ if (!SaveTags(Icc, &Keep)) goto CleanUp;
// update BytesSaved so caller knows how many bytes put into stream
*BytesNeeded = Icc ->UsedSpace;
diff --git a/icc2ps/cmslut.c b/icc2ps/cmslut.c
index 62f5793..9ad8ed8 100644..100755
--- a/icc2ps/cmslut.c
+++ b/icc2ps/cmslut.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -89,7 +89,7 @@ LPLUT LCMSEXPORT cmsAllocLUT(void)
{
LPLUT NewLUT;
- NewLUT = (LPLUT) malloc(sizeof(LUT));
+ NewLUT = (LPLUT) _cmsMalloc(sizeof(LUT));
if (NewLUT)
ZeroMemory(NewLUT, sizeof(LUT));
@@ -142,9 +142,10 @@ void LCMSEXPORT cmsFreeLUT(LPLUT Lut)
static
LPVOID DupBlockTab(LPVOID Org, size_t size)
{
- LPVOID mem = malloc(size);
+ LPVOID mem = _cmsMalloc(size);
+ if (mem != NULL)
+ CopyMemory(mem, Org, size);
- CopyMemory(mem, Org, size);
return mem;
}
@@ -182,6 +183,37 @@ unsigned int UIpow(unsigned int a, unsigned int b)
}
+LCMSBOOL _cmsValidateLUT(LPLUT NewLUT)
+{
+ unsigned int calc = 1;
+ unsigned int oldCalc;
+ unsigned int power = NewLUT -> InputChan;
+
+ if (NewLUT -> cLutPoints > 100) return FALSE;
+ if (NewLUT -> InputChan > MAXCHANNELS) return FALSE;
+ if (NewLUT -> OutputChan > MAXCHANNELS) return FALSE;
+
+ if (NewLUT -> cLutPoints == 0) return TRUE;
+
+ for (; power > 0; power--) {
+
+ oldCalc = calc;
+ calc *= NewLUT -> cLutPoints;
+
+ if (calc < oldCalc || calc < NewLUT -> cLutPoints) {
+ return FALSE;
+ }
+ }
+
+ oldCalc = calc;
+ calc *= NewLUT -> OutputChan;
+ if (calc < oldCalc || calc < NewLUT -> OutputChan) {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
LPLUT LCMSEXPORT cmsAlloc3DGrid(LPLUT NewLUT, int clutPoints, int inputChan, int outputChan)
{
DWORD nTabSize;
@@ -191,12 +223,17 @@ LPLUT LCMSEXPORT cmsAlloc3DGrid(LPLUT NewLUT, int clutPoints, int inputChan, int
NewLUT -> InputChan = inputChan;
NewLUT -> OutputChan = outputChan;
+ if (!_cmsValidateLUT(NewLUT)) {
+ return NULL;
+ }
- nTabSize = (NewLUT -> OutputChan * UIpow(NewLUT->cLutPoints,
- NewLUT->InputChan)
- * sizeof(WORD));
+ nTabSize = NewLUT -> OutputChan * UIpow(NewLUT->cLutPoints,
+ NewLUT->InputChan);
+
+ NewLUT -> T = (LPWORD) _cmsCalloc(sizeof(WORD), nTabSize);
+ nTabSize *= sizeof(WORD);
+ if (NewLUT -> T == NULL) return NULL;
- NewLUT -> T = (LPWORD) malloc(nTabSize);
ZeroMemory(NewLUT -> T, nTabSize);
NewLUT ->Tsize = nTabSize;
@@ -225,12 +262,14 @@ LPLUT LCMSEXPORT cmsAllocLinearTable(LPLUT NewLUT, LPGAMMATABLE Tables[], int nT
for (i=0; i < NewLUT -> InputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> InputEntries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> InputEntries);
+ if (PtrW == NULL) return NULL;
+
NewLUT -> L1[i] = PtrW;
CopyMemory(PtrW, Tables[i]->GammaTable, sizeof(WORD) * NewLUT -> InputEntries);
- CopyMemory(&NewLUT -> LCurvesBirth[0][i], &Tables[i] -> Birth, sizeof(LCMSGAMMAPARAMS));
+ CopyMemory(&NewLUT -> LCurvesSeed[0][i], &Tables[i] -> Seed, sizeof(LCMSGAMMAPARAMS));
}
-
+
break;
@@ -239,10 +278,12 @@ LPLUT LCMSEXPORT cmsAllocLinearTable(LPLUT NewLUT, LPGAMMATABLE Tables[], int nT
NewLUT -> OutputEntries = Tables[0] -> nEntries;
for (i=0; i < NewLUT -> OutputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> OutputEntries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> OutputEntries);
+ if (PtrW == NULL) return NULL;
+
NewLUT -> L2[i] = PtrW;
CopyMemory(PtrW, Tables[i]->GammaTable, sizeof(WORD) * NewLUT -> OutputEntries);
- CopyMemory(&NewLUT -> LCurvesBirth[1][i], &Tables[i] -> Birth, sizeof(LCMSGAMMAPARAMS));
+ CopyMemory(&NewLUT -> LCurvesSeed[1][i], &Tables[i] -> Seed, sizeof(LCMSGAMMAPARAMS));
}
break;
@@ -256,10 +297,12 @@ LPLUT LCMSEXPORT cmsAllocLinearTable(LPLUT NewLUT, LPGAMMATABLE Tables[], int nT
for (i=0; i < NewLUT -> InputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> L3Entries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> L3Entries);
+ if (PtrW == NULL) return NULL;
+
NewLUT -> L3[i] = PtrW;
CopyMemory(PtrW, Tables[i]->GammaTable, sizeof(WORD) * NewLUT -> L3Entries);
- CopyMemory(&NewLUT -> LCurvesBirth[2][i], &Tables[i] -> Birth, sizeof(LCMSGAMMAPARAMS));
+ CopyMemory(&NewLUT -> LCurvesSeed[2][i], &Tables[i] -> Seed, sizeof(LCMSGAMMAPARAMS));
}
break;
@@ -269,10 +312,12 @@ LPLUT LCMSEXPORT cmsAllocLinearTable(LPLUT NewLUT, LPGAMMATABLE Tables[], int nT
NewLUT -> L4Entries = Tables[0] -> nEntries;
for (i=0; i < NewLUT -> OutputChan; i++) {
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewLUT -> L4Entries);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewLUT -> L4Entries);
+ if (PtrW == NULL) return NULL;
+
NewLUT -> L4[i] = PtrW;
CopyMemory(PtrW, Tables[i]->GammaTable, sizeof(WORD) * NewLUT -> L4Entries);
- CopyMemory(&NewLUT -> LCurvesBirth[3][i], &Tables[i] -> Birth, sizeof(LCMSGAMMAPARAMS));
+ CopyMemory(&NewLUT -> LCurvesSeed[3][i], &Tables[i] -> Seed, sizeof(LCMSGAMMAPARAMS));
}
break;
@@ -551,7 +596,7 @@ LPLUT _cmsBlessLUT8(LPLUT Lut)
LPL16PARAMS p = &Lut ->CLut16params;
- p8 = (LPL8PARAMS) malloc(sizeof(L8PARAMS));
+ p8 = (LPL8PARAMS) _cmsMalloc(sizeof(L8PARAMS));
if (p8 == NULL) return NULL;
// values comes * 257, so we can safely take first byte (x << 8 + x)
@@ -564,8 +609,8 @@ LPLUT _cmsBlessLUT8(LPLUT Lut)
if (Lut ->wFlags & LUT_HASTL1) {
for (j=0; j < 3; j++)
- StageABC[i] = cmsLinearInterpLUT16(StageABC[i],
- Lut -> L1[i],
+ StageABC[j] = cmsLinearInterpLUT16(StageABC[j],
+ Lut -> L1[j],
&Lut -> In16params);
Lut ->wFlags &= ~LUT_HASTL1;
}
@@ -623,25 +668,6 @@ LPLUT _cmsBlessLUT8(LPLUT Lut)
#define INVERSION_MAX_ITERATIONS 30
-// Evaluates the CLUT part of a LUT (3x3 only)
-
-static
-void EvalLUTdoubleK(LPLUT Lut, const VEC3* In, WORD FixedK, LPVEC3 Out)
-{
- WORD wIn[4], wOut[3];
-
- wIn[0] = (WORD) floor(In ->n[0] * 65535.0 + 0.5);
- wIn[1] = (WORD) floor(In ->n[1] * 65535.0 + 0.5);
- wIn[2] = (WORD) floor(In ->n[2] * 65535.0 + 0.5);
- wIn[3] = FixedK;
-
- cmsEvalLUT(Lut, wIn, wOut);
-
- Out ->n[0] = (double) wOut[0] / 65535.0;
- Out ->n[1] = (double) wOut[1] / 65535.0;
- Out ->n[2] = (double) wOut[2] / 65535.0;
-}
-
// Increment with reflexion on boundary
@@ -658,17 +684,48 @@ void IncDelta(double *Val)
}
+
+static
+void ToEncoded(WORD Encoded[3], LPVEC3 Float)
+{
+ Encoded[0] = (WORD) floor(Float->n[0] * 65535.0 + 0.5);
+ Encoded[1] = (WORD) floor(Float->n[1] * 65535.0 + 0.5);
+ Encoded[2] = (WORD) floor(Float->n[2] * 65535.0 + 0.5);
+}
+
+static
+void FromEncoded(LPVEC3 Float, WORD Encoded[3])
+{
+ Float->n[0] = Encoded[0] / 65535.0;
+ Float->n[1] = Encoded[1] / 65535.0;
+ Float->n[2] = Encoded[2] / 65535.0;
+}
+
+// Evaluates the CLUT part of a LUT (4 -> 3 only)
+static
+void EvalLUTdoubleKLab(LPLUT Lut, const VEC3* In, WORD FixedK, LPcmsCIELab Out)
+{
+ WORD wIn[4], wOut[3];
+
+ wIn[0] = (WORD) floor(In ->n[0] * 65535.0 + 0.5);
+ wIn[1] = (WORD) floor(In ->n[1] * 65535.0 + 0.5);
+ wIn[2] = (WORD) floor(In ->n[2] * 65535.0 + 0.5);
+ wIn[3] = FixedK;
+
+ cmsEvalLUT(Lut, wIn, wOut);
+ cmsLabEncoded2Float(Out, wOut);
+}
+
// Builds a Jacobian CMY->Lab
static
-void ComputeJacobian(LPLUT Lut, LPMAT3 Jacobian, const VEC3* Colorant, WORD K)
+void ComputeJacobianLab(LPLUT Lut, LPMAT3 Jacobian, const VEC3* Colorant, WORD K)
{
VEC3 ColorantD;
- double DeltaColorant;
- VEC3 Lab, LabD;
- int i, j;
+ cmsCIELab Lab, LabD;
+ int j;
- EvalLUTdoubleK(Lut, Colorant, K, &Lab);
+ EvalLUTdoubleKLab(Lut, Colorant, K, &Lab);
for (j = 0; j < 3; j++) {
@@ -679,55 +736,36 @@ void ComputeJacobian(LPLUT Lut, LPMAT3 Jacobian, const VEC3* Colorant, WORD K)
IncDelta(&ColorantD.n[j]);
- EvalLUTdoubleK(Lut, &ColorantD, K, &LabD);
-
- DeltaColorant = (Colorant->n[j] - ColorantD.n[j]);
-
- for (i = 0; i < 3; i++) {
-
- double DeltaTristim = (Lab.n[i] - LabD.n[i]);
-
- Jacobian->v[i].n[j] = (DeltaTristim / DeltaColorant);
- }
+ EvalLUTdoubleKLab(Lut, &ColorantD, K, &LabD);
+
+ Jacobian->v[0].n[j] = ((LabD.L - Lab.L) / JACOBIAN_EPSILON);
+ Jacobian->v[1].n[j] = ((LabD.a - Lab.a) / JACOBIAN_EPSILON);
+ Jacobian->v[2].n[j] = ((LabD.b - Lab.b) / JACOBIAN_EPSILON);
+
}
}
-static
-void ToEncoded(WORD Encoded[3], LPVEC3 Float)
-{
- Encoded[0] = (WORD) floor(Float->n[0] * 65535.0 + 0.5);
- Encoded[1] = (WORD) floor(Float->n[1] * 65535.0 + 0.5);
- Encoded[2] = (WORD) floor(Float->n[2] * 65535.0 + 0.5);
-}
-
-static
-void FromEncoded(LPVEC3 Float, WORD Encoded[3])
-{
- Float->n[0] = Encoded[0] / 65535.0;
- Float->n[1] = Encoded[1] / 65535.0;
- Float->n[2] = Encoded[2] / 65535.0;
-}
-
-
// Evaluate a LUT in reverse direction. It only searches on 3->3 LUT, but It
// can be used on CMYK -> Lab LUT to obtain black preservation.
// Target holds LabK in this case
+// x1 <- x - [J(x)]^-1 * f(x)
+
LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Result[], LPWORD Hint)
{
int i;
- double error, LastError;
- VEC3 Guess;
- VEC3 Goal, TestPoint, Colorant;
- MAT3 Jacobian, JacobianInverse;
- WORD FixedK;
- WORD LastResult[4];
+ double error, LastError = 1E20;
+ cmsCIELab fx, Goal;
+ VEC3 tmp, tmp2, x;
+ MAT3 Jacobian;
+ WORD FixedK;
+ WORD LastResult[4];
// This is our Lab goal
- FromEncoded(&Goal, Target);
+ cmsLabEncoded2Float(&Goal, Target);
// Special case for CMYK->Lab
@@ -743,27 +781,24 @@ LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Resul
// Begin at any point, we choose 1/3 of neutral CMY gray
- Colorant.n[0] =
- Colorant.n[1] =
- Colorant.n[2] = 0.3;
+ x.n[0] = x.n[1] = x.n[2] = 0.3;
}
else {
- FromEncoded(&Colorant, Hint);
+
+ FromEncoded(&x, Hint);
}
-
- LastError = 1E20;
// Iterate
for (i = 0; i < INVERSION_MAX_ITERATIONS; i++) {
- // Get beginning guess
- EvalLUTdoubleK(Lut, &Colorant, FixedK, &Guess);
+ // Get beginning fx
+ EvalLUTdoubleKLab(Lut, &x, FixedK, &fx);
// Compute error
- error = VEC3distance(&Guess, &Goal);
+ error = cmsDeltaE(&fx, &Goal);
// If not convergent, return last safe value
if (error >= LastError)
@@ -772,36 +807,27 @@ LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Resul
// Keep latest values
LastError = error;
- ToEncoded(LastResult, &Colorant);
+ ToEncoded(LastResult, &x);
LastResult[3] = FixedK;
-
// Obtain slope
- ComputeJacobian(Lut, &Jacobian, &Colorant, FixedK);
-
- // Evaluate jacobian
- MAT3eval(&TestPoint, &Jacobian, &Colorant);
-
- // Move testpoint
- TestPoint.n[0] += (Goal.n[0] - Guess.n[0]);
- TestPoint.n[1] += (Goal.n[1] - Guess.n[1]);
- TestPoint.n[2] += (Goal.n[2] - Guess.n[2]);
-
- VEC3saturate(&TestPoint);
-
- // Jacobian ^ -1
- if (MAT3inverse(&Jacobian, &JacobianInverse) < 0) {
-
- // Singular matrix,
- break;
- }
-
-
- // Obtain colorant from current point
- MAT3eval(&Colorant, &JacobianInverse, &TestPoint);
-
+ ComputeJacobianLab(Lut, &Jacobian, &x, FixedK);
+
+ // Solve system
+ tmp2.n[0] = fx.L - Goal.L;
+ tmp2.n[1] = fx.a - Goal.a;
+ tmp2.n[2] = fx.b - Goal.b;
+
+ if (!MAT3solve(&tmp, &Jacobian, &tmp2))
+ break;
+
+ // Move our guess
+ x.n[0] -= tmp.n[0];
+ x.n[1] -= tmp.n[1];
+ x.n[2] -= tmp.n[2];
+
// Some clipping....
- VEC3saturate(&Colorant);
+ VEC3saturate(&x);
}
Result[0] = LastResult[0];
@@ -815,5 +841,3 @@ LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Resul
-
-
diff --git a/icc2ps/cmsmatsh.c b/icc2ps/cmsmatsh.c
index 1bd1c22..ca1e8bd 100644..100755
--- a/icc2ps/cmsmatsh.c
+++ b/icc2ps/cmsmatsh.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -33,6 +33,7 @@
// data yet in fixed point, so no additional process is required.
// Then, we obtain data on 15.16, so we need to shift >> by 1 to
// obtain 1.15 PCS format.
+
// On OUTPUT profiles, things are inverse, we must first expand 1 bit
// by shifting left, and then convert result between 0 and 1.000 to
// RGB, so FromFixedDomain() must be called before pass values to
@@ -42,6 +43,7 @@
// input is encoded from 0 to 0xffff, we must first use the shaper and
// then the matrix, an additional FromFixedDomain() must be used to
// accomodate output values.
+
// For a sake of simplicity, I will handle this three behaviours
// with different routines, so the flags MATSHAPER_INPUT and MATSHAPER_OUTPUT
// can be conbined to signal smelted matrix-shapers
@@ -60,7 +62,7 @@ int ComputeTables(LPGAMMATABLE Table[3], LPWORD Out[3], LPL16PARAMS p16)
{
LPWORD PtrW;
- PtrW = (LPWORD) malloc(sizeof(WORD) * p16 -> nSamples);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * p16 -> nSamples);
if (PtrW == NULL) return -1; // Signal error
@@ -90,7 +92,7 @@ LPMATSHAPER cmsAllocMatShaper2(LPMAT3 Matrix, LPGAMMATABLE In[], LPGAMMATABLE Ou
LPMATSHAPER NewMatShaper;
int rc;
- NewMatShaper = (LPMATSHAPER) malloc(sizeof(MATSHAPER));
+ NewMatShaper = (LPMATSHAPER) _cmsMalloc(sizeof(MATSHAPER));
if (NewMatShaper)
ZeroMemory(NewMatShaper, sizeof(MATSHAPER));
@@ -142,7 +144,7 @@ LPMATSHAPER cmsAllocMatShaper(LPMAT3 Matrix, LPGAMMATABLE Tables[], DWORD Behavi
LPMATSHAPER NewMatShaper;
int i, AllLinear;
- NewMatShaper = (LPMATSHAPER) malloc(sizeof(MATSHAPER));
+ NewMatShaper = (LPMATSHAPER) _cmsMalloc(sizeof(MATSHAPER));
if (NewMatShaper)
ZeroMemory(NewMatShaper, sizeof(MATSHAPER));
@@ -168,7 +170,7 @@ LPMATSHAPER cmsAllocMatShaper(LPMAT3 Matrix, LPGAMMATABLE Tables[], DWORD Behavi
{
LPWORD PtrW;
- PtrW = (LPWORD) malloc(sizeof(WORD) * NewMatShaper -> p16.nSamples);
+ PtrW = (LPWORD) _cmsMalloc(sizeof(WORD) * NewMatShaper -> p16.nSamples);
if (PtrW == NULL) {
cmsFreeMatShaper(NewMatShaper);
@@ -206,11 +208,11 @@ void cmsFreeMatShaper(LPMATSHAPER MatShaper)
for (i=0; i < 3; i++)
{
- if (MatShaper -> L[i]) free(MatShaper ->L[i]);
- if (MatShaper -> L2[i]) free(MatShaper ->L2[i]);
+ if (MatShaper -> L[i]) _cmsFree(MatShaper ->L[i]);
+ if (MatShaper -> L2[i]) _cmsFree(MatShaper ->L2[i]);
}
- free(MatShaper);
+ _cmsFree(MatShaper);
}
diff --git a/icc2ps/cmsmtrx.c b/icc2ps/cmsmtrx.c
index 5475b4d..6545165 100644..100755
--- a/icc2ps/cmsmtrx.c
+++ b/icc2ps/cmsmtrx.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -42,16 +42,16 @@ double cdecl VEC3length(LPVEC3 a);
double cdecl VEC3distance(LPVEC3 a, LPVEC3 b);
-void cdecl MAT3identity(LPMAT3 a);
-void cdecl MAT3per(LPMAT3 r, LPMAT3 a, LPMAT3 b);
-int cdecl MAT3inverse(LPMAT3 a, LPMAT3 b);
-BOOL cdecl MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b);
-double cdecl MAT3det(LPMAT3 m);
-void cdecl MAT3eval(LPVEC3 r, LPMAT3 a, LPVEC3 v);
-void cdecl MAT3toFix(LPWMAT3 r, LPMAT3 v);
-void cdecl MAT3evalW(LPWVEC3 r, LPWMAT3 a, LPWVEC3 v);
-void cdecl MAT3perK(LPMAT3 r, LPMAT3 v, double d);
-void cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
+void cdecl MAT3identity(LPMAT3 a);
+void cdecl MAT3per(LPMAT3 r, LPMAT3 a, LPMAT3 b);
+int cdecl MAT3inverse(LPMAT3 a, LPMAT3 b);
+LCMSBOOL cdecl MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b);
+double cdecl MAT3det(LPMAT3 m);
+void cdecl MAT3eval(LPVEC3 r, LPMAT3 a, LPVEC3 v);
+void cdecl MAT3toFix(LPWMAT3 r, LPMAT3 v);
+void cdecl MAT3evalW(LPWVEC3 r, LPWMAT3 a, LPWVEC3 v);
+void cdecl MAT3perK(LPMAT3 r, LPMAT3 v, double d);
+void cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
// --------------------- Implementation ----------------------------
@@ -64,6 +64,7 @@ void cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
#ifdef _MSC_VER
#pragma warning(disable : 4033)
+#pragma warning(disable : 4035)
#endif
@@ -152,6 +153,7 @@ WORD FixedScale(WORD a, Fixed32 s)
#ifdef _MSC_VER
#pragma warning(default : 4033)
+#pragma warning(default : 4035)
#endif
#else
@@ -314,13 +316,13 @@ void VEC3minus(LPVEC3 r, LPVEC3 a, LPVEC3 b)
// Check id two vectors are the same, allowing tolerance
static
-BOOL RangeCheck(double l, double h, double v)
+LCMSBOOL RangeCheck(double l, double h, double v)
{
return (v >= l && v <= h);
}
-BOOL VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance)
+LCMSBOOL VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance)
{
int i;
double c;
@@ -336,7 +338,7 @@ BOOL VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance)
return TRUE;
}
-BOOL VEC3equalF(LPVEC3 a, LPVEC3 b, double Tolerance)
+LCMSBOOL VEC3equalF(LPVEC3 a, LPVEC3 b, double Tolerance)
{
int i;
double c;
@@ -431,7 +433,7 @@ void MAT3identity(LPMAT3 a)
// Check if matrix is Identity. Allow a tolerance as %
-BOOL MAT3isIdentity(LPWMAT3 a, double Tolerance)
+LCMSBOOL MAT3isIdentity(LPWMAT3 a, double Tolerance)
{
int i;
MAT3 Idd;
@@ -514,16 +516,16 @@ int MAT3inverse(LPMAT3 a, LPMAT3 b)
// Solve a system in the form Ax = b
-BOOL MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b)
+LCMSBOOL MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b)
{
- MAT3 m, a_1;
+ MAT3 m, a_1;
- CopyMemory(&m, a, sizeof(MAT3));
+ CopyMemory(&m, a, sizeof(MAT3));
- if (!MAT3inverse(&m, &a_1)) return FALSE; // Singular matrix
+ if (!MAT3inverse(&m, &a_1)) return FALSE; // Singular matrix
- MAT3eval(x, &a_1, b);
- return TRUE;
+ MAT3eval(x, &a_1, b);
+ return TRUE;
}
diff --git a/icc2ps/cmsnamed.c b/icc2ps/cmsnamed.c
index ff24177..e500a0f 100644..100755
--- a/icc2ps/cmsnamed.c
+++ b/icc2ps/cmsnamed.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -45,7 +45,7 @@ LPcmsNAMEDCOLORLIST GrowNamedColorList(LPcmsNAMEDCOLORLIST v, int ByElements)
NewElements *= 2;
size = sizeof(cmsNAMEDCOLORLIST) + (sizeof(cmsNAMEDCOLOR) * NewElements);
- TheNewList = (LPcmsNAMEDCOLORLIST) malloc(size);
+ TheNewList = (LPcmsNAMEDCOLORLIST) _cmsMalloc(size);
if (TheNewList == NULL) {
@@ -57,7 +57,7 @@ LPcmsNAMEDCOLORLIST GrowNamedColorList(LPcmsNAMEDCOLORLIST v, int ByElements)
CopyMemory(TheNewList, v, sizeof(cmsNAMEDCOLORLIST) + (v ->nColors - 1) * sizeof(cmsNAMEDCOLOR));
TheNewList -> Allocated = NewElements;
- free(v);
+ _cmsFree(v);
return TheNewList;
}
}
@@ -70,7 +70,7 @@ LPcmsNAMEDCOLORLIST cmsAllocNamedColorList(int n)
{
size_t size = sizeof(cmsNAMEDCOLORLIST) + (n - 1) * sizeof(cmsNAMEDCOLOR);
- LPcmsNAMEDCOLORLIST v = (LPcmsNAMEDCOLORLIST) malloc(size);
+ LPcmsNAMEDCOLORLIST v = (LPcmsNAMEDCOLORLIST) _cmsMalloc(size);
if (v == NULL) {
@@ -95,10 +95,10 @@ void cmsFreeNamedColorList(LPcmsNAMEDCOLORLIST v)
return;
}
- free(v);
+ _cmsFree(v);
}
-BOOL cmsAppendNamedColor(cmsHTRANSFORM xform, const char* Name, WORD PCS[3], WORD Colorant[MAXCHANNELS])
+LCMSBOOL cmsAppendNamedColor(cmsHTRANSFORM xform, const char* Name, WORD PCS[3], WORD Colorant[MAXCHANNELS])
{
_LPcmsTRANSFORM v = (_LPcmsTRANSFORM) xform;
LPcmsNAMEDCOLORLIST List;
@@ -135,7 +135,7 @@ int LCMSEXPORT cmsNamedColorCount(cmsHTRANSFORM xform)
}
-BOOL LCMSEXPORT cmsNamedColorInfo(cmsHTRANSFORM xform, int nColor, char* Name, char* Prefix, char* Suffix)
+LCMSBOOL LCMSEXPORT cmsNamedColorInfo(cmsHTRANSFORM xform, int nColor, char* Name, char* Prefix, char* Suffix)
{
_LPcmsTRANSFORM v = (_LPcmsTRANSFORM) xform;
diff --git a/icc2ps/cmspack.c b/icc2ps/cmspack.c
index 68ce9af..ed50946 100644..100755
--- a/icc2ps/cmspack.c
+++ b/icc2ps/cmspack.c
@@ -1,5 +1,5 @@
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -610,9 +610,81 @@ LPBYTE UnrollDouble(register _LPcmsTRANSFORM info, register WORD wIn[], register
+static
+LPBYTE UnrollDouble1Chan(register _LPcmsTRANSFORM info, register WORD wIn[], register LPBYTE accum)
+{
+ double* Inks = (double*) accum;
+ double v;
+
+
+ v = floor(Inks[0] * 65535.0 + 0.5);
+
+ if (v > 65535.0) v = 65535.0;
+ if (v < 0) v = 0;
+
+
+ wIn[0] = wIn[1] = wIn[2] = (WORD) v;
+
+ return accum + sizeof(double);
+}
+
+
// ----------------------------------------------------------- Packing routines
+// Generic N-bytes plus dither 16-to-8 conversion. Currently is just a quick hack
+
+static int err[MAXCHANNELS];
+
+static
+LPBYTE PackNBytesDither(register _LPcmsTRANSFORM info, register WORD wOut[], register LPBYTE output)
+{
+ int nChan = T_CHANNELS(info -> OutputFormat);
+ register int i;
+ unsigned int n, pe, pf;
+
+ for (i=0; i < nChan; i++) {
+
+ n = wOut[i] + err[i]; // Value
+
+ pe = (n / 257); // Whole part
+ pf = (n % 257); // Fractional part
+
+ err[i] = pf; // Store it for next pixel
+
+ *output++ = (BYTE) pe;
+ }
+
+ return output + T_EXTRA(info ->OutputFormat);
+}
+
+
+
+static
+LPBYTE PackNBytesSwapDither(register _LPcmsTRANSFORM info, register WORD wOut[], register LPBYTE output)
+{
+ int nChan = T_CHANNELS(info -> OutputFormat);
+ register int i;
+ unsigned int n, pe, pf;
+
+ for (i=nChan-1; i >= 0; --i) {
+
+ n = wOut[i] + err[i]; // Value
+
+ pe = (n / 257); // Whole part
+ pf = (n % 257); // Fractional part
+
+ err[i] = pf; // Store it for next pixel
+
+ *output++ = (BYTE) pe;
+ }
+
+
+ return output + T_EXTRA(info ->OutputFormat);
+}
+
+
+
// Generic chunky for byte
static
@@ -1318,9 +1390,7 @@ LPBYTE PackLabDouble(register _LPcmsTRANSFORM Info, register WORD wOut[], regist
else
cmsLabEncoded2Float((LPcmsCIELab) output, wOut);
- output += sizeof(cmsCIELab);
-
- return output;
+ return output + (sizeof(cmsCIELab) + T_EXTRA(Info ->OutputFormat) * sizeof(double));
}
}
@@ -1344,10 +1414,9 @@ LPBYTE PackXYZDouble(register _LPcmsTRANSFORM Info, register WORD wOut[], regist
}
else {
- cmsXYZEncoded2Float((LPcmsCIEXYZ) output, wOut);
- output += sizeof(cmsCIEXYZ);
-
- return output;
+ cmsXYZEncoded2Float((LPcmsCIEXYZ) output, wOut);
+
+ return output + (sizeof(cmsCIEXYZ) + T_EXTRA(Info ->OutputFormat) * sizeof(double));
}
}
@@ -1460,7 +1529,10 @@ _cmsFIXFN _cmsIdentifyInputFormat(_LPcmsTRANSFORM xform, DWORD dwInput)
case PT_HSV:
case PT_HLS:
case PT_Yxy:
- FromInput = UnrollDouble;
+ if (T_CHANNELS(dwInput) == 1)
+ FromInput = UnrollDouble1Chan;
+ else
+ FromInput = UnrollDouble;
break;
// Inks (%) 0.0 .. 100.0
@@ -1723,6 +1795,9 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
switch (T_CHANNELS(dwOutput))
{
case 1:
+ if (T_DITHER(dwOutput))
+ ToOutput = PackNBytesDither;
+ else
ToOutput = Pack1Byte;
if (T_EXTRA(dwOutput) == 1) {
if (T_SWAPFIRST(dwOutput))
@@ -1740,8 +1815,12 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
else
if (T_COLORSPACE(dwOutput) == PT_Lab)
ToOutput = Pack3BytesLab;
+ else {
+ if (T_DITHER(dwOutput))
+ ToOutput = PackNBytesDither;
else
ToOutput = Pack3Bytes;
+ }
break;
case 1: // TODO: ALab8 should be handled here
@@ -1767,13 +1846,23 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
case 4: if (T_EXTRA(dwOutput) == 0) {
+
if (T_DOSWAP(dwOutput)) {
- if (T_SWAPFIRST(dwOutput))
+
+ if (T_SWAPFIRST(dwOutput)) {
ToOutput = Pack4BytesSwapSwapFirst;
- else
+ }
+ else {
+
+ if (T_DITHER(dwOutput)) {
+ ToOutput = PackNBytesSwapDither;
+ }
+ else {
ToOutput = Pack4BytesSwap;
}
+ }
+ }
else {
if (T_SWAPFIRST(dwOutput))
ToOutput = Pack4BytesSwapFirst;
@@ -1781,11 +1870,15 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
if (T_FLAVOR(dwOutput))
ToOutput = Pack4BytesReverse;
+ else {
+ if (T_DITHER(dwOutput))
+ ToOutput = PackNBytesDither;
else
ToOutput = Pack4Bytes;
}
}
}
+ }
else {
if (!T_DOSWAP(dwOutput) && !T_SWAPFIRST(dwOutput))
ToOutput = PackNBytes;
@@ -1807,7 +1900,7 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
}
break;
- case 2:
+ case 2:
case 5:
case 7:
case 8:
@@ -1823,8 +1916,13 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
{
if (T_DOSWAP(dwOutput))
ToOutput = PackNBytesSwap;
+ else {
+
+ if (T_DITHER(dwOutput))
+ ToOutput = PackNBytesDither;
else
ToOutput = PackNBytes;
+ }
}
break;
@@ -1958,7 +2056,7 @@ _cmsFIXFN _cmsIdentifyOutputFormat(_LPcmsTRANSFORM xform, DWORD dwOutput)
break;
- case 2:
+ case 2:
case 5:
case 7:
case 8:
@@ -2026,10 +2124,10 @@ void LCMSEXPORT cmsGetUserFormatters(cmsHTRANSFORM hTransform,
{
_LPcmsTRANSFORM xform = (_LPcmsTRANSFORM) (LPSTR) hTransform;
- *Input = (cmsFORMATTER) xform ->FromInput;
- *InputFormat = xform -> InputFormat;
- *Output = (cmsFORMATTER) xform ->ToOutput;
- *OutputFormat = xform -> OutputFormat;
+ if (Input) *Input = (cmsFORMATTER) xform ->FromInput;
+ if (InputFormat) *InputFormat = xform -> InputFormat;
+ if (Output) *Output = (cmsFORMATTER) xform ->ToOutput;
+ if (OutputFormat) *OutputFormat = xform -> OutputFormat;
}
@@ -2042,7 +2140,7 @@ void LCMSEXPORT cmsChangeBuffersFormat(cmsHTRANSFORM hTransform,
cmsSetUserFormatters(hTransform,
dwInputFormat,
- (cmsFORMATTER) _cmsIdentifyInputFormat((_LPcmsTRANSFORM ) hTransform, dwInputFormat),
+ (cmsFORMATTER) _cmsIdentifyInputFormat((_LPcmsTRANSFORM) hTransform, dwInputFormat),
dwOutputFormat,
- (cmsFORMATTER) _cmsIdentifyOutputFormat((_LPcmsTRANSFORM ) hTransform, dwOutputFormat));
+ (cmsFORMATTER) _cmsIdentifyOutputFormat((_LPcmsTRANSFORM) hTransform, dwOutputFormat));
}
diff --git a/icc2ps/cmspcs.c b/icc2ps/cmspcs.c
index 0f618d3..2864418 100644..100755
--- a/icc2ps/cmspcs.c
+++ b/icc2ps/cmspcs.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -27,7 +27,7 @@
/*
- CIE Lab is defined as:
+ CIE 15:2004 CIELab is defined as:
L* = 116*f(Y/Yn) - 16 0 <= L* <= 100
a* = 500*[f(X/Xn) - f(Y/Yn)]
@@ -35,14 +35,14 @@
and
- f(t) = t^(1/3) 1 >= t > 0.008856
- 7.787*t + (16/116) 0 <= t <= 0.008856
+ f(t) = t^(1/3) 1 >= t > (24/116)^3
+ (841/108)*t + (16/116) 0 <= t <= (24/116)^3
Reverse transform is:
- X = Xn*[a* / 500 + (L* + 16) / 116] ^ 3 if (X/Xn) > 0.206893
- = Xn*(a* / 500 + L* / 116) / 7.787 if (X/Xn) <= 0.206893
+ X = Xn*[a* / 500 + (L* + 16) / 116] ^ 3 if (X/Xn) > (24/116)
+ = Xn*(a* / 500 + L* / 116) / 7.787 if (X/Xn) <= (24/116)
@@ -148,14 +148,34 @@ static
double f(double t)
{
- if (t <= 0.008856)
- return 7.787037037037037037037037037037*t + (16./116.);
+ const double Limit = (24.0/116.0) * (24.0/116.0) * (24.0/116.0);
+
+ if (t <= Limit)
+ return (841.0/108.0) * t + (16.0/116.0);
else
- return CubeRoot((float) t); // more precisse than return pow(t, 1.0/3.0);
+ return CubeRoot((float) t);
+}
+
+
+static
+double f_1(double t)
+{
+ const double Limit = (24.0/116.0);
+ if (t <= Limit)
+ {
+ double tmp;
+
+ tmp = (108.0/841.0) * (t - (16.0/116.0));
+ if (tmp <= 0.0) return 0.0;
+ else return tmp;
+ }
+
+ return t * t * t;
}
+
void LCMSEXPORT cmsXYZ2Lab(LPcmsCIEXYZ WhitePoint, LPcmsCIELab Lab, const cmsCIEXYZ* xyz)
{
double fx, fy, fz;
@@ -175,10 +195,10 @@ void LCMSEXPORT cmsXYZ2Lab(LPcmsCIEXYZ WhitePoint, LPcmsCIELab Lab, const cmsCIE
fy = f(xyz->Y / WhitePoint->Y);
fz = f(xyz->Z / WhitePoint->Z);
- Lab->L = 116.* fy - 16.;
+ Lab->L = 116.0* fy - 16.;
- Lab->a = 500.*(fx - fy);
- Lab->b = 200.*(fy - fz);
+ Lab->a = 500.0*(fx - fy);
+ Lab->b = 200.0*(fy - fz);
}
@@ -237,22 +257,6 @@ void cmsXYZ2LabEncoded(WORD XYZ[3], WORD Lab[3])
-static
-double f_1(double t)
-{
-
- if (t <= ((7.787*0.008856) + (16./116.)))
- {
- double tmp;
-
- tmp = ((t - (16./116.)) / 7.787037037037037037037037037037);
- if (tmp <= 0.0) return 0.0;
- else return tmp;
- }
-
- return t * t * t;
-}
-
void LCMSEXPORT cmsLab2XYZ(LPcmsCIEXYZ WhitePoint, LPcmsCIEXYZ xyz, const cmsCIELab* Lab)
@@ -270,7 +274,7 @@ void LCMSEXPORT cmsLab2XYZ(LPcmsCIEXYZ WhitePoint, LPcmsCIEXYZ xyz, const cmsCI
if (WhitePoint == NULL)
WhitePoint = cmsD50_XYZ();
- y = (Lab-> L + 16.) / 116.0;
+ y = (Lab-> L + 16.0) / 116.0;
x = y + 0.002 * Lab -> a;
z = y - 0.005 * Lab -> b;
diff --git a/icc2ps/cmsps2.c b/icc2ps/cmsps2.c
index c393972..819d93d 100644..100755
--- a/icc2ps/cmsps2.c
+++ b/icc2ps/cmsps2.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -115,6 +115,8 @@ LCMSAPI DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile, int Intent,
/Table [ p p p [<...>]]
/RangeABC [ 0 1 0 1 0 1]
/DecodeABC[ <postlinearization> ]
+ /RangeLMN [ -0.236 1.254 0 1 -0.635 1.640 ]
+ % -128/500 1+127/500 0 1 -127/200 1+128/200
/MatrixABC [ 1 1 1 1 0 0 0 0 -1]
/WhitePoint [D50]
/BlackPoint [BP]
@@ -318,7 +320,8 @@ typedef struct {
static
LPMEMSTREAM CreateMemStream(LPBYTE Buffer, DWORD dwMax, int MaxCols)
{
- LPMEMSTREAM m = (LPMEMSTREAM) malloc(sizeof(MEMSTREAM));
+ LPMEMSTREAM m = (LPMEMSTREAM) _cmsMalloc(sizeof(MEMSTREAM));
+ if (m == NULL) return NULL;
ZeroMemory(m, sizeof(MEMSTREAM));
@@ -347,9 +350,9 @@ BYTE Word2Byte(WORD w)
static
BYTE L2Byte(WORD w)
{
- int ww = w + 0x0080;
+ int ww = w + 0x0080;
- if (ww > 0xFFFF) return 0xFF;
+ if (ww > 0xFFFF) return 0xFF;
return (BYTE) ((WORD) (ww >> 8) & 0xFF);
}
@@ -357,8 +360,7 @@ BYTE L2Byte(WORD w)
// Write a raw, uncooked byte. Check for space
static
void WriteRawByte(LPMEMSTREAM m, BYTE b)
-{
-
+{
if (m -> dwUsed + 1 > m -> dwMax) {
m -> HasError = 1;
}
@@ -393,7 +395,7 @@ void WriteByte(LPMEMSTREAM m, BYTE b)
}
-// Does write a formatted string
+// Does write a formatted string. Guaranteed to be 2048 bytes at most.
static
void Writef(LPMEMSTREAM m, const char *frm, ...)
{
@@ -403,7 +405,7 @@ void Writef(LPMEMSTREAM m, const char *frm, ...)
va_start(args, frm);
- vsprintf((char*) Buffer, frm, args);
+ vsnprintf((char*) Buffer, 2048, frm, args);
for (pt = Buffer; *pt; pt++) {
@@ -533,7 +535,7 @@ void EmitLab2XYZ(LPMEMSTREAM m)
Writef(m, "{255 mul 128 sub 200 div } bind\n");
Writef(m, "]\n");
Writef(m, "/MatrixABC [ 1 1 1 1 0 0 0 0 -1]\n");
- Writef(m, "/RangeLMN [ 0.0 0.9642 0.0 1.0000 0.0 0.8249 ]\n");
+ Writef(m, "/RangeLMN [ -0.236 1.254 0 1 -0.635 1.640 ]\n");
Writef(m, "/DecodeLMN [\n");
Writef(m, "{dup 6 29 div ge {dup dup mul mul} {4 29 div sub 108 841 div mul} ifelse 0.964200 mul} bind\n");
Writef(m, "{dup 6 29 div ge {dup dup mul mul} {4 29 div sub 108 841 div mul} ifelse } bind\n");
@@ -555,7 +557,11 @@ void Emit1Gamma(LPMEMSTREAM m, LPWORD Table, int nEntries)
if (nEntries <= 0) return; // Empty table
// Suppress whole if identity
- if (cmsIsLinear(Table, nEntries)) return;
+ if (cmsIsLinear(Table, nEntries)) {
+ Writef(m, "{} ");
+ return;
+ }
+
// Check if is really an exponential. If so, emit "exp"
gamma = cmsEstimateGammaEx(Table, nEntries, 0.001);
@@ -617,7 +623,7 @@ void Emit1Gamma(LPMEMSTREAM m, LPWORD Table, int nEntries)
// Compare gamma table
static
-BOOL GammaTableEquals(LPWORD g1, LPWORD g2, int nEntries)
+LCMSBOOL GammaTableEquals(LPWORD g1, LPWORD g2, int nEntries)
{
return memcmp(g1, g2, nEntries* sizeof(WORD)) == 0;
}
@@ -647,7 +653,7 @@ void EmitNGamma(LPMEMSTREAM m, int n, LPWORD g[], int nEntries)
// Check whatever a profile has CLUT tables (only on input)
static
-BOOL IsLUTbased(cmsHPROFILE hProfile, int Intent)
+LCMSBOOL IsLUTbased(cmsHPROFILE hProfile, int Intent)
{
icTagSignature Tag;
@@ -689,10 +695,10 @@ int OutputValueSampler(register WORD In[], register WORD Out[], register LPVOID
if (sc -> FixWhite) {
- if (In[0] == 0xFFFF) { // Only in L* = 100
+ if (In[0] == 0xFFFF) { // Only in L* = 100, ab = [-8..8]
- if ((In[1] >= 0x8000 && In[1] <= 0x87FF) ||
- (In[2] >= 0x8000 && In[2] <= 0x87FF)) {
+ if ((In[1] >= 0x7800 && In[1] <= 0x8800) &&
+ (In[2] >= 0x7800 && In[2] <= 0x8800)) {
WORD* Black;
WORD* White;
@@ -800,8 +806,8 @@ void WriteCLUT(LPMEMSTREAM m, LPLUT Lut, int bps, const char* PreMaj,
sc.PreMaj = PreMaj;
sc.PostMaj= PostMaj;
- sc.PreMin = PreMin;
- sc.PostMin= PostMin;
+ sc.PreMin = PreMin;
+ sc.PostMin = PostMin;
sc.lIsInput = lIsInput;
sc.FixWhite = FixWhite;
sc.ColorSpace = ColorSpace;
@@ -952,6 +958,31 @@ int EmitCIEBasedDEF(LPMEMSTREAM m, LPLUT Lut, int Intent, LPcmsCIEXYZ BlackPoint
return 1;
}
+// Generates a curve from a gray profile
+
+static
+LPGAMMATABLE ExtractGray2Y(cmsHPROFILE hProfile, int Intent)
+{
+ LPGAMMATABLE Out = cmsAllocGamma(256);
+ cmsHPROFILE hXYZ = cmsCreateXYZProfile();
+ cmsHTRANSFORM xform = cmsCreateTransform(hProfile, TYPE_GRAY_8, hXYZ, TYPE_XYZ_DBL, Intent, cmsFLAGS_NOTPRECALC);
+ int i;
+
+ for (i=0; i < 256; i++) {
+
+ BYTE Gray = (BYTE) i;
+ cmsCIEXYZ XYZ;
+
+ cmsDoTransform(xform, &Gray, &XYZ, 1);
+
+ Out ->GammaTable[i] =_cmsClampWord((int) floor(XYZ.Y * 65535.0 + 0.5));
+ }
+
+ cmsDeleteTransform(xform);
+ cmsCloseProfile(hXYZ);
+ return Out;
+}
+
// Because PostScrip has only 8 bits in /Table, we should use
@@ -1021,13 +1052,10 @@ int WriteInputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent)
switch (nChannels) {
- case 1: {
-
- // LPGAMMATABLE Gray2Y = ExtractGray2Y(xform);
- // rc = EmitCIEBasedA(m, Gray2Y->GammaTable, Gray2Y ->nEntries, hProfile);
- // cmsFreeGamma(Gray2Y);
-
- cmsSignalError(LCMS_ERRC_ABORTED, "Monochrome LUT-based currently unsupported for CSA generation");
+ case 1: {
+ LPGAMMATABLE Gray2Y = ExtractGray2Y(hProfile, Intent);
+ EmitCIEBasedA(m, Gray2Y->GammaTable, Gray2Y ->nEntries, &BlackPointAdaptedToD50);
+ cmsFreeGamma(Gray2Y);
}
break;
@@ -1180,7 +1208,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
if (!WriteNamedColorCSA(mem, hProfile, Intent)) {
- free((void*) mem);
+ _cmsFree((void*) mem);
return 0;
}
}
@@ -1195,7 +1223,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
ColorSpace != icSigLabData) {
cmsSignalError(LCMS_ERRC_ABORTED, "Invalid output color space");
- free((void*) mem);
+ _cmsFree((void*) mem);
return 0;
}
@@ -1205,7 +1233,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
// Yes, so handle as LUT-based
if (!WriteInputLUT(mem, hProfile, Intent)) {
- free((void*) mem);
+ _cmsFree((void*) mem);
return 0;
}
}
@@ -1215,7 +1243,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
if (!WriteInputMatrixShaper(mem, hProfile)) {
- free((void*) mem); // Something went wrong
+ _cmsFree((void*) mem); // Something went wrong
return 0;
}
}
@@ -1226,7 +1254,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
dwBytesUsed = mem ->dwUsed;
// Get rid of memory stream
- free((void*) mem);
+ _cmsFree((void*) mem);
// Finally, return used byte count
return dwBytesUsed;
@@ -1299,26 +1327,39 @@ DWORD LCMSEXPORT cmsGetPostScriptCSA(cmsHPROFILE hProfile,
static
-void EmitPQRStage(LPMEMSTREAM m, int DoBPC, int lIsAbsolute)
+void EmitPQRStage(LPMEMSTREAM m, cmsHPROFILE hProfile, int DoBPC, int lIsAbsolute)
{
-
- Writef(m,"%% Bradford Cone Space\n"
- "/MatrixPQR [0.8951 -0.7502 0.0389 0.2664 1.7135 -0.0685 -0.1614 0.0367 1.0296 ] \n");
+
+ if (lIsAbsolute) {
- Writef(m, "/RangePQR [ -0.5 2 -0.5 2 -0.5 2 ]\n");
+ // For absolute colorimetric intent, encode back to relative
+ // and generate a relative LUT
-
- if (lIsAbsolute) {
+ // Relative encoding is obtained across XYZpcs*(D50/WhitePoint)
- // For absolute colorimetric intent, do nothing
-
- Writef(m, "%% Absolute colorimetric -- no transformation\n"
+ cmsCIEXYZ White;
+
+ cmsTakeMediaWhitePoint(&White, hProfile);
+
+ Writef(m,"/MatrixPQR [1 0 0 0 1 0 0 0 1 ]\n");
+ Writef(m,"/RangePQR [ -0.5 2 -0.5 2 -0.5 2 ]\n");
+
+ Writef(m, "%% Absolute colorimetric -- encode to relative to maximize LUT usage\n"
"/TransformPQR [\n"
- "{exch pop exch pop exch pop exch pop} bind dup dup]\n");
+ "{0.9642 mul %g div exch pop exch pop exch pop exch pop} bind\n"
+ "{1.0000 mul %g div exch pop exch pop exch pop exch pop} bind\n"
+ "{0.8249 mul %g div exch pop exch pop exch pop exch pop} bind\n]\n",
+ White.X, White.Y, White.Z);
return;
}
-
+
+
+ Writef(m,"%% Bradford Cone Space\n"
+ "/MatrixPQR [0.8951 -0.7502 0.0389 0.2664 1.7135 -0.0685 -0.1614 0.0367 1.0296 ] \n");
+
+ Writef(m, "/RangePQR [ -0.5 2 -0.5 2 -0.5 2 ]\n");
+
// No BPC
@@ -1363,6 +1404,7 @@ void EmitPQRStage(LPMEMSTREAM m, int DoBPC, int lIsAbsolute)
static
void EmitXYZ2Lab(LPMEMSTREAM m)
{
+ Writef(m, "/RangeLMN [ -0.635 2.0 0 2 -0.635 2.0 ]\n");
Writef(m, "/EncodeLMN [\n");
Writef(m, "{ 0.964200 div dup 0.008856 le {7.787 mul 16 116 div add}{1 3 div exp} ifelse } bind\n");
Writef(m, "{ 1.000000 div dup 0.008856 le {7.787 mul 16 116 div add}{1 3 div exp} ifelse } bind\n");
@@ -1371,18 +1413,11 @@ void EmitXYZ2Lab(LPMEMSTREAM m)
Writef(m, "/MatrixABC [ 0 1 0 1 -1 1 0 0 -1 ]\n");
Writef(m, "/EncodeABC [\n");
-
-
+
Writef(m, "{ 116 mul 16 sub 100 div } bind\n");
- Writef(m, "{ 500 mul 128 add 255 div } bind\n");
- Writef(m, "{ 200 mul 128 add 255 div } bind\n");
-
+ Writef(m, "{ 500 mul 128 add 256 div } bind\n");
+ Writef(m, "{ 200 mul 128 add 256 div } bind\n");
- /*
- Writef(m, "{ 116 mul 16 sub 256 mul 25700 div } bind\n");
- Writef(m, "{ 500 mul 128 add 256 mul 65535 div } bind\n");
- Writef(m, "{ 200 mul 128 add 256 mul 65535 div } bind\n");
- */
Writef(m, "]\n");
@@ -1407,20 +1442,27 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
LPLUT DeviceLink;
cmsHPROFILE Profiles[3];
cmsCIEXYZ BlackPointAdaptedToD50;
- BOOL lFreeDeviceLink = FALSE;
- BOOL lDoBPC = (dwFlags & cmsFLAGS_BLACKPOINTCOMPENSATION);
-
+ LCMSBOOL lFreeDeviceLink = FALSE;
+ LCMSBOOL lDoBPC = (dwFlags & cmsFLAGS_BLACKPOINTCOMPENSATION);
+ LCMSBOOL lFixWhite = !(dwFlags & cmsFLAGS_NOWHITEONWHITEFIXUP);
+ int RelativeEncodingIntent;
+
- // Trick our v4 profile as it were v2. This prevents the ajusting done
- // in perceptual & saturation. We only neew v4 encoding!
- hLab = cmsCreateLab4Profile(NULL);
- cmsSetProfileICCversion(hLab, 0);
+ hLab = cmsCreateLabProfile(NULL);
ColorSpace = cmsGetColorSpace(hProfile);
nChannels = _cmsChannelsOf(ColorSpace);
OutputFormat = CHANNELS_SH(nChannels) | BYTES_SH(2);
+ // For absolute colorimetric, the LUT is encoded as relative
+ // in order to preserve precission.
+
+ RelativeEncodingIntent = Intent;
+ if (RelativeEncodingIntent == INTENT_ABSOLUTE_COLORIMETRIC)
+ RelativeEncodingIntent = INTENT_RELATIVE_COLORIMETRIC;
+
+
// Is a devicelink profile?
if (cmsGetDeviceClass(hProfile) == icSigLinkClass) {
@@ -1428,13 +1470,14 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
if (ColorSpace == icSigLabData) {
- // adjust input to Lab to out v4
+ // adjust input to Lab to our v4
Profiles[0] = hLab;
Profiles[1] = hProfile;
xform = cmsCreateMultiprofileTransform(Profiles, 2, TYPE_Lab_DBL,
- OutputFormat, Intent, cmsFLAGS_NOPRELINEARIZATION);
+ OutputFormat, RelativeEncodingIntent,
+ dwFlags|cmsFLAGS_NOWHITEONWHITEFIXUP|cmsFLAGS_NOPRELINEARIZATION);
}
else {
@@ -1445,10 +1488,10 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
}
else {
-
+
// This is a normal profile
xform = cmsCreateTransform(hLab, TYPE_Lab_DBL, hProfile,
- OutputFormat, Intent, cmsFLAGS_NOPRELINEARIZATION);
+ OutputFormat, RelativeEncodingIntent, dwFlags|cmsFLAGS_NOWHITEONWHITEFIXUP|cmsFLAGS_NOPRELINEARIZATION);
}
if (xform == NULL) {
@@ -1464,7 +1507,7 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
if (!DeviceLink) {
- DeviceLink = _cmsPrecalculateDeviceLink(xform, 0);
+ DeviceLink = _cmsPrecalculateDeviceLink(xform, cmsFLAGS_NOPRELINEARIZATION);
lFreeDeviceLink = TRUE;
}
@@ -1476,13 +1519,14 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
// Emit headers, etc.
EmitWhiteBlackD50(m, &BlackPointAdaptedToD50);
- EmitPQRStage(m, lDoBPC, Intent == INTENT_ABSOLUTE_COLORIMETRIC);
+ EmitPQRStage(m, hProfile, lDoBPC, Intent == INTENT_ABSOLUTE_COLORIMETRIC);
EmitXYZ2Lab(m);
if (DeviceLink ->wFlags & LUT_HASTL1) {
// Shouldn't happen
- cmsSignalError(LCMS_ERRC_ABORTED, "Internal error (prelinearization on CRD)");
+ cmsSignalError(LCMS_ERRC_ABORTED, "Internal error (prelinearization on CRD)");
+ return 0;
}
@@ -1492,10 +1536,13 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag
// zero. This would sacrifice a bit of highlights, but failure to do so would cause
// scum dot. Ouch.
+ if (Intent == INTENT_ABSOLUTE_COLORIMETRIC)
+ lFixWhite = FALSE;
+
Writef(m, "/RenderTable ");
WriteCLUT(m, DeviceLink, 8, "<", ">\n", "", "", FALSE,
- (Intent != INTENT_ABSOLUTE_COLORIMETRIC), ColorSpace);
+ lFixWhite, ColorSpace);
Writef(m, " %d {} bind ", nChannels);
@@ -1530,6 +1577,9 @@ void BuildColorantList(char *Colorant, int nColorant, WORD Out[])
int j;
Colorant[0] = 0;
+ if (nColorant > MAXCHANNELS)
+ nColorant = MAXCHANNELS;
+
for (j=0; j < nColorant; j++) {
sprintf(Buff, "%.3f", Out[j] / 65535.0);
@@ -1625,7 +1675,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile,
if (!WriteNamedColorCRD(mem, hProfile, Intent, dwFlags)) {
- free((void*) mem);
+ _cmsFree((void*) mem);
return 0;
}
}
@@ -1635,7 +1685,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile,
if (!WriteOutputLUT(mem, hProfile, Intent, dwFlags)) {
- free((void*) mem);
+ _cmsFree((void*) mem);
return 0;
}
}
@@ -1650,7 +1700,7 @@ DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile,
dwBytesUsed = mem ->dwUsed;
// Get rid of memory stream
- free((void*) mem);
+ _cmsFree((void*) mem);
// Finally, return used byte count
return dwBytesUsed;
diff --git a/icc2ps/cmssamp.c b/icc2ps/cmssamp.c
index f24429c..854fb4d 100644..100755
--- a/icc2ps/cmssamp.c
+++ b/icc2ps/cmssamp.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -26,6 +26,8 @@
// ---------------------------------------------------------------------------------
+static volatile int GlobalBlackPreservationStrategy = 0;
+
// Quantize a value 0 <= i < MaxSamples
WORD _cmsQuantizeVal(double i, int MaxSamples)
@@ -89,7 +91,7 @@ int ComponentOf(int n, int clut, int nColorant)
// This routine does a sweep on whole input space, and calls its callback
// function on knots. returns TRUE if all ok, FALSE otherwise.
-BOOL LCMSEXPORT cmsSample3DGrid(LPLUT Lut, _cmsSAMPLER Sampler, LPVOID Cargo, DWORD dwFlags)
+LCMSBOOL LCMSEXPORT cmsSample3DGrid(LPLUT Lut, _cmsSAMPLER Sampler, LPVOID Cargo, DWORD dwFlags)
{
int i, t, nTotalPoints, Colorant, index;
WORD In[MAXCHANNELS], Out[MAXCHANNELS];
@@ -114,12 +116,16 @@ BOOL LCMSEXPORT cmsSample3DGrid(LPLUT Lut, _cmsSAMPLER Sampler, LPVOID Cargo, DW
&Lut -> In16params);
}
+ for (t=0; t < (int) Lut -> OutputChan; t++)
+ Out[t] = Lut->T[index + t];
- // if (dwFlags & SAMPLER_INSPECT) {
+ if (dwFlags & SAMPLER_HASTL2) {
for (t=0; t < (int) Lut -> OutputChan; t++)
- Out[t] = Lut->T[index + t];
- // }
+ Out[t] = cmsLinearInterpLUT16(Out[t],
+ Lut -> L2[t],
+ &Lut -> Out16params);
+ }
if (!Sampler(In, Out, Cargo))
@@ -224,9 +230,11 @@ LPLUT _cmsPrecalculateDeviceLink(cmsHTRANSFORM h, DWORD dwFlags)
LPLUT Grid;
int nGridPoints;
DWORD dwFormatIn, dwFormatOut;
+ DWORD SaveFormatIn, SaveFormatOut;
int ChannelsIn, ChannelsOut;
LPLUT SaveGamutLUT;
+
// Remove any gamut checking
SaveGamutLUT = p ->Gamut;
p ->Gamut = NULL;
@@ -245,8 +253,13 @@ LPLUT _cmsPrecalculateDeviceLink(cmsHTRANSFORM h, DWORD dwFlags)
dwFormatIn = (CHANNELS_SH(ChannelsIn)|BYTES_SH(2));
dwFormatOut = (CHANNELS_SH(ChannelsOut)|BYTES_SH(2));
- p -> FromInput = _cmsIdentifyInputFormat(p, dwFormatIn);
- p -> ToOutput = _cmsIdentifyOutputFormat(p, dwFormatOut);
+ SaveFormatIn = p ->InputFormat;
+ SaveFormatOut = p ->OutputFormat;
+
+ p -> InputFormat = dwFormatIn;
+ p -> OutputFormat = dwFormatOut;
+ p -> FromInput = _cmsIdentifyInputFormat(p, dwFormatIn);
+ p -> ToOutput = _cmsIdentifyOutputFormat(p, dwFormatOut);
// Fix gamut & gamma possible mismatches.
@@ -257,8 +270,7 @@ LPLUT _cmsPrecalculateDeviceLink(cmsHTRANSFORM h, DWORD dwFlags)
_cmsComputePrelinearizationTablesFromXFORM(hOne, 1, Grid);
}
-
-
+
// Attention to this typecast! we can take the luxury to
// do this since cmsHTRANSFORM is only an alias to a pointer
// to the transform struct.
@@ -266,11 +278,13 @@ LPLUT _cmsPrecalculateDeviceLink(cmsHTRANSFORM h, DWORD dwFlags)
if (!cmsSample3DGrid(Grid, XFormSampler, (LPVOID) p, Grid -> wFlags)) {
cmsFreeLUT(Grid);
- return NULL;
- }
-
+ Grid = NULL;
+ }
- p ->Gamut = SaveGamutLUT;
+ p ->Gamut = SaveGamutLUT;
+ p ->InputFormat = SaveFormatIn;
+ p ->OutputFormat = SaveFormatOut;
+
return Grid;
}
@@ -295,8 +309,29 @@ typedef struct {
+// Preserve black only if that is the only ink used
+static
+int BlackPreservingGrayOnlySampler(register WORD In[], register WORD Out[], register LPVOID Cargo)
+{
+ BPCARGO* bp = (LPBPCARGO) Cargo;
+
+ // If going across black only, keep black only
+ if (In[0] == 0 && In[1] == 0 && In[2] == 0) {
+
+ // TAC does not apply because it is black ink!
+ Out[0] = Out[1] = Out[2] = 0;
+ Out[3] = cmsLinearInterpLUT16(In[3], bp->KTone ->GammaTable, &bp->KToneParams);
+ return 1;
+ }
+
+ // Keep normal transform for other colors
+ cmsDoTransform(bp ->cmyk2cmyk, In, Out, 1);
+ return 1;
+}
+
+// Preserve all K plane.
static
int BlackPreservingSampler(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
@@ -309,9 +344,7 @@ int BlackPreservingSampler(register WORD In[], register WORD Out[], register LPV
// Get the K across Tone curve
LabK[3] = cmsLinearInterpLUT16(In[3], bp->KTone ->GammaTable, &bp->KToneParams);
-
// If going across black only, keep black only
-
if (In[0] == 0 && In[1] == 0 && In[2] == 0) {
Out[0] = Out[1] = Out[2] = 0;
@@ -339,7 +372,6 @@ int BlackPreservingSampler(register WORD In[], register WORD Out[], register LPV
cmsDoTransform(bp->hProofOutput, Out, &BlackPreservingLab, 1);
Error = cmsDeltaE(&ColorimetricLab, &BlackPreservingLab);
-
// Apply TAC if needed
@@ -386,7 +418,6 @@ int EstimateTAC(register WORD In[], register WORD Out[], register LPVOID Cargo)
// Estimate the maximum error
-
static
int BlackPreservingEstimateErrorSampler(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
@@ -394,12 +425,9 @@ int BlackPreservingEstimateErrorSampler(register WORD In[], register WORD Out[],
WORD ColorimetricOut[4];
cmsCIELab ColorimetricLab, BlackPreservingLab;
double Error;
-
-
-
+
if (In[0] == 0 && In[1] == 0 && In[2] == 0) return 1;
-
cmsDoTransform(bp->cmyk2cmyk, In, ColorimetricOut, 1);
cmsDoTransform(bp->hProofOutput, ColorimetricOut, &ColorimetricLab, 1);
@@ -413,15 +441,38 @@ int BlackPreservingEstimateErrorSampler(register WORD In[], register WORD Out[],
return 1;
}
+// Setup the K preservation strategy
+int LCMSEXPORT cmsSetCMYKPreservationStrategy(int n)
+{
+ int OldVal = GlobalBlackPreservationStrategy;
-// This is the black-preserving devicelink generator
+ if (n >= 0)
+ GlobalBlackPreservationStrategy = n;
+
+ return OldVal;
+}
+#pragma warning(disable: 4550)
+// Get a pointer to callback on depending of strategy
+static
+_cmsSAMPLER _cmsGetBlackPreservationSampler(void)
+{
+ switch (GlobalBlackPreservationStrategy) {
+
+ case 0: return BlackPreservingGrayOnlySampler;
+ default: return BlackPreservingSampler;
+ }
+
+}
+
+// This is the black-preserving devicelink generator
LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD dwFlags)
{
_LPcmsTRANSFORM p = (_LPcmsTRANSFORM) hCMYK2CMYK;
BPCARGO Cargo;
LPLUT Grid;
+ DWORD LocalFlags;
cmsHPROFILE hLab = cmsCreateLabProfile(NULL);
int nGridPoints;
icTagSignature Device2PCS[] = {icSigAToB0Tag, // Perceptual
@@ -429,58 +480,60 @@ LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD
icSigAToB2Tag, // Saturation
icSigAToB1Tag }; // Absolute colorimetric
// (Relative/WhitePoint)
-
nGridPoints = _cmsReasonableGridpointsByColorspace(p -> EntryColorSpace, dwFlags);
-
+ // Get a copy of inteserting flags for this kind of xform
+ LocalFlags = cmsFLAGS_NOTPRECALC;
+ if (p -> dwOriginalFlags & cmsFLAGS_BLACKPOINTCOMPENSATION)
+ LocalFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
// Fill in cargo struct
-
Cargo.cmyk2cmyk = hCMYK2CMYK;
-
- // Compute tone curves
-
-
- Cargo.KTone = _cmsBuildKToneCurve(hCMYK2CMYK, 256);
- if (Cargo.KTone == NULL) return NULL;
- cmsCalcL16Params(Cargo.KTone ->nEntries, &Cargo.KToneParams);
+ // Compute tone curve.
+ Cargo.KTone = _cmsBuildKToneCurve(hCMYK2CMYK, 256);
+ if (Cargo.KTone == NULL) return NULL;
+ cmsCalcL16Params(Cargo.KTone ->nEntries, &Cargo.KToneParams);
+ // Create a CMYK->Lab "normal" transform on input, without K-preservation
Cargo.cmyk2Lab = cmsCreateTransform(p ->InputProfile, TYPE_CMYK_16,
- hLab, TYPE_Lab_16, p->Intent, cmsFLAGS_NOTPRECALC);
+ hLab, TYPE_Lab_16, p->Intent, LocalFlags);
// We are going to use the reverse of proof direction
Cargo.LabK2cmyk = cmsReadICCLut(p->OutputProfile, Device2PCS[p->Intent]);
+ // Is there any table available?
+ if (Cargo.LabK2cmyk == NULL) {
+ Grid = NULL;
+ goto Cleanup;
+ }
// Setup a roundtrip on output profile for TAC estimation
-
Cargo.hRoundTrip = cmsCreateTransform(p ->OutputProfile, TYPE_CMYK_16,
- p ->OutputProfile, TYPE_CMYK_16, p->Intent, cmsFLAGS_NOTPRECALC);
+ p ->OutputProfile, TYPE_CMYK_16, p->Intent, cmsFLAGS_NOTPRECALC);
// Setup a proof CMYK->Lab on output
-
Cargo.hProofOutput = cmsCreateTransform(p ->OutputProfile, TYPE_CMYK_16,
- hLab, TYPE_Lab_DBL, p->Intent, cmsFLAGS_NOTPRECALC);
+ hLab, TYPE_Lab_DBL, p->Intent, LocalFlags);
+ // Create an empty LUT for holding K-preserving xform
Grid = cmsAllocLUT();
- if (!Grid) return NULL;
+ if (!Grid) goto Cleanup;
Grid = cmsAlloc3DGrid(Grid, nGridPoints, 4, 4);
-
+ // Setup formatters
p -> FromInput = _cmsIdentifyInputFormat(p, TYPE_CMYK_16);
p -> ToOutput = _cmsIdentifyOutputFormat(p, TYPE_CMYK_16);
// Step #1, estimate TAC
-
Cargo.MaxTAC = 0;
if (!cmsSample3DGrid(Grid, EstimateTAC, (LPVOID) &Cargo, 0)) {
@@ -489,9 +542,9 @@ LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD
goto Cleanup;
}
+
// Step #2, compute approximation
-
- if (!cmsSample3DGrid(Grid, BlackPreservingSampler, (LPVOID) &Cargo, 0)) {
+ if (!cmsSample3DGrid(Grid, _cmsGetBlackPreservationSampler(), (LPVOID) &Cargo, 0)) {
cmsFreeLUT(Grid);
Grid = NULL;
@@ -499,22 +552,19 @@ LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD
}
// Step #3, estimate error
-
Cargo.MaxError = 0;
cmsSample3DGrid(Grid, BlackPreservingEstimateErrorSampler, (LPVOID) &Cargo, SAMPLER_INSPECT);
Cleanup:
- cmsDeleteTransform(Cargo.cmyk2Lab);
- cmsDeleteTransform(Cargo.hRoundTrip);
- cmsDeleteTransform(Cargo.hProofOutput);
-
- cmsCloseProfile(hLab);
-
- cmsFreeGamma(Cargo.KTone);
+ if (Cargo.cmyk2Lab) cmsDeleteTransform(Cargo.cmyk2Lab);
+ if (Cargo.hRoundTrip) cmsDeleteTransform(Cargo.hRoundTrip);
+ if (Cargo.hProofOutput) cmsDeleteTransform(Cargo.hProofOutput);
- cmsFreeLUT(Cargo.LabK2cmyk);
+ if (hLab) cmsCloseProfile(hLab);
+ if (Cargo.KTone) cmsFreeGamma(Cargo.KTone);
+ if (Cargo.LabK2cmyk) cmsFreeLUT(Cargo.LabK2cmyk);
return Grid;
}
@@ -587,7 +637,7 @@ void PatchLUT(LPLUT Grid, WORD At[], WORD Value[],
-BOOL _cmsFixWhiteMisalignment(_LPcmsTRANSFORM p)
+LCMSBOOL _cmsFixWhiteMisalignment(_LPcmsTRANSFORM p)
{
WORD *WhitePointIn, *WhitePointOut, *BlackPointIn, *BlackPointOut;
diff --git a/icc2ps/cmsvirt.c b/icc2ps/cmsvirt.c
index 418ba0d..17f2b5f 100644
--- a/icc2ps/cmsvirt.c
+++ b/icc2ps/cmsvirt.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2004 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -288,71 +288,107 @@ cmsHPROFILE CreateNamedColorDevicelink(cmsHTRANSFORM xform)
cmsHPROFILE LCMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, DWORD dwFlags)
{
- cmsHPROFILE hICC;
- _LPcmsTRANSFORM v = (_LPcmsTRANSFORM) hTransform;
- LPLUT Lut;
- BOOL MustFreeLUT;
-
- // Check if is a named color transform
-
- if (cmsGetDeviceClass(v ->InputProfile) == icSigNamedColorClass) {
-
- return CreateNamedColorDevicelink(hTransform);
+ cmsHPROFILE hICC;
+ _LPcmsTRANSFORM v = (_LPcmsTRANSFORM) hTransform;
+ LPLUT Lut;
+ LCMSBOOL MustFreeLUT;
+ LPcmsNAMEDCOLORLIST InputColorant = NULL;
+ LPcmsNAMEDCOLORLIST OutputColorant = NULL;
+
+
+ // Check if is a named color transform
+
+ if (cmsGetDeviceClass(v ->InputProfile) == icSigNamedColorClass) {
+
+ return CreateNamedColorDevicelink(hTransform);
+
+ }
+
+ if (v ->DeviceLink) {
+
+ Lut = v -> DeviceLink;
+ MustFreeLUT = FALSE;
+ }
+ else {
+
+ Lut = _cmsPrecalculateDeviceLink(hTransform, dwFlags);
+ if (!Lut) return NULL;
+ MustFreeLUT = TRUE;
+ }
+
+ hICC = _cmsCreateProfilePlaceholder();
+ if (!hICC) { // can't allocate
+
+ if (MustFreeLUT) cmsFreeLUT(Lut);
+ return NULL;
+ }
+
+
+ FixColorSpaces(hICC, v -> EntryColorSpace, v -> ExitColorSpace, dwFlags);
+
+ cmsSetRenderingIntent(hICC, v -> Intent);
+
+ // Implement devicelink profile using following tags:
+ //
+ // 1 icSigProfileDescriptionTag
+ // 2 icSigMediaWhitePointTag
+ // 3 icSigAToB0Tag
+
+
+ cmsAddTag(hICC, icSigDeviceMfgDescTag, (LPVOID) "LittleCMS");
+ cmsAddTag(hICC, icSigProfileDescriptionTag, (LPVOID) "Device link");
+ cmsAddTag(hICC, icSigDeviceModelDescTag, (LPVOID) "Device link");
+
+
+ cmsAddTag(hICC, icSigMediaWhitePointTag, (LPVOID) cmsD50_XYZ());
+
+ if (cmsGetDeviceClass(hICC) == icSigOutputClass) {
+ cmsAddTag(hICC, icSigBToA0Tag, (LPVOID) Lut);
+ }
+ else
+ cmsAddTag(hICC, icSigAToB0Tag, (LPVOID) Lut);
+
+
+
+ // Try to read input and output colorant table
+ if (cmsIsTag(v ->InputProfile, icSigColorantTableTag)) {
+
+ // Input table can only come in this way.
+ InputColorant = cmsReadColorantTable(v ->InputProfile, icSigColorantTableTag);
+ }
+
+ // Output is a little bit more complex.
+ if (cmsGetDeviceClass(v ->OutputProfile) == icSigLinkClass) {
+
+ // This tag may exist only on devicelink profiles.
+ if (cmsIsTag(v ->OutputProfile, icSigColorantTableOutTag)) {
+
+ OutputColorant = cmsReadColorantTable(v ->OutputProfile, icSigColorantTableOutTag);
}
-
- if (v ->DeviceLink) {
-
- Lut = v -> DeviceLink;
- MustFreeLUT = FALSE;
- }
- else {
-
- Lut = _cmsPrecalculateDeviceLink(hTransform, dwFlags);
- if (!Lut) return NULL;
- MustFreeLUT = TRUE;
- }
-
- hICC = _cmsCreateProfilePlaceholder();
- if (!hICC) { // can't allocate
-
- if (MustFreeLUT) cmsFreeLUT(Lut);
- return NULL;
- }
-
-
- FixColorSpaces(hICC, v -> EntryColorSpace, v -> ExitColorSpace, dwFlags);
-
- cmsSetRenderingIntent(hICC, v -> Intent);
-
- // Implement devicelink profile using following tags:
- //
- // 1 icSigProfileDescriptionTag
- // 2 icSigMediaWhitePointTag
- // 3 icSigAToB0Tag
-
-
- cmsAddTag(hICC, icSigDeviceMfgDescTag, (LPVOID) "LittleCMS");
- cmsAddTag(hICC, icSigProfileDescriptionTag, (LPVOID) "Device link");
- cmsAddTag(hICC, icSigDeviceModelDescTag, (LPVOID) "Device link");
+
+ } else {
+
+ if (cmsIsTag(v ->OutputProfile, icSigColorantTableTag)) {
+
+ OutputColorant = cmsReadColorantTable(v ->OutputProfile, icSigColorantTableTag);
+ }
+ }
-
- cmsAddTag(hICC, icSigMediaWhitePointTag, (LPVOID) cmsD50_XYZ());
-
- if (cmsGetDeviceClass(hICC) == icSigOutputClass) {
-
-
- cmsAddTag(hICC, icSigBToA0Tag, (LPVOID) Lut);
- }
-
- else
- cmsAddTag(hICC, icSigAToB0Tag, (LPVOID) Lut);
-
+ if (InputColorant)
+ cmsAddTag(hICC, icSigColorantTableTag, InputColorant);
+
+ if (OutputColorant)
+ cmsAddTag(hICC, icSigColorantTableOutTag, OutputColorant);
+
+
+
+ if (MustFreeLUT) cmsFreeLUT(Lut);
+ if (InputColorant) cmsFreeNamedColorList(InputColorant);
+ if (OutputColorant) cmsFreeNamedColorList(OutputColorant);
+
+ return hICC;
- if (MustFreeLUT) cmsFreeLUT(Lut);
-
- return hICC;
-
}
@@ -379,6 +415,7 @@ cmsHPROFILE LCMSEXPORT cmsCreateLinearizationDeviceLink(icColorSpaceSignature Co
// Creates a LUT with prelinearization step only
Lut = cmsAllocLUT();
+ if (Lut == NULL) return NULL;
// Set up channels
Lut ->InputChan = Lut ->OutputChan = _cmsChannelsOf(ColorSpace);
@@ -481,6 +518,10 @@ cmsHPROFILE LCMSEXPORT cmsCreateInkLimitingDeviceLink(icColorSpaceSignature Colo
// Creates a LUT with 3D grid only
Lut = cmsAllocLUT();
+ if (Lut == NULL) {
+ cmsCloseProfile(hICC);
+ return NULL;
+ }
cmsAlloc3DGrid(Lut, 17, _cmsChannelsOf(ColorSpace),
@@ -517,8 +558,9 @@ static
LPLUT Create3x3EmptyLUT(void)
{
LPLUT AToB0 = cmsAllocLUT();
- AToB0 -> InputChan = AToB0 -> OutputChan = 3;
+ if (AToB0 == NULL) return NULL;
+ AToB0 -> InputChan = AToB0 -> OutputChan = 3;
return AToB0;
}
@@ -530,8 +572,8 @@ cmsHPROFILE LCMSEXPORT cmsCreateLabProfile(LPcmsCIExyY WhitePoint)
cmsHPROFILE hProfile;
LPLUT Lut;
-
hProfile = cmsCreateRGBProfile(WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
+ if (hProfile == NULL) return NULL;
cmsSetDeviceClass(hProfile, icSigAbstractClass);
cmsSetColorSpace(hProfile, icSigLabData);
@@ -544,7 +586,10 @@ cmsHPROFILE LCMSEXPORT cmsCreateLabProfile(LPcmsCIExyY WhitePoint)
// An empty LUTs is all we need
Lut = Create3x3EmptyLUT();
- if (Lut == NULL) return NULL;
+ if (Lut == NULL) {
+ cmsCloseProfile(hProfile);
+ return NULL;
+ }
cmsAddTag(hProfile, icSigAToB0Tag, (LPVOID) Lut);
cmsAddTag(hProfile, icSigBToA0Tag, (LPVOID) Lut);
@@ -561,8 +606,8 @@ cmsHPROFILE LCMSEXPORT cmsCreateLab4Profile(LPcmsCIExyY WhitePoint)
cmsHPROFILE hProfile;
LPLUT Lut;
-
hProfile = cmsCreateRGBProfile(WhitePoint == NULL ? cmsD50_xyY() : WhitePoint, NULL, NULL);
+ if (hProfile == NULL) return NULL;
cmsSetProfileICCversion(hProfile, 0x4000000);
@@ -577,7 +622,10 @@ cmsHPROFILE LCMSEXPORT cmsCreateLab4Profile(LPcmsCIExyY WhitePoint)
// An empty LUTs is all we need
Lut = Create3x3EmptyLUT();
- if (Lut == NULL) return NULL;
+ if (Lut == NULL) {
+ cmsCloseProfile(hProfile);
+ return NULL;
+ }
Lut -> wFlags |= LUT_V4_INPUT_EMULATE_V2;
cmsAddTag(hProfile, icSigAToB0Tag, (LPVOID) Lut);
@@ -599,6 +647,7 @@ cmsHPROFILE LCMSEXPORT cmsCreateXYZProfile(void)
LPLUT Lut;
hProfile = cmsCreateRGBProfile(cmsD50_xyY(), NULL, NULL);
+ if (hProfile == NULL) return NULL;
cmsSetDeviceClass(hProfile, icSigAbstractClass);
cmsSetColorSpace(hProfile, icSigXYZData);
@@ -610,15 +659,16 @@ cmsHPROFILE LCMSEXPORT cmsCreateXYZProfile(void)
// An empty LUTs is all we need
Lut = Create3x3EmptyLUT();
- if (Lut == NULL) return NULL;
+ if (Lut == NULL) {
+ cmsCloseProfile(hProfile);
+ return NULL;
+ }
cmsAddTag(hProfile, icSigAToB0Tag, (LPVOID) Lut);
cmsAddTag(hProfile, icSigBToA0Tag, (LPVOID) Lut);
cmsAddTag(hProfile, icSigPreview0Tag, (LPVOID) Lut);
- cmsFreeLUT(Lut);
-
-
+ cmsFreeLUT(Lut);
return hProfile;
}
@@ -656,6 +706,7 @@ LPGAMMATABLE Build_sRGBGamma(void)
return cmsBuildParametricGamma(1024, 4, Parameters);
}
+// Create the ICC virtual profile for sRGB space
cmsHPROFILE LCMSEXPORT cmsCreate_sRGBProfile(void)
{
cmsCIExyY D65;
@@ -672,6 +723,7 @@ cmsHPROFILE LCMSEXPORT cmsCreate_sRGBProfile(void)
hsRGB = cmsCreateRGBProfile(&D65, &Rec709Primaries, Gamma22);
cmsFreeGamma(Gamma22[0]);
+ if (hsRGB == NULL) return NULL;
cmsAddTag(hsRGB, icSigDeviceMfgDescTag, (LPVOID) "(lcms internal)");
@@ -683,7 +735,6 @@ cmsHPROFILE LCMSEXPORT cmsCreate_sRGBProfile(void)
-
typedef struct {
double Brightness;
double Contrast;
@@ -726,7 +777,6 @@ int bchswSampler(register WORD In[], register WORD Out[], register LPVOID Cargo)
cmsFloat2LabEncoded(Out, &LabOut);
-
return TRUE;
}
@@ -772,7 +822,10 @@ cmsHPROFILE LCMSEXPORT cmsCreateBCHSWabstractProfile(int nLUTPoints,
// Creates a LUT with 3D grid only
Lut = cmsAllocLUT();
-
+ if (Lut == NULL) {
+ cmsCloseProfile(hICC);
+ return NULL;
+ }
cmsAlloc3DGrid(Lut, nLUTPoints, 3, 3);
@@ -823,7 +876,10 @@ cmsHPROFILE LCMSEXPORT cmsCreateNULLProfile(void)
// An empty LUTs is all we need
Lut = cmsAllocLUT();
- if (Lut == NULL) return NULL;
+ if (Lut == NULL) {
+ cmsCloseProfile(hProfile);
+ return NULL;
+ }
Lut -> InputChan = 3;
Lut -> OutputChan = 1;
diff --git a/icc2ps/cmswtpnt.c b/icc2ps/cmswtpnt.c
index 7363b46..c3ec50d 100644..100755
--- a/icc2ps/cmswtpnt.c
+++ b/icc2ps/cmswtpnt.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2004 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -22,10 +22,6 @@
#include "lcms.h"
-// Uncomment this line if you want lcms to use the black point tag in profile,
-// if commented, lcms will compute the black point by its own.
-// It is safer to leve it commented out
-// #define HONOR_BLACK_POINT_TAG
// Conversions
@@ -50,10 +46,9 @@ void LCMSEXPORT cmsxyY2XYZ(LPcmsCIEXYZ Dest, const cmsCIExyY* Source)
}
-
// Obtains WhitePoint from Temperature
-BOOL LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint)
+LCMSBOOL LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint)
{
double x, y;
double T, T2, T3;
@@ -118,7 +113,7 @@ BOOL LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint)
// - Then, I apply these coeficients to the original matrix
-BOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r, LPcmsCIExyY WhitePt,
+LCMSBOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r, LPcmsCIExyY WhitePt,
LPcmsCIExyYTRIPLE Primrs)
{
VEC3 WhitePoint, Coef;
@@ -140,14 +135,12 @@ BOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r, LPcmsCIExyY WhitePt,
// Build Primaries matrix
-
VEC3init(&Primaries.v[0], xr, xg, xb);
VEC3init(&Primaries.v[1], yr, yg, yb);
VEC3init(&Primaries.v[2], (1-xr-yr), (1-xg-yg), (1-xb-yb));
// Result = Primaries ^ (-1) inverse matrix
-
if (!MAT3inverse(&Primaries, &Result))
return FALSE;
@@ -155,11 +148,9 @@ BOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r, LPcmsCIExyY WhitePt,
VEC3init(&WhitePoint, xn/yn, 1.0, (1.0-xn-yn)/yn);
// Across inverse primaries ...
-
MAT3eval(&Coef, &Result, &WhitePoint);
// Give us the Coefs, then I build transformation matrix
-
VEC3init(&r -> v[0], Coef.n[VX]*xr, Coef.n[VY]*xg, Coef.n[VZ]*xb);
VEC3init(&r -> v[1], Coef.n[VX]*yr, Coef.n[VY]*yg, Coef.n[VZ]*yb);
VEC3init(&r -> v[2], Coef.n[VX]*(1.0-xr-yr), Coef.n[VY]*(1.0-xg-yg), Coef.n[VZ]*(1.0-xb-yb));
@@ -217,7 +208,7 @@ void ComputeChromaticAdaptation(LPMAT3 Conversion,
// Returns the final chrmatic adaptation from illuminant FromIll to Illuminant ToIll
// The cone matrix can be specified in ConeMatrix. If NULL, Bradford is assumed
-BOOL cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcmsCIEXYZ ToIll)
+LCMSBOOL cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcmsCIEXYZ ToIll)
{
MAT3 LamRigg = {{ // Bradford matrix
{{ 0.8951, 0.2664, -0.1614 }},
@@ -236,7 +227,7 @@ BOOL cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcms
// Same as anterior, but assuming D50 destination. White point is given in xyY
-BOOL cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt)
+LCMSBOOL cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt)
{
cmsCIEXYZ Dn;
MAT3 Bradford;
@@ -255,7 +246,7 @@ BOOL cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt)
// Same as anterior, but assuming D50 source. White point is given in xyY
-BOOL cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt)
+LCMSBOOL cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt)
{
cmsCIEXYZ Dn;
MAT3 Bradford;
@@ -275,7 +266,7 @@ BOOL cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt)
// Adapts a color to a given illuminant. Original color is expected to have
// a SourceWhitePt white point.
-BOOL LCMSEXPORT cmsAdaptToIlluminant(LPcmsCIEXYZ Result,
+LCMSBOOL LCMSEXPORT cmsAdaptToIlluminant(LPcmsCIEXYZ Result,
LPcmsCIEXYZ SourceWhitePt,
LPcmsCIEXYZ Illuminant,
LPcmsCIEXYZ Value)
@@ -375,8 +366,6 @@ double Robertson(LPcmsCIExyY v)
dj = ((vs - vj) - tj * (us - uj)) / sqrt(1 + tj*tj);
-
-
if ((j!=0) && (di/dj < 0.0)) {
Tc = 1000000.0 / (mi + (di / (di - dj)) * (mj - mi));
break;
@@ -394,7 +383,7 @@ double Robertson(LPcmsCIExyY v)
static
-BOOL InRange(LPcmsCIExyY a, LPcmsCIExyY b, double tolerance)
+LCMSBOOL InRange(LPcmsCIExyY a, LPcmsCIExyY b, double tolerance)
{
double dist_x, dist_y;
@@ -429,6 +418,7 @@ int FromD40toD150(LPWHITEPOINTS pts)
}
+// To be removed in future versions
void _cmsIdentifyWhitePoint(char *Buffer, LPcmsCIEXYZ WhitePt)
{
int i, n;
@@ -488,8 +478,7 @@ int BlackPointAsDarkerColorant(cmsHPROFILE hInput,
cmsCIELab Lab;
cmsCIEXYZ BlackXYZ, MediaWhite;
- // If the profile does not support input direction, assume Black point 0
-
+ // If the profile does not support input direction, assume Black point 0
if (!cmsIsIntentSupported(hInput, Intent, LCMS_USED_AS_INPUT)) {
BlackPoint -> X = BlackPoint ->Y = BlackPoint -> Z = 0.0;
@@ -498,7 +487,6 @@ int BlackPointAsDarkerColorant(cmsHPROFILE hInput,
// Try to get black by using black colorant
-
Space = cmsGetColorSpace(hInput);
if (!_cmsEndPointsBySpace(Space, &White, &Black, &nChannels)) {
@@ -547,7 +535,7 @@ int BlackPointAsDarkerColorant(cmsHPROFILE hInput,
// Get a black point of output CMYK profile, discounting any ink-limiting embedded
-// in the profile. Fou doing that, use perceptual intent in input direction:
+// in the profile. For doing that, use perceptual intent in input direction:
// Lab (0, 0, 0) -> [Perceptual] Profile -> CMYK -> [Rel. colorimetric] Profile -> Lab
static
@@ -622,6 +610,8 @@ int GetV4PerceptualBlack(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, DWORD dwF
D50BlackPoint.X = PERCEPTUAL_BLACK_X;
D50BlackPoint.Y = PERCEPTUAL_BLACK_Y;
D50BlackPoint.Z = PERCEPTUAL_BLACK_Z;
+
+ // Obtain the absolute XYZ. Adapt perceptual black back from D50 to whatever media white
cmsAdaptToIlluminant(BlackPoint, cmsD50_XYZ(), &MediaWhite, &D50BlackPoint);
}
@@ -633,26 +623,24 @@ int GetV4PerceptualBlack(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, DWORD dwF
// This function shouldn't exist at all -- there is such quantity of broken
// profiles on black point tag, that we must somehow fix chromaticity to
// avoid huge tint when doing Black point compensation. This function does
-// just that. If BP is specified, then forces it to neutral and uses only L
-// component. If does not exist, computes it by taking 400% of ink or RGB=0 This
-// works well on relative intent and is undefined on perceptual & saturation.
-// However, I will support all intents for tricking & trapping.
-
+// just that. There is a special flag for using black point tag, but turned
+// off by default because it is bogus on most profiles. The detection algorithm
+// involves to turn BP to neutral and to use only L component.
int cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent, DWORD dwFlags)
{
- // v4 + perceptual & saturation intents does have its own black point
+ // v4 + perceptual & saturation intents does have its own black point, and it is
+ // well specified enough to use it.
if ((cmsGetProfileICCversion(hProfile) >= 0x4000000) &&
(Intent == INTENT_PERCEPTUAL || Intent == INTENT_SATURATION)) {
// Matrix shaper share MRC & perceptual intents
-
if (_cmsIsMatrixShaper(hProfile))
return BlackPointAsDarkerColorant(hProfile, INTENT_RELATIVE_COLORIMETRIC, BlackPoint, cmsFLAGS_NOTPRECALC);
- // Get fixed value
+ // CLUT based - Get perceptual black point (fixed value)
return GetV4PerceptualBlack(BlackPoint, hProfile, dwFlags);
}
@@ -672,7 +660,6 @@ int cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent
cmsTakeMediaWhitePoint(&MediaWhite, hProfile);
// Black point is absolute XYZ, so adapt to D50 to get PCS value
-
cmsAdaptToIlluminant(&UntrustedBlackPoint, &MediaWhite, cmsD50_XYZ(), &BlackXYZ);
// Force a=b=0 to get rid of any chroma
@@ -684,7 +671,6 @@ int cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent
cmsLab2XYZ(NULL, &TrustedBlackPoint, &Lab);
// Return BP as D50 relative or absolute XYZ (depends on flags)
-
if (!(dwFlags & LCMS_BPFLAGS_D50_ADAPTED))
cmsAdaptToIlluminant(BlackPoint, cmsD50_XYZ(), &MediaWhite, &TrustedBlackPoint);
else
@@ -695,15 +681,15 @@ int cmsDetectBlackPoint(LPcmsCIEXYZ BlackPoint, cmsHPROFILE hProfile, int Intent
#endif
- // If output profile, discount ink-limiting
-
+ // That is about v2 profiles.
+
+ // If output profile, discount ink-limiting and that's all
if (Intent == INTENT_RELATIVE_COLORIMETRIC &&
(cmsGetDeviceClass(hProfile) == icSigOutputClass) &&
(cmsGetColorSpace(hProfile) == icSigCmykData))
return BlackPointUsingPerceptualBlack(BlackPoint, hProfile, dwFlags);
// Nope, compute BP using current intent.
-
return BlackPointAsDarkerColorant(hProfile, Intent, BlackPoint, dwFlags);
}
diff --git a/icc2ps/cmsxform.c b/icc2ps/cmsxform.c
index ea3cb35..a7dcbde 100644..100755
--- a/icc2ps/cmsxform.c
+++ b/icc2ps/cmsxform.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2004 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -23,11 +23,11 @@
#include "lcms.h"
-// #define DEBUG 1
// Transformations stuff
// -----------------------------------------------------------------------
+
// Interface
cmsHTRANSFORM LCMSEXPORT cmsCreateTransform(cmsHPROFILE Input,
@@ -55,7 +55,7 @@ void LCMSEXPORT cmsDoTransform(cmsHTRANSFORM Transform,
void LCMSEXPORT cmsGetAlarmCodes(int *r, int *g, int *b);
void LCMSEXPORT cmsSetAlarmCodes(int r, int g, int b);
-BOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile,
+LCMSBOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile,
int Intent, int UsedDirection);
// -------------------------------------------------------------------------
@@ -87,7 +87,7 @@ static icTagSignature Preview[] = {icSigPreview0Tag,
-static double GlobalAdaptationState = 0;
+static volatile double GlobalAdaptationState = 0;
// --------------------------------Stages--------------------------------------
@@ -294,18 +294,31 @@ void PrecalculatedXFORM(_LPcmsTRANSFORM p,
register LPBYTE accum;
register LPBYTE output;
WORD wIn[MAXCHANNELS], wOut[MAXCHANNELS];
- register unsigned int i, n;
-
+ unsigned int i, n;
+
accum = (LPBYTE) in;
output = (LPBYTE) out;
n = Size; // Buffer len
+
for (i=0; i < n; i++) {
- accum = p -> FromInput(p, wIn, accum);
- cmsEvalLUT(p -> DeviceLink, wIn, wOut);
- output = p -> ToOutput(p, wOut, output);
+ accum = p -> FromInput(p, wIn, accum);
+
+ // Try to speedup things on plain devicelinks
+
+ if (p ->DeviceLink ->wFlags == LUT_HAS3DGRID) {
+
+ p ->DeviceLink ->CLut16params.Interp3D(wIn, wOut,
+ p ->DeviceLink -> T,
+ &p ->DeviceLink -> CLut16params);
+ }
+ else
+ cmsEvalLUT(p -> DeviceLink, wIn, wOut);
+
+
+ output = p -> ToOutput(p, wOut, output);
}
}
@@ -371,6 +384,7 @@ void CachedXFORM(_LPcmsTRANSFORM p,
register LPBYTE output;
WORD wIn[MAXCHANNELS], wOut[MAXCHANNELS];
register unsigned int i, n;
+ WORD CacheIn[MAXCHANNELS], CacheOut[MAXCHANNELS];
accum = (LPBYTE) in;
@@ -382,25 +396,48 @@ void CachedXFORM(_LPcmsTRANSFORM p,
ZeroMemory(wIn, sizeof(WORD) * MAXCHANNELS);
ZeroMemory(wOut, sizeof(WORD) * MAXCHANNELS);
+
+ LCMS_READ_LOCK(&p ->rwlock);
+ CopyMemory(CacheIn, p ->CacheIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(CacheOut, p ->CacheOut, sizeof(WORD) * MAXCHANNELS);
+ LCMS_UNLOCK(&p ->rwlock);
+
for (i=0; i < n; i++) {
accum = p -> FromInput(p, wIn, accum);
+
- if (memcmp(wIn, p ->CacheIn, sizeof(WORD) * MAXCHANNELS) == 0) {
+ if (memcmp(wIn, CacheIn, sizeof(WORD) * MAXCHANNELS) == 0) {
- CopyMemory(wOut, p ->CacheOut, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(wOut, CacheOut, sizeof(WORD) * MAXCHANNELS);
}
else {
+
+ // Try to speedup things on plain devicelinks
- CopyMemory(p ->CacheIn, wIn, sizeof(WORD) * MAXCHANNELS);
+ if (p ->DeviceLink ->wFlags == LUT_HAS3DGRID) {
- cmsEvalLUT(p -> DeviceLink, wIn, wOut);
+ p ->DeviceLink ->CLut16params.Interp3D(wIn, wOut,
+ p ->DeviceLink -> T,
+ &p ->DeviceLink -> CLut16params);
+ }
+ else
+ cmsEvalLUT(p -> DeviceLink, wIn, wOut);
- CopyMemory(p ->CacheOut, wOut, sizeof(WORD) * MAXCHANNELS);
- }
+ CopyMemory(CacheIn, wIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(CacheOut, wOut, sizeof(WORD) * MAXCHANNELS);
+ }
+
output = p -> ToOutput(p, wOut, output);
}
+
+
+ LCMS_WRITE_LOCK(&p ->rwlock);
+ CopyMemory(p->CacheIn, CacheIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(p->CacheOut, CacheOut, sizeof(WORD) * MAXCHANNELS);
+ LCMS_UNLOCK(&p ->rwlock);
+
}
@@ -416,6 +453,7 @@ void CachedXFORMGamutCheck(_LPcmsTRANSFORM p,
register LPBYTE output;
WORD wIn[MAXCHANNELS], wOut[MAXCHANNELS];
register unsigned int i, n;
+ WORD CacheIn[MAXCHANNELS], CacheOut[MAXCHANNELS];
accum = (LPBYTE) in;
@@ -427,25 +465,35 @@ void CachedXFORMGamutCheck(_LPcmsTRANSFORM p,
ZeroMemory(wIn, sizeof(WORD) * MAXCHANNELS);
ZeroMemory(wOut, sizeof(WORD) * MAXCHANNELS);
+ LCMS_READ_LOCK(&p ->rwlock);
+ CopyMemory(CacheIn, p ->CacheIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(CacheOut, p ->CacheOut, sizeof(WORD) * MAXCHANNELS);
+ LCMS_UNLOCK(&p ->rwlock);
+
+
for (i=0; i < n; i++) {
accum = p -> FromInput(p, wIn, accum);
- if (memcmp(wIn, p ->CacheIn, sizeof(WORD) * MAXCHANNELS) == 0) {
+ if (memcmp(wIn, CacheIn, sizeof(WORD) * MAXCHANNELS) == 0) {
- CopyMemory(wOut, p ->CacheOut, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(wOut, CacheOut, sizeof(WORD) * MAXCHANNELS);
}
else {
-
- CopyMemory(p ->CacheIn, wIn, sizeof(WORD) * MAXCHANNELS);
-
- TransformOnePixelWithGamutCheck(p, wIn, wOut);
- CopyMemory(p ->CacheOut, wOut, sizeof(WORD) * MAXCHANNELS);
+ TransformOnePixelWithGamutCheck(p, wIn, wOut);
+
+ CopyMemory(CacheIn, wIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(CacheOut, wOut, sizeof(WORD) * MAXCHANNELS);
}
output = p -> ToOutput(p, wOut, output);
}
+
+ LCMS_WRITE_LOCK(&p ->rwlock);
+ CopyMemory(p->CacheIn, CacheIn, sizeof(WORD) * MAXCHANNELS);
+ CopyMemory(p->CacheOut, CacheOut, sizeof(WORD) * MAXCHANNELS);
+ LCMS_UNLOCK(&p ->rwlock);
}
@@ -557,6 +605,8 @@ LPMATSHAPER cmsBuildGrayInputMatrixShaper(cmsHPROFILE hProfile)
MAT3 Scale;
GrayTRC = cmsReadICCGamma(hProfile, icSigGrayTRCTag); // Y
+ if (GrayTRC == NULL) return NULL;
+
cmsTakeIluminant(&Illuminant, hProfile);
if (cmsGetPCS(hProfile) == icSigLabData) {
@@ -661,8 +711,7 @@ LPMATSHAPER cmsBuildInputMatrixShaper(cmsHPROFILE InputProfile)
// iluminant, scaled across GrayTRC
if (cmsGetColorSpace(InputProfile) == icSigGrayData)
- {
- // if (dwFlags) *dwFlags |= cmsFLAGS_NOTPRECALC;
+ {
return cmsBuildGrayInputMatrixShaper(InputProfile);
}
@@ -724,7 +773,7 @@ LPMATSHAPER cmsBuildOutputMatrixShaper(cmsHPROFILE OutputProfile)
// This function builds a transform matrix chaining parameters
static
-BOOL cmsBuildSmeltMatShaper(_LPcmsTRANSFORM p)
+LCMSBOOL cmsBuildSmeltMatShaper(_LPcmsTRANSFORM p)
{
MAT3 From, To, ToInv, Transfer;
LPGAMMATABLE In[3], InverseOut[3];
@@ -737,7 +786,6 @@ BOOL cmsBuildSmeltMatShaper(_LPcmsTRANSFORM p)
if (!cmsReadICCMatrixRGB2XYZ(&To, p -> OutputProfile))
return FALSE;
-
// invert dest
if (MAT3inverse(&To, &ToInv) < 0)
@@ -761,10 +809,14 @@ BOOL cmsBuildSmeltMatShaper(_LPcmsTRANSFORM p)
InverseOut[1] = cmsReadICCGammaReversed(p -> OutputProfile, icSigGreenTRCTag);
InverseOut[2] = cmsReadICCGammaReversed(p -> OutputProfile, icSigBlueTRCTag);
+ if (!InverseOut[0] || !InverseOut[1] || !InverseOut[2]) {
+ cmsFreeGammaTriple(In);
+ return FALSE;
+ }
+
p -> SmeltMatShaper = cmsAllocMatShaper2(&Transfer, In, InverseOut, MATSHAPER_ALLSMELTED);
cmsFreeGammaTriple(In);
-
cmsFreeGammaTriple(InverseOut);
return (p -> SmeltMatShaper != NULL);
@@ -952,7 +1004,7 @@ void TakeConversionRoutines(_LPcmsTRANSFORM p, int DoBPC)
// Check colorspace
static
-BOOL IsProperColorSpace(cmsHPROFILE hProfile, DWORD dwFormat, BOOL lUsePCS)
+LCMSBOOL IsProperColorSpace(cmsHPROFILE hProfile, DWORD dwFormat, LCMSBOOL lUsePCS)
{
int Space = T_COLORSPACE(dwFormat);
@@ -972,10 +1024,10 @@ _LPcmsTRANSFORM AllocEmptyTransform(void)
{
// Allocate needed memory
- _LPcmsTRANSFORM p = (_LPcmsTRANSFORM) malloc(sizeof(_cmsTRANSFORM));
+ _LPcmsTRANSFORM p = (_LPcmsTRANSFORM) _cmsMalloc(sizeof(_cmsTRANSFORM));
if (!p) {
- cmsSignalError(LCMS_ERRC_ABORTED, "cmsCreateTransform: malloc() failed");
+ cmsSignalError(LCMS_ERRC_ABORTED, "cmsCreateTransform: _cmsMalloc() failed");
return NULL;
}
@@ -1001,6 +1053,8 @@ _LPcmsTRANSFORM AllocEmptyTransform(void)
p -> ExitColorSpace = (icColorSpaceSignature) 0;
p -> AdaptationState = GlobalAdaptationState;
+ LCMS_CREATE_LOCK(&p->rwlock);
+
return p;
}
@@ -1008,13 +1062,13 @@ _LPcmsTRANSFORM AllocEmptyTransform(void)
// Identify whatever a transform is to be cached
static
-void SetPrecalculatedTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
+void SetPrecalculatedTransform(_LPcmsTRANSFORM p)
{
- if (dwFlags & cmsFLAGS_GAMUTCHECK && p ->GamutCheck != NULL) {
+ if ((p->dwOriginalFlags & cmsFLAGS_GAMUTCHECK) && p ->GamutCheck != NULL) {
p -> xform = PrecalculatedXFORMGamutCheck;
- if (!(dwFlags & cmsFLAGS_NOTCACHE)) {
+ if (!(p->dwOriginalFlags & cmsFLAGS_NOTCACHE)) {
ZeroMemory(p ->CacheIn, sizeof(WORD) * MAXCHANNELS);
TransformOnePixelWithGamutCheck(p, p->CacheIn, p ->CacheOut);
@@ -1026,7 +1080,7 @@ void SetPrecalculatedTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
p -> xform = PrecalculatedXFORM;
- if (!(dwFlags & cmsFLAGS_NOTCACHE)) {
+ if (!(p->dwOriginalFlags & cmsFLAGS_NOTCACHE)) {
ZeroMemory(p ->CacheIn, sizeof(WORD) * MAXCHANNELS);
cmsEvalLUT(p ->DeviceLink, p->CacheIn, p ->CacheOut);
@@ -1038,7 +1092,7 @@ void SetPrecalculatedTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
// Transform is identified as device-link
static
-cmsHPROFILE CreateDeviceLinkTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
+cmsHPROFILE CreateDeviceLinkTransform(_LPcmsTRANSFORM p)
{
if (!IsProperColorSpace(p->InputProfile, p->InputFormat, FALSE)) {
@@ -1074,7 +1128,7 @@ cmsHPROFILE CreateDeviceLinkTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
p -> Phase2 = -1;
p -> Phase3 = -1;
- SetPrecalculatedTransform(p, dwFlags);
+ SetPrecalculatedTransform(p);
p -> EntryColorSpace = cmsGetColorSpace(p -> InputProfile);
p -> ExitColorSpace = cmsGetPCS(p -> InputProfile);
@@ -1092,14 +1146,12 @@ cmsHPROFILE CreateDeviceLinkTransform(_LPcmsTRANSFORM p, DWORD dwFlags)
// Transform that includes proofing
static
-void CreateProof(_LPcmsTRANSFORM p,
- DWORD dwFlags,
- icTagSignature *ToTagPtr)
+void CreateProof(_LPcmsTRANSFORM p, icTagSignature *ToTagPtr)
{
icTagSignature ProofTag;
- if (dwFlags & cmsFLAGS_SOFTPROOFING) {
+ if (p -> dwOriginalFlags & cmsFLAGS_SOFTPROOFING) {
// Apr-15, 2002 - Too much profiles does have bogus content
// on preview tag, so I do compute it by my own.
@@ -1142,7 +1194,7 @@ void CreateProof(_LPcmsTRANSFORM p,
// Aug-31, 2001 - Too much profiles does have bogus content
// on gamut tag, so I do compute it by my own.
- if ((dwFlags & cmsFLAGS_GAMUTCHECK) && (dwFlags & cmsFLAGS_NOTPRECALC)) {
+ if ((p -> dwOriginalFlags & cmsFLAGS_GAMUTCHECK) && (p -> dwOriginalFlags & cmsFLAGS_NOTPRECALC)) {
p -> Gamut = _cmsComputeGamutLUT(p->PreviewProfile, p ->Intent);
@@ -1175,8 +1227,7 @@ void CreateProof(_LPcmsTRANSFORM p,
// Choose the adequate transform routine
static
-_LPcmsTRANSFORM PickTransformRoutine(_LPcmsTRANSFORM p,
- LPDWORD dwFlagsPtr,
+_LPcmsTRANSFORM PickTransformRoutine(_LPcmsTRANSFORM p,
icTagSignature *FromTagPtr,
icTagSignature *ToTagPtr)
{
@@ -1193,17 +1244,17 @@ _LPcmsTRANSFORM PickTransformRoutine(_LPcmsTRANSFORM p,
else {
// Can we optimize matrix-shaper only transform?
- if (*FromTagPtr == 0 &&
- *ToTagPtr == 0 &&
- !p->PreviewProfile &&
- p -> Intent != INTENT_ABSOLUTE_COLORIMETRIC &&
+ if ((*FromTagPtr == 0) &&
+ (*ToTagPtr == 0) &&
+ (!p->PreviewProfile) &&
+ (p -> Intent != INTENT_ABSOLUTE_COLORIMETRIC) &&
(p -> EntryColorSpace == icSigRgbData) &&
- (p -> ExitColorSpace == icSigRgbData) &&
- !((*dwFlagsPtr) & cmsFLAGS_BLACKPOINTCOMPENSATION)) {
+ (p -> ExitColorSpace == icSigRgbData) &&
+ !(p -> dwOriginalFlags & cmsFLAGS_BLACKPOINTCOMPENSATION)) {
// Yes... try to smelt matrix-shapers
p -> xform = MatrixShaperXFORM;
- *dwFlagsPtr |= cmsFLAGS_NOTPRECALC;
+ p -> dwOriginalFlags |= cmsFLAGS_NOTPRECALC;
if (!cmsBuildSmeltMatShaper(p))
{
@@ -1300,22 +1351,25 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
p = AllocEmptyTransform();
if (p == NULL) return NULL;
- p -> xform = NormalXFORM;
- p -> Intent = nIntent;
- p -> ProofIntent = ProofingIntent;
- p -> DoGamutCheck = FALSE;
- p -> InputProfile = InputProfile;
- p -> OutputProfile = OutputProfile;
- p -> PreviewProfile = ProofingProfile;
- p -> InputFormat = InputFormat;
- p -> OutputFormat = OutputFormat;
- p -> lInputV4Lab = p ->lOutputV4Lab = FALSE;
+ p -> xform = NormalXFORM;
+ p -> Intent = nIntent;
+ p -> ProofIntent = ProofingIntent;
+ p -> DoGamutCheck = FALSE;
+ p -> InputProfile = InputProfile;
+ p -> OutputProfile = OutputProfile;
+ p -> PreviewProfile = ProofingProfile;
+ p -> InputFormat = InputFormat;
+ p -> OutputFormat = OutputFormat;
+ p -> dwOriginalFlags = dwFlags;
+
+ p -> lInputV4Lab = p ->lOutputV4Lab = FALSE;
+
p -> FromInput = _cmsIdentifyInputFormat(p, InputFormat);
p -> ToOutput = _cmsIdentifyOutputFormat(p, OutputFormat);
// Null transform can be done without profiles
- if ((dwFlags & cmsFLAGS_NULLTRANSFORM) ||
+ if ((p->dwOriginalFlags & cmsFLAGS_NULLTRANSFORM) ||
((InputProfile == NULL) &&
(OutputProfile == NULL))) {
@@ -1335,7 +1389,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
// Device link are means to store precalculated transform grids.
if (cmsGetDeviceClass(InputProfile) == icSigLinkClass) {
- return CreateDeviceLinkTransform(p, dwFlags);
+ return CreateDeviceLinkTransform(p);
}
if (!IsProperColorSpace(InputProfile, InputFormat, FALSE)) {
@@ -1365,9 +1419,8 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
return (cmsHTRANSFORM) p;
}
-
// Named color doesn't precalc anything
- dwFlags |= cmsFLAGS_NOTPRECALC;
+ p -> dwOriginalFlags |= cmsFLAGS_NOTPRECALC;
}
@@ -1415,7 +1468,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
// If proofing is needed, add required tags/parameters
if (ProofingProfile)
- CreateProof(p, dwFlags, &ToTag);
+ CreateProof(p, &ToTag);
if (!cmsIsTag(OutputProfile, ToTag)) {
@@ -1435,15 +1488,15 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
}
- if (dwFlags& cmsFLAGS_MATRIXINPUT)
+ if (p-> dwOriginalFlags & cmsFLAGS_MATRIXINPUT)
FromTag = (icTagSignature)0;
- if (dwFlags & cmsFLAGS_MATRIXOUTPUT)
+ if (p -> dwOriginalFlags & cmsFLAGS_MATRIXOUTPUT)
ToTag = (icTagSignature)0;
- if (PickTransformRoutine(p, &dwFlags, &FromTag, &ToTag) == NULL) {
+ if (PickTransformRoutine(p, &FromTag, &ToTag) == NULL) {
cmsDeleteTransform((cmsHTRANSFORM) p);
return NULL;
@@ -1452,8 +1505,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
TakeConversionRoutines(p, dwFlags & cmsFLAGS_BLACKPOINTCOMPENSATION);
-
- if (!(dwFlags & cmsFLAGS_NOTPRECALC)) {
+ if (!(p -> dwOriginalFlags & cmsFLAGS_NOTPRECALC)) {
LPLUT DeviceLink;
LPLUT GamutCheck = NULL;
@@ -1461,7 +1513,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
if (p ->EntryColorSpace == icSigCmykData &&
p ->ExitColorSpace == icSigCmykData &&
- dwFlags & cmsFLAGS_PRESERVEBLACK) {
+ (dwFlags & cmsFLAGS_PRESERVEBLACK)) {
DeviceLink = _cmsPrecalculateBlackPreservingDeviceLink((cmsHTRANSFORM) p, dwFlags);
@@ -1475,7 +1527,8 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
DeviceLink = _cmsPrecalculateDeviceLink((cmsHTRANSFORM) p, dwFlags);
}
- if (dwFlags & cmsFLAGS_GAMUTCHECK) {
+ // Allow to specify cmsFLAGS_GAMUTCHECK, even if no proofing profile is given
+ if ((p ->PreviewProfile != NULL) && (p -> dwOriginalFlags & cmsFLAGS_GAMUTCHECK)) {
GamutCheck = _cmsPrecalculateGamutCheck((cmsHTRANSFORM) p);
}
@@ -1483,7 +1536,6 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
// If input colorspace is Rgb, Cmy, then use tetrahedral interpolation
// for speed reasons (it only works well on spaces on Luma is diagonal, and
// not if luma is in separate channel)
-
if (p ->EntryColorSpace == icSigRgbData ||
p ->EntryColorSpace == icSigCmyData) {
@@ -1512,7 +1564,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
p ->DeviceLink = DeviceLink;
if ((nIntent != INTENT_ABSOLUTE_COLORIMETRIC) &&
- !(dwFlags & cmsFLAGS_NOWHITEONWHITEFIXUP))
+ !(p -> dwOriginalFlags & cmsFLAGS_NOWHITEONWHITEFIXUP))
_cmsFixWhiteMisalignment(p);
@@ -1529,7 +1581,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
}
- SetPrecalculatedTransform(p, dwFlags);
+ SetPrecalculatedTransform(p);
}
@@ -1538,6 +1590,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateProofingTransform(cmsHPROFILE InputProfile,
p -> FromInput = _cmsIdentifyInputFormat(p, InputFormat);
p -> ToOutput = _cmsIdentifyOutputFormat(p, OutputFormat);
+
return p;
}
@@ -1584,10 +1637,12 @@ void LCMSEXPORT cmsDeleteTransform(cmsHTRANSFORM hTransform)
cmsFreeMatShaper(p -> SmeltMatShaper);
if (p ->NamedColorList)
cmsFreeNamedColorList(p ->NamedColorList);
- if (p -> GamutCheck)
- cmsFreeLUT(p -> GamutCheck);
+ if (p -> GamutCheck)
+ cmsFreeLUT(p -> GamutCheck);
+
+ LCMS_FREE_LOCK(&p->rwlock);
- free((void *) p);
+ _cmsFree((void *) p);
}
@@ -1623,7 +1678,7 @@ void LCMSEXPORT cmsGetAlarmCodes(int *r, int *g, int *b)
// Returns TRUE if the profile is implemented as matrix-shaper
-BOOL LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile)
+LCMSBOOL LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile)
{
switch (cmsGetColorSpace(hProfile)) {
@@ -1647,7 +1702,7 @@ BOOL LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile)
}
-BOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile,
+LCMSBOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile,
int Intent, int UsedDirection)
{
@@ -1693,6 +1748,16 @@ int MultiprofileSampler(register WORD In[], register WORD Out[], register LPVOID
}
+static
+int IsAllowedInSingleXform(icProfileClassSignature aClass)
+{
+ return (aClass == icSigInputClass) ||
+ (aClass == icSigDisplayClass) ||
+ (aClass == icSigOutputClass) ||
+ (aClass == icSigColorSpaceClass);
+}
+
+
// A multiprofile transform does chain several profiles into a single
// devicelink. It couls also be used to merge named color profiles into
// a single database.
@@ -1721,6 +1786,23 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],
return NULL;
}
+ // There is a simple case with just two profiles, try to catch it in order of getting
+ // black preservation to work on this function, at least with two profiles.
+
+
+ if (nProfiles == 2) {
+
+ icProfileClassSignature Class1 = cmsGetDeviceClass(hProfiles[0]);
+ icProfileClassSignature Class2 = cmsGetDeviceClass(hProfiles[1]);
+
+ // Only input, output and display are allowed
+
+ if (IsAllowedInSingleXform(Class1) &&
+ IsAllowedInSingleXform(Class2))
+ return cmsCreateTransform(hProfiles[0], dwInput, hProfiles[1], dwOutput, Intent, dwFlags);
+ }
+
+
// Creates a phantom transform for latter filling
p = (_LPcmsTRANSFORM) cmsCreateTransform(NULL, dwInput,
NULL, dwOutput, Intent, cmsFLAGS_NULLTRANSFORM);
@@ -1883,7 +1965,7 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],
// All ok, store the newly created LUT
p -> DeviceLink = Grid;
- SetPrecalculatedTransform(p, dwFlags);
+ SetPrecalculatedTransform(p);
for (i=nProfiles-1; i >= 0; --i)
cmsDeleteTransform(Transforms[i]);
@@ -1892,6 +1974,14 @@ cmsHTRANSFORM LCMSEXPORT cmsCreateMultiprofileTransform(cmsHPROFILE hProfiles[],
if (hLab) cmsCloseProfile(hLab);
if (hXYZ) cmsCloseProfile(hXYZ);
+
+ if (p ->EntryColorSpace == icSigRgbData ||
+ p ->EntryColorSpace == icSigCmyData) {
+
+ p->DeviceLink -> CLut16params.Interp3D = cmsTetrahedralInterp16;
+ }
+
+
if ((Intent != INTENT_ABSOLUTE_COLORIMETRIC) &&
!(dwFlags & cmsFLAGS_NOWHITEONWHITEFIXUP))
_cmsFixWhiteMisalignment(p);
diff --git a/icc2ps/icc2ps.c b/icc2ps/icc2ps.c
index 7adac95..5bb7e69 100644..100755
--- a/icc2ps/icc2ps.c
+++ b/icc2ps/icc2ps.c
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2003 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -44,6 +44,8 @@ static int Intent = INTENT_PERCEPTUAL;
static FILE* OutFile;
static int BlackPointCompensation = FALSE;
static int Undecorated = FALSE;
+static int PrecalcMode = 1;
+static int NumOfGridPoints = 0;
static
void FatalError(const char *frm, ...)
@@ -66,7 +68,7 @@ void HandleSwitches(int argc, char *argv[])
{
int s;
- while ((s = xgetopt(argc,argv,"uUbBI:i:O:o:T:t:")) != EOF) {
+ while ((s = xgetopt(argc,argv,"uUbBI:i:O:o:T:t:c:C:n:N:")) != EOF) {
switch (s){
@@ -98,6 +100,22 @@ void HandleSwitches(int argc, char *argv[])
Undecorated = TRUE;
break;
+ case 'c':
+ case 'C':
+ PrecalcMode = atoi(xoptarg);
+ if (PrecalcMode < 0 || PrecalcMode > 2)
+ FatalError("ERROR: Unknown precalc mode '%d'", PrecalcMode);
+ break;
+
+
+ case 'n':
+ case 'N':
+ if (PrecalcMode != 1)
+ FatalError("Precalc mode already specified");
+ NumOfGridPoints = atoi(xoptarg);
+ break;
+
+
default:
FatalError("Unknown option - run without args to see valid ones.\n");
@@ -121,13 +139,15 @@ void Help(void)
fprintf(stderr, "%cb - Black point compensation (CRD only)\n", SW);
fprintf(stderr, "%cu - Do NOT generate resource name on CRD\n", SW);
-
+ fprintf(stderr, "%cc<0,1,2> - Precission (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only)\n", SW);
+ fprintf(stderr, "%cn<gridpoints> - Alternate way to set precission, number of CLUT points (CRD only)\n", SW);
+
fprintf(stderr, "\n");
fprintf(stderr, "This program is intended to be a demo of the little cms\n"
"engine. Both lcms and this program are freeware. You can\n"
"obtain both in source code at http://www.littlecms.com\n"
"For suggestions, comments, bug reports etc. send mail to\n"
- "marti@littlecms.com\n\n");
+ "info@littlecms.com\n\n");
exit(0);
}
@@ -142,13 +162,13 @@ void GenerateCSA(void)
n = cmsGetPostScriptCSA(hProfile, Intent, NULL, 0);
if (n == 0) return;
- Buffer = (char*) malloc(n + 1);
+ Buffer = (char*) _cmsMalloc(n + 1);
cmsGetPostScriptCSA(hProfile, Intent, Buffer, n);
Buffer[n] = 0;
fprintf(OutFile, "%s", Buffer);
- free(Buffer);
+ _cmsFree(Buffer);
cmsCloseProfile(hProfile);
}
@@ -164,15 +184,29 @@ void GenerateCRD(void)
if (BlackPointCompensation) dwFlags |= cmsFLAGS_BLACKPOINTCOMPENSATION;
if (Undecorated) dwFlags |= cmsFLAGS_NODEFAULTRESOURCEDEF;
+ switch (PrecalcMode) {
+
+ case 0: dwFlags |= cmsFLAGS_LOWRESPRECALC; break;
+ case 2: dwFlags |= cmsFLAGS_HIGHRESPRECALC; break;
+ case 1:
+ if (NumOfGridPoints > 0)
+ dwFlags |= cmsFLAGS_GRIDPOINTS(NumOfGridPoints);
+ break;
+
+ default: FatalError("ERROR: Unknown precalculation mode '%d'", PrecalcMode);
+ }
+
+
+
n = cmsGetPostScriptCRDEx(hProfile, Intent, dwFlags, NULL, 0);
if (n == 0) return;
- Buffer = (char*) malloc(n + 1);
+ Buffer = (char*) _cmsMalloc(n + 1);
cmsGetPostScriptCRDEx(hProfile, Intent, dwFlags, Buffer, n);
Buffer[n] = 0;
fprintf(OutFile, "%s", Buffer);
- free(Buffer);
+ _cmsFree(Buffer);
cmsCloseProfile(hProfile);
}
@@ -188,17 +222,21 @@ int MyErrorHandler(int ErrorCode, const char *ErrorText)
int main(int argc, char *argv[])
{
- int nargs;
+ int nargs;
- fprintf(stderr, "little cms PostScript converter - v1.4\n\n");
+ //fprintf(stderr, "little cms PostScript converter - v1.5+foo2zjs\n\n");
- HandleSwitches(argc, argv);
+ HandleSwitches(argc, argv);
cmsSetErrorHandler(MyErrorHandler);
nargs = (argc - xoptind);
- if (nargs != 0 && nargs != 1)
- Help();
+ if (nargs != 0 && nargs != 1)
+ {
+ fprintf(stderr,
+ "little cms PostScript converter - v1.5+v1.18beta1+foo2zjs\n\n");
+ Help();
+ }
if (nargs == 0)
OutFile = stdout;
diff --git a/icc2ps/icc34.h b/icc2ps/icc34.h
index 32718f3..735d96a 100644..100755
--- a/icc2ps/icc34.h
+++ b/icc2ps/icc34.h
@@ -147,9 +147,9 @@ authorization from SunSoft Inc.
#ifdef PACKAGE_NAME
/*
June 9, 2003, Adapted for use with configure by Bob Friesenhahn
- Added the stupid check for autoconf by Marti Maria
+ Added the stupid check for autoconf by Marti Maria.
+ PACKAGE_NAME is defined if autoconf is being used
*/
-typedef @INT32_T@ icSignature;
typedef @UINT8_T@ icUInt8Number;
typedef @UINT16_T@ icUInt16Number;
@@ -161,8 +161,6 @@ typedef @INT16_T@ icInt16Number;
typedef @INT32_T@ icInt32Number;
typedef @INT32_T@ icInt64Number[2];
-typedef icInt32Number icS15Fixed16Number;
-typedef icUInt32Number icU16Fixed16Number;
#else
/*
@@ -175,8 +173,6 @@ typedef icUInt32Number icU16Fixed16Number;
#include <inttypes.h>
-typedef int32_t icSignature;
-
typedef uint8_t icUInt8Number;
typedef uint16_t icUInt16Number;
typedef uint32_t icUInt32Number;
@@ -187,14 +183,10 @@ typedef int16_t icInt16Number;
typedef int32_t icInt32Number;
typedef int32_t icInt64Number[2];
-typedef icInt32Number icS15Fixed16Number;
-typedef icUInt32Number icU16Fixed16Number;
-
#else
#ifdef __sgi
#include "sgidefs.h"
-typedef __int32_t icSignature;
/*
* Number definitions
@@ -212,18 +204,18 @@ typedef short icInt16Number;
typedef __int32_t icInt32Number;
typedef __int32_t icInt64Number[2];
-/* Fixed numbers */
-typedef __int32_t icS15Fixed16Number;
-typedef __uint32_t icU16Fixed16Number;
#else
#if defined(__GNUC__) || defined(__unix__) || defined(__unix)
#include <sys/types.h>
-typedef int32_t icSignature;
+#if defined(__sun) || defined(__hpux) || defined (__MINGW) || defined(__MINGW32__)
+
+#if defined (__MINGW) || defined(__MINGW32__)
+#include <stdint.h>
+#endif
-#if defined(__sun) || defined(__hpux)
typedef uint8_t icUInt8Number;
typedef uint16_t icUInt16Number;
@@ -247,14 +239,9 @@ typedef int16_t icInt16Number;
typedef int32_t icInt32Number;
typedef int32_t icInt64Number[2];
-/* Fixed numbers */
-typedef icInt32Number icS15Fixed16Number;
-typedef icUInt32Number icU16Fixed16Number;
#else /* default definitions */
-typedef long icSignature;
-
/*
* Number definitions
*/
@@ -271,14 +258,19 @@ typedef short icInt16Number;
typedef long icInt32Number;
typedef long icInt64Number[2];
-/* Fixed numbers */
-typedef long icS15Fixed16Number;
-typedef unsigned long icU16Fixed16Number;
+
#endif /* default defs */
#endif
#endif
#endif
+/* Base types */
+
+typedef icInt32Number icSignature;
+typedef icInt32Number icS15Fixed16Number;
+typedef icUInt32Number icU16Fixed16Number;
+
+
/*------------------------------------------------------------------------*/
/* public tags and sizes */
typedef enum {
diff --git a/icc2ps/lcms.h b/icc2ps/lcms.h
index 3b1dc08..2c371a0 100644..100755
--- a/icc2ps/lcms.h
+++ b/icc2ps/lcms.h
@@ -1,6 +1,6 @@
//
// Little cms
-// Copyright (C) 1998-2005 Marti Maria
+// Copyright (C) 1998-2007 Marti Maria
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the "Software"),
@@ -20,7 +20,7 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-// Version 1.15
+// Version 1.18
#ifndef __cms_H
@@ -63,10 +63,35 @@
// Uncomment this if your compiler doesn't work with fast floor function
// #define USE_DEFAULT_FLOOR_CONVERSION 1
+// Uncomment this line on multithreading environments
+// #define USE_PTHREADS 1
+
+// Uncomment this line if you want lcms to use the black point tag in profile,
+// if commented, lcms will compute the black point by its own.
+// It is safer to leve it commented out
+// #define HONOR_BLACK_POINT_TAG 1
// ********** End of configuration toggles ******************************
-#define LCMS_VERSION 115
+#define LCMS_VERSION 117
+
+// Microsoft VisualC++
+
+// Deal with Microsoft's attempt at deprecating C standard runtime functions
+#ifdef _MSC_VER
+# undef NON_WINDOWS
+# if (_MSC_VER >= 1400)
+# ifndef _CRT_SECURE_NO_DEPRECATE
+# define _CRT_SECURE_NO_DEPRECATE 1
+# endif
+# endif
+#endif
+
+// Borland C
+
+#ifdef __BORLANDC__
+# undef NON_WINDOWS
+#endif
#include <stdio.h>
#include <stdlib.h>
@@ -76,27 +101,16 @@
#include <time.h>
// Metroworks CodeWarrior
-
#ifdef __MWERKS__
# define unlink remove
# if WIN32
# define USE_CUSTOM_SWAB 1
+# undef NON_WINDOWS
# else
# define NON_WINDOWS 1
# endif
#endif
-// Borland C
-
-#ifdef __BORLANDC__
-# undef NON_WINDOWS
-#endif
-
-// Microsoft VisualC++
-
-#ifdef _MSC_VER
-# undef NON_WINDOWS
-#endif
// Here comes the Non-Windows settings
@@ -104,6 +118,16 @@
// Non windows environments. Also avoid indentation on includes.
+#ifdef USE_PTHREADS
+# include <pthread.h>
+typedef pthread_rwlock_t LCMS_RWLOCK_T;
+# define LCMS_CREATE_LOCK(x) pthread_rwlock_init((x), NULL)
+# define LCMS_FREE_LOCK(x) pthread_rwlock_destroy((x))
+# define LCMS_READ_LOCK(x) pthread_rwlock_rdlock((x))
+# define LCMS_WRITE_LOCK(x) pthread_rwlock_wrlock((x))
+# define LCMS_UNLOCK(x) pthread_rwlock_unlock((x))
+#endif
+
#undef LCMS_DLL
#ifdef USE_ASSEMBLER
@@ -119,11 +143,17 @@
# define USE_BIG_ENDIAN 1
#endif
-#ifdef TARGET_CPU_PPC
+#if TARGET_CPU_PPC
# define USE_BIG_ENDIAN 1
#endif
-#ifdef macintosh
+#if macintosh
+# ifndef __LITTLE_ENDIAN__
+# define USE_BIG_ENDIAN 1
+# endif
+#endif
+
+#if __BIG_ENDIAN__
# define USE_BIG_ENDIAN 1
#endif
@@ -159,12 +189,9 @@
typedef unsigned char BYTE, *LPBYTE;
typedef unsigned short WORD, *LPWORD;
-typedef unsigned int DWORD, *LPDWORD;
-typedef int BOOL;
+typedef unsigned long DWORD, *LPDWORD;
typedef char *LPSTR;
typedef void *LPVOID;
-typedef void* LCMSHANDLE;
-
#define ZeroMemory(p,l) memset((p),0,(l))
#define CopyMemory(d,s,l) memcpy((d),(s),(l))
@@ -185,7 +212,9 @@ typedef void* LCMSHANDLE;
#define LOWORD(l) ((WORD)(l))
#define HIWORD(l) ((WORD)((DWORD)(l) >> 16))
-#define MAX_PATH (256)
+#ifndef MAX_PATH
+# define MAX_PATH (256)
+#endif
#define cdecl
#endif
@@ -204,8 +233,12 @@ typedef void* LCMSHANDLE;
#include <windows.h>
-typedef HANDLE LCMSHANDLE;
-
+#ifdef _WIN64
+# ifdef USE_ASSEMBLER
+# undef USE_ASSEMBLER
+# define USE_C 1
+# endif
+#endif
#ifdef USE_INT64
# ifndef LCMSULONGLONG
@@ -217,8 +250,30 @@ typedef HANDLE LCMSHANDLE;
// This works for both VC & BorlandC
#define LCMS_INLINE __inline
+#ifdef USE_PTHREADS
+typedef CRITICAL_SECTION LCMS_RWLOCK_T;
+# define LCMS_CREATE_LOCK(x) InitializeCriticalSection((x))
+# define LCMS_FREE_LOCK(x) DeleteCriticalSection((x))
+# define LCMS_READ_LOCK(x) EnterCriticalSection((x))
+# define LCMS_WRITE_LOCK(x) EnterCriticalSection((x))
+# define LCMS_UNLOCK(x) LeaveCriticalSection((x))
+#endif
+
#endif
+#ifndef USE_PTHREADS
+typedef int LCMS_RWLOCK_T;
+# define LCMS_CREATE_LOCK(x)
+# define LCMS_FREE_LOCK(x)
+# define LCMS_READ_LOCK(x)
+# define LCMS_WRITE_LOCK(x)
+# define LCMS_UNLOCK(x)
+#endif
+
+// Base types
+
+typedef int LCMSBOOL;
+typedef void* LCMSHANDLE;
#include "icc34.h" // ICC header file
@@ -245,16 +300,10 @@ typedef HANDLE LCMSHANDLE;
#define icSigMCHEData ((icColorSpaceSignature) 0x4d434845L) // MCHE
#define icSigMCHFData ((icColorSpaceSignature) 0x4d434846L) // MCHF
-#define icSigCAM97JABData ((icColorSpaceSignature) 0x4A616231L) // 'Jab1' H. Zeng
-#define icSigCAM02JABData ((icColorSpaceSignature) 0x4A616232L) // 'Jab2' H. Zeng
-#define icSigCAM02JCHData ((icColorSpaceSignature) 0x4A636A32L) // 'Jch2' H. Zeng
-
#define icSigChromaticityTag ((icTagSignature) 0x6368726dL) // As per Addendum 2 to Spec. ICC.1:1998-09
#define icSigChromaticAdaptationTag ((icTagSignature) 0x63686164L) // 'chad'
#define icSigColorantTableTag ((icTagSignature) 0x636c7274L) // 'clrt'
#define icSigColorantTableOutTag ((icTagSignature) 0x636c6f74L) // 'clot'
-#define icSigHPGamutDescTag ((icTagSignature) 0x676D7441L) // 'gmtA' H. Zeng
-
#define icSigParametricCurveType ((icTagTypeSignature) 0x70617261L) // parametric (ICC 4.0)
#define icSigMultiLocalizedUnicodeType ((icTagTypeSignature) 0x6D6C7563L)
@@ -263,7 +312,6 @@ typedef HANDLE LCMSHANDLE;
#define icSiglutAtoBType ((icTagTypeSignature) 0x6d414220L) // mAB
#define icSiglutBtoAType ((icTagTypeSignature) 0x6d424120L) // mBA
#define icSigColorantTableType ((icTagTypeSignature) 0x636c7274L) // clrt
-#define icSigHPGamutDescType ((icTagTypeSignature) 0x676D7441L) // gmtA H. Zeng
typedef struct {
@@ -361,9 +409,6 @@ extern "C" {
#ifndef itoa
# define itoa _itoa
#endif
-#ifndef filelength
-# define filelength _filelength
-#endif
#ifndef fileno
# define fileno _fileno
#endif
@@ -373,6 +418,14 @@ extern "C" {
#ifndef hypot
# define hypot _hypot
#endif
+#ifndef snprintf
+# define snprintf _snprintf
+#endif
+#ifndef vsnprintf
+# define vsnprintf _vsnprintf
+#endif
+
+
#endif
@@ -381,7 +434,7 @@ extern "C" {
#endif
#ifndef LOGE
-# define LOGE 0.434294481
+# define LOGE 0.4342944819
#endif
// ********** Little cms API ***************************************************
@@ -393,8 +446,9 @@ typedef LCMSHANDLE cmsHTRANSFORM;
// Format of pixel is defined by one DWORD, using bit fields as follows
//
-// TTTTT U Y F P X S EEE CCCC BBB
+// D TTTTT U Y F P X S EEE CCCC BBB
//
+// D: Use dither (8 bits only)
// T: Pixeltype
// F: Flavor 0=MinIsBlack(Chocolate) 1=MinIsWhite(Vanilla)
// P: Planar? 0=Chunky, 1=Planar
@@ -406,6 +460,7 @@ typedef LCMSHANDLE cmsHTRANSFORM;
// Y: Swap first - changes ABGR to BGRA and KCMY to CMYK
+#define DITHER_SH(s) ((s) << 22)
#define COLORSPACE_SH(s) ((s) << 16)
#define SWAPFIRST_SH(s) ((s) << 14)
#define FLAVOR_SH(s) ((s) << 13)
@@ -634,20 +689,20 @@ typedef LCMSHANDLE cmsHTRANSFORM;
typedef struct {
- unsigned int Crc32; // Has my table been touched?
+ unsigned int Crc32; // Has my table been touched?
- // Keep initial parameters for further serialization
+ // Keep initial parameters for further serialization
int Type;
double Params[10];
- } LCMSGAMMAPARAMS, FAR* LPLCMSGAMMAPARAMS;
+ } LCMSGAMMAPARAMS, FAR* LPLCMSGAMMAPARAMS;
// Gamma tables.
typedef struct {
- LCMSGAMMAPARAMS Birth; // Parameters used for table creation
+ LCMSGAMMAPARAMS Seed; // Parameters used for table creation
// Table-based representation follows
@@ -781,7 +836,7 @@ LCMSAPI LPcmsCIExyY LCMSEXPORT cmsD50_xyY(void);
LCMSAPI cmsHPROFILE LCMSEXPORT cmsOpenProfileFromFile(const char *ICCProfile, const char *sAccess);
LCMSAPI cmsHPROFILE LCMSEXPORT cmsOpenProfileFromMem(LPVOID MemPtr, DWORD dwSize);
-LCMSAPI BOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsCloseProfile(cmsHPROFILE hProfile);
// Predefined run-time profiles
@@ -792,10 +847,10 @@ LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateRGBProfile(LPcmsCIExyY WhitePoint,
LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateGrayProfile(LPcmsCIExyY WhitePoint,
LPGAMMATABLE TransferFunction);
-LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateLinearizationDeviceLink(icColorSpaceSignature ColorSpace,
+LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateLinearizationDeviceLink(icColorSpaceSignature ColorSpace,
LPGAMMATABLE TransferFunctions[]);
-LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateInkLimitingDeviceLink(icColorSpaceSignature ColorSpace,
+LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateInkLimitingDeviceLink(icColorSpaceSignature ColorSpace,
double Limit);
@@ -815,7 +870,7 @@ LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateBCHSWabstractProfile(int nLUTPoints,
int TempSrc,
int TempDest);
-LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateNULLProfile(void);
+LCMSAPI cmsHPROFILE LCMSEXPORT cmsCreateNULLProfile(void);
// Colorimetric space conversions
@@ -838,18 +893,18 @@ LCMSAPI double LCMSEXPORT cmsCIE2000DeltaE(LPcmsCIELab Lab1, LPcmsCIELab
LCMSAPI void LCMSEXPORT cmsClampLab(LPcmsCIELab Lab, double amax, double amin, double bmax, double bmin);
-LCMSAPI BOOL LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsWhitePointFromTemp(int TempK, LPcmsCIExyY WhitePoint);
-LCMSAPI BOOL LCMSEXPORT cmsAdaptToIlluminant(LPcmsCIEXYZ Result,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsAdaptToIlluminant(LPcmsCIEXYZ Result,
LPcmsCIEXYZ SourceWhitePt,
LPcmsCIEXYZ Illuminant,
LPcmsCIEXYZ Value);
-LCMSAPI BOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsBuildRGB2XYZtransferMatrix(LPMAT3 r,
LPcmsCIExyY WhitePoint,
LPcmsCIExyYTRIPLE Primaries);
-// CIECAM97s
+// Viewing conditions
#define AVG_SURROUND_4 0
#define AVG_SURROUND 1
@@ -872,6 +927,7 @@ typedef struct {
typedef cmsViewingConditions FAR* LPcmsViewingConditions;
+// CIECAM97s
LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM97sInit(LPcmsViewingConditions pVC2);
LCMSAPI void LCMSEXPORT cmsCIECAM97sDone(LCMSHANDLE hModel);
@@ -881,10 +937,10 @@ LCMSAPI void LCMSEXPORT cmsCIECAM97sReverse(LCMSHANDLE hModel, LPcmsJCh
// CIECAM02
-LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC);
-LCMSAPI void LCMSEXPORT cmsCIECAM02Done(LCMSHANDLE hModel);
-LCMSAPI void LCMSEXPORT cmsCIECAM02Forward(LCMSHANDLE hModel, LPcmsCIEXYZ pIn, LPcmsJCh pOut);
-LCMSAPI void LCMSEXPORT cmsCIECAM02Reverse(LCMSHANDLE hModel, LPcmsJCh pIn, LPcmsCIEXYZ pOut);
+LCMSAPI LCMSHANDLE LCMSEXPORT cmsCIECAM02Init(LPcmsViewingConditions pVC);
+LCMSAPI void LCMSEXPORT cmsCIECAM02Done(LCMSHANDLE hModel);
+LCMSAPI void LCMSEXPORT cmsCIECAM02Forward(LCMSHANDLE hModel, LPcmsCIEXYZ pIn, LPcmsJCh pOut);
+LCMSAPI void LCMSEXPORT cmsCIECAM02Reverse(LCMSHANDLE hModel, LPcmsJCh pIn, LPcmsCIEXYZ pOut);
// Gamma
@@ -898,7 +954,7 @@ LCMSAPI LPGAMMATABLE LCMSEXPORT cmsDupGamma(LPGAMMATABLE Src);
LCMSAPI LPGAMMATABLE LCMSEXPORT cmsReverseGamma(int nResultSamples, LPGAMMATABLE InGamma);
LCMSAPI LPGAMMATABLE LCMSEXPORT cmsJoinGamma(LPGAMMATABLE InGamma, LPGAMMATABLE OutGamma);
LCMSAPI LPGAMMATABLE LCMSEXPORT cmsJoinGammaEx(LPGAMMATABLE InGamma, LPGAMMATABLE OutGamma, int nPoints);
-LCMSAPI BOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsSmoothGamma(LPGAMMATABLE Tab, double lambda);
LCMSAPI double LCMSEXPORT cmsEstimateGamma(LPGAMMATABLE t);
LCMSAPI double LCMSEXPORT cmsEstimateGammaEx(LPWORD Table, int nEntries, double Thereshold);
LCMSAPI LPGAMMATABLE LCMSEXPORT cmsReadICCGamma(cmsHPROFILE hProfile, icTagSignature sig);
@@ -906,14 +962,14 @@ LCMSAPI LPGAMMATABLE LCMSEXPORT cmsReadICCGammaReversed(cmsHPROFILE hProfile, i
// Access to Profile data.
-LCMSAPI BOOL LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeMediaWhitePoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeMediaBlackPoint(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeIluminant(LPcmsCIEXYZ Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeColorants(LPcmsCIEXYZTRIPLE Dest, cmsHPROFILE hProfile);
LCMSAPI DWORD LCMSEXPORT cmsTakeHeaderFlags(cmsHPROFILE hProfile);
LCMSAPI DWORD LCMSEXPORT cmsTakeHeaderAttributes(cmsHPROFILE hProfile);
-LCMSAPI void LCMSEXPORT cmsSetLanguage(int LanguageCode, int CountryCode);
+LCMSAPI void LCMSEXPORT cmsSetLanguage(const char LanguageCode[4], const char CountryCode[4]);
LCMSAPI const char* LCMSEXPORT cmsTakeProductName(cmsHPROFILE hProfile);
LCMSAPI const char* LCMSEXPORT cmsTakeProductDesc(cmsHPROFILE hProfile);
LCMSAPI const char* LCMSEXPORT cmsTakeProductInfo(cmsHPROFILE hProfile);
@@ -922,16 +978,20 @@ LCMSAPI const char* LCMSEXPORT cmsTakeModel(cmsHPROFILE hProfile);
LCMSAPI const char* LCMSEXPORT cmsTakeCopyright(cmsHPROFILE hProfile);
LCMSAPI const BYTE* LCMSEXPORT cmsTakeProfileID(cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeCreationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeCalibrationDateTime(struct tm *Dest, cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIsTag(cmsHPROFILE hProfile, icTagSignature sig);
LCMSAPI int LCMSEXPORT cmsTakeRenderingIntent(cmsHPROFILE hProfile);
-LCMSAPI BOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t* len);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsTakeCharTargetData(cmsHPROFILE hProfile, char** Data, size_t* len);
+LCMSAPI int LCMSEXPORT cmsReadICCTextEx(cmsHPROFILE hProfile, icTagSignature sig, char *Text, size_t size);
LCMSAPI int LCMSEXPORT cmsReadICCText(cmsHPROFILE hProfile, icTagSignature sig, char *Text);
+
+#define LCMS_DESC_MAX 512
+
typedef struct {
icSignature deviceMfg;
@@ -939,8 +999,8 @@ typedef struct {
icUInt32Number attributes[2];
icTechnologySignature technology;
- char Manufacturer[512];
- char Model[512];
+ char Manufacturer[LCMS_DESC_MAX];
+ char Model[LCMS_DESC_MAX];
} cmsPSEQDESC, FAR *LPcmsPSEQDESC;
@@ -952,54 +1012,22 @@ typedef struct {
} cmsSEQ, FAR *LPcmsSEQ;
-LCMSAPI LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile);
-
-
-
-// Extended gamut tag -- an HP extension
-
-#define LCMSGAMUTMETHOD_SEGMENTMAXIMA 0
-#define LCMSGAMUTMETHOD_CONVEXHULL 1
-#define LCMSGAMUTMETHOD_ALPHASHAPE 2
-
-
-#define LCMSGAMUT_PHYSICAL 0
-#define LCMSGAMUT_HP1 1
-#define LCMSGAMUT_HP2 2
-
-typedef struct {
-
- icColorSpaceSignature CoordSig; // Gamut coordinates signature
- icUInt16Number Method; // Method used to generate gamut
- icUInt16Number Usage; // Gamut usage or intent
-
- char Description[512]; // Textual description
-
- cmsViewingConditions Vc; // The viewing conditions
-
- icUInt32Number Count; // Number of entries
- double Data[1]; // The current data
-
- } cmsGAMUTEX, FAR* LPcmsGAMUTEX;
-
-
-LCMSAPI LPcmsGAMUTEX LCMSEXPORT cmsReadExtendedGamut(cmsHPROFILE hProfile, int index);
-LCMSAPI void LCMSEXPORT cmsFreeExtendedGamut(LPcmsGAMUTEX gex);
-
-
+LCMSAPI LPcmsSEQ LCMSEXPORT cmsReadProfileSequenceDescription(cmsHPROFILE hProfile);
+LCMSAPI void LCMSEXPORT cmsFreeProfileSequenceDescription(LPcmsSEQ pseq);
// Translate form/to our notation to ICC
LCMSAPI icColorSpaceSignature LCMSEXPORT _cmsICCcolorSpace(int OurNotation);
-LCMSAPI int LCMSEXPORT _cmsLCMScolorSpace(icColorSpaceSignature ProfileSpace);
-LCMSAPI int LCMSEXPORT _cmsChannelsOf(icColorSpaceSignature ColorSpace);
-LCMSAPI BOOL LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile);
+LCMSAPI int LCMSEXPORT _cmsLCMScolorSpace(icColorSpaceSignature ProfileSpace);
+LCMSAPI int LCMSEXPORT _cmsChannelsOf(icColorSpaceSignature ColorSpace);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsIsMatrixShaper(cmsHPROFILE hProfile);
+// How profiles may be used
#define LCMS_USED_AS_INPUT 0
#define LCMS_USED_AS_OUTPUT 1
#define LCMS_USED_AS_PROOF 2
-LCMSAPI BOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, int Intent, int UsedDirection);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIsIntentSupported(cmsHPROFILE hProfile, int Intent, int UsedDirection);
LCMSAPI icColorSpaceSignature LCMSEXPORT cmsGetPCS(cmsHPROFILE hProfile);
LCMSAPI icColorSpaceSignature LCMSEXPORT cmsGetColorSpace(cmsHPROFILE hProfile);
@@ -1053,14 +1081,13 @@ LCMSAPI void LCMSEXPORT cmsSetProfileID(cmsHPROFILE hProfile, LPBYTE Pr
#define cmsFLAGS_GAMUTCHECK 0x1000 // Out of Gamut alarm
#define cmsFLAGS_SOFTPROOFING 0x4000 // Do softproofing
-
-// Black preservation
+// Black preservation
#define cmsFLAGS_PRESERVEBLACK 0x8000
-
+
// CRD special
-#define cmsFLAGS_NODEFAULTRESOURCEDEF 0x00010000
+#define cmsFLAGS_NODEFAULTRESOURCEDEF 0x01000000
// Gridpoints
@@ -1110,6 +1137,13 @@ LCMSAPI void LCMSEXPORT cmsGetAlarmCodes(int *r, int *g, int *b);
LCMSAPI double LCMSEXPORT cmsSetAdaptationState(double d);
+// Primary preservation strategy
+
+#define LCMS_PRESERVE_PURE_K 0
+#define LCMS_PRESERVE_K_PLANE 1
+
+LCMSAPI int LCMSEXPORT cmsSetCMYKPreservationStrategy(int n);
+
// Named color support
typedef struct {
char Name[MAX_PATH];
@@ -1132,9 +1166,9 @@ typedef struct {
// Named color support
-LCMSAPI int LCMSEXPORT cmsNamedColorCount(cmsHTRANSFORM xform);
-LCMSAPI BOOL LCMSEXPORT cmsNamedColorInfo(cmsHTRANSFORM xform, int nColor, char* Name, char* Prefix, char* Suffix);
-LCMSAPI int LCMSEXPORT cmsNamedColorIndex(cmsHTRANSFORM xform, const char* Name);
+LCMSAPI int LCMSEXPORT cmsNamedColorCount(cmsHTRANSFORM xform);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsNamedColorInfo(cmsHTRANSFORM xform, int nColor, char* Name, char* Prefix, char* Suffix);
+LCMSAPI int LCMSEXPORT cmsNamedColorIndex(cmsHTRANSFORM xform, const char* Name);
// Colorant tables
@@ -1142,7 +1176,7 @@ LCMSAPI LPcmsNAMEDCOLORLIST LCMSEXPORT cmsReadColorantTable(cmsHPROFILE hProfile
// Profile creation
-LCMSAPI BOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, void* data);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsAddTag(cmsHPROFILE hProfile, icTagSignature sig, const void* data);
// Converts a transform to a devicelink profile
LCMSAPI cmsHPROFILE LCMSEXPORT cmsTransform2DeviceLink(cmsHTRANSFORM hTransform, DWORD dwFlags);
@@ -1152,8 +1186,8 @@ LCMSAPI void LCMSEXPORT _cmsSetLUTdepth(cmsHPROFILE hProfile, int depth);
// Save profile
-LCMSAPI BOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName);
-LCMSAPI BOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsSaveProfile(cmsHPROFILE hProfile, const char* FileName);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsSaveProfileToMem(cmsHPROFILE hProfile, void *MemPtr,
size_t* BytesNeeded);
@@ -1198,6 +1232,7 @@ LCMSAPI double LCMSEXPORT cmsEvalLUTreverse(LPLUT Lut, WORD Target[], WORD Resul
LCMSAPI LPLUT LCMSEXPORT cmsReadICCLut(cmsHPROFILE hProfile, icTagSignature sig);
LCMSAPI LPLUT LCMSEXPORT cmsDupLUT(LPLUT Orig);
+
// LUT Sampling
typedef int (* _cmsSAMPLER)(register WORD In[],
@@ -1237,35 +1272,37 @@ LCMSAPI int LCMSEXPORT cmsIT8SetTable(LCMSHANDLE IT8, int nTable);
// Persistence
LCMSAPI LCMSHANDLE LCMSEXPORT cmsIT8LoadFromFile(const char* cFileName);
LCMSAPI LCMSHANDLE LCMSEXPORT cmsIT8LoadFromMem(void *Ptr, size_t len);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE IT8, const char* cFileName);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeeded);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SaveToFile(LCMSHANDLE IT8, const char* cFileName);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SaveToMem(LCMSHANDLE hIT8, void *MemPtr, size_t* BytesNeeded);
// Properties
LCMSAPI const char* LCMSEXPORT cmsIT8GetSheetType(LCMSHANDLE hIT8);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetSheetType(LCMSHANDLE hIT8, const char* Type);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* cComment);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetComment(LCMSHANDLE hIT8, const char* cComment);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* cProp, const char *Str);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val);
-
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyStr(LCMSHANDLE hIT8, const char* cProp, const char *Str);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyDbl(LCMSHANDLE hIT8, const char* cProp, double Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyHex(LCMSHANDLE hIT8, const char* cProp, int Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char* cSubProp, const char *Val);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetPropertyUncooked(LCMSHANDLE hIT8, const char* Key, const char* Buffer);
LCMSAPI const char* LCMSEXPORT cmsIT8GetProperty(LCMSHANDLE hIT8, const char* cProp);
LCMSAPI double LCMSEXPORT cmsIT8GetPropertyDbl(LCMSHANDLE hIT8, const char* cProp);
-LCMSAPI int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE IT8, char ***PropertyNames);
+LCMSAPI const char* LCMSEXPORT cmsIT8GetPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char *cSubProp);
+LCMSAPI int LCMSEXPORT cmsIT8EnumProperties(LCMSHANDLE hIT8, const char ***PropertyNames);
+LCMSAPI int LCMSEXPORT cmsIT8EnumPropertyMulti(LCMSHANDLE hIT8, const char* cProp, const char*** SubpropertyNames);
// Datasets
LCMSAPI const char* LCMSEXPORT cmsIT8GetDataRowCol(LCMSHANDLE IT8, int row, int col);
LCMSAPI double LCMSEXPORT cmsIT8GetDataRowColDbl(LCMSHANDLE IT8, int row, int col);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataRowCol(LCMSHANDLE hIT8, int row, int col,
const char* Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataRowColDbl(LCMSHANDLE hIT8, int row, int col,
double Val);
LCMSAPI const char* LCMSEXPORT cmsIT8GetData(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
@@ -1273,25 +1310,28 @@ LCMSAPI const char* LCMSEXPORT cmsIT8GetData(LCMSHANDLE IT8, const char* cPa
LCMSAPI double LCMSEXPORT cmsIT8GetDataDbl(LCMSHANDLE IT8, const char* cPatch, const char* cSample);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE IT8, const char* cPatch,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetData(LCMSHANDLE IT8, const char* cPatch,
const char* cSample,
const char *Val);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataDbl(LCMSHANDLE hIT8, const char* cPatch,
const char* cSample,
double Val);
LCMSAPI int LCMSEXPORT cmsIT8GetDataFormat(LCMSHANDLE hIT8, const char* cSample);
-LCMSAPI BOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE IT8, int n, const char *Sample);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetDataFormat(LCMSHANDLE IT8, int n, const char *Sample);
LCMSAPI int LCMSEXPORT cmsIT8EnumDataFormat(LCMSHANDLE IT8, char ***SampleNames);
LCMSAPI const char* LCMSEXPORT cmsIT8GetPatchName(LCMSHANDLE hIT8, int nPatch, char* buffer);
+LCMSAPI int LCMSEXPORT cmsIT8GetPatchByName(LCMSHANDLE hIT8, const char *cSample);
// The LABEL extension
LCMSAPI int LCMSEXPORT cmsIT8SetTableByLabel(LCMSHANDLE hIT8, const char* cSet, const char* cField, const char* ExpectedType);
+LCMSAPI LCMSBOOL LCMSEXPORT cmsIT8SetIndexColumn(LCMSHANDLE hIT8, const char* cSample);
+
// Formatter for double
LCMSAPI void LCMSEXPORT cmsIT8DefineDblFormat(LCMSHANDLE IT8, const char* Formatter);
@@ -1317,15 +1357,16 @@ LCMSAPI void LCMSEXPORT cmsFloat2XYZEncoded(WORD XYZ[3], const cmsCIEXY
// Profiling Extensions --- Would be removed from API in future revisions
-LCMSAPI BOOL LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile, icTagSignature sig, const char* Text);
-LCMSAPI BOOL LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* XYZ);
-LCMSAPI BOOL LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile, icTagSignature sig, void* lut);
-LCMSAPI BOOL LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMMATABLE TransferFunction);
-LCMSAPI BOOL LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIExyYTRIPLE Chrm);
-LCMSAPI BOOL LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsSEQ PSeq);
-LCMSAPI BOOL LCMSEXPORT _cmsAddNamedColorTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
-LCMSAPI BOOL LCMSEXPORT _cmsAddDateTimeTag(cmsHPROFILE hProfile, icTagSignature sig, struct tm *DateTime);
-LCMSAPI BOOL LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddTextTag(cmsHPROFILE hProfile, icTagSignature sig, const char* Text);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddXYZTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* XYZ);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddLUTTag(cmsHPROFILE hProfile, icTagSignature sig, const void* lut);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddGammaTag(cmsHPROFILE hProfile, icTagSignature sig, LPGAMMATABLE TransferFunction);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddChromaticityTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsCIExyYTRIPLE Chrm);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddSequenceDescriptionTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsSEQ PSeq);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddNamedColorTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddDateTimeTag(cmsHPROFILE hProfile, icTagSignature sig, struct tm *DateTime);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSignature sig, LPcmsNAMEDCOLORLIST nc);
+LCMSAPI LCMSBOOL LCMSEXPORT _cmsAddChromaticAdaptationTag(cmsHPROFILE hProfile, icTagSignature sig, const cmsCIEXYZ* mat);
// --------------------------------------------------------------------------------------------------- Inline functions
@@ -1336,7 +1377,7 @@ LCMSAPI BOOL LCMSEXPORT _cmsAddColorantTableTag(cmsHPROFILE hProfile, icTagSigna
LCMS_INLINE int _cmsQuickFloor(double val)
{
-#if USE_DEFAULT_FLOOR_CONVERSION
+#ifdef USE_DEFAULT_FLOOR_CONVERSION
return (int) floor(val);
#else
const double _lcms_double2fixmagic = 68719476736.0 * 1.5; // 2^36 * 1.5, (52-16=36) uses limited precision to floor
@@ -1348,7 +1389,7 @@ LCMS_INLINE int _cmsQuickFloor(double val)
temp.val = val + _lcms_double2fixmagic;
-#if USE_BIG_ENDIAN
+#ifdef USE_BIG_ENDIAN
return temp.halves[1] >> 16;
#else
return temp.halves[0] >> 16;
@@ -1367,6 +1408,34 @@ LCMS_INLINE WORD _cmsClampWord(int in)
return (WORD) in;
}
+#ifndef LCMS_USER_ALLOC
+
+// Low-level alloc hook
+
+LCMS_INLINE void* _cmsMalloc(size_t size)
+{
+ if (size > ((size_t) 1024*1024*500)) return NULL; // Never allow over 500Mb
+ if (size < 0) return NULL; // Prevent signed size_t exploits
+
+ return (void*) malloc(size);
+}
+
+LCMS_INLINE void* _cmsCalloc(size_t nmemb, size_t size)
+{
+ size_t alloc = nmemb * size;
+ if (alloc < nmemb || alloc < size) {
+ return NULL;
+ }
+ return _cmsMalloc(alloc);
+}
+
+LCMS_INLINE void _cmsFree(void *Ptr)
+{
+ if (Ptr) free(Ptr);
+}
+
+#endif
+
// ------------------------------------------------------------------------------------------- end of inline functions
// Signal error from inside lcms code
@@ -1443,36 +1512,36 @@ typedef struct { // Matrix (Fixed 15.16)
-void cdecl VEC3init(LPVEC3 r, double x, double y, double z); // double version
-void cdecl VEC3initF(LPWVEC3 r, double x, double y, double z); // Fix32 version
-void cdecl VEC3toFix(LPWVEC3 r, LPVEC3 v);
-void cdecl VEC3fromFix(LPVEC3 r, LPWVEC3 v);
-void cdecl VEC3scaleFix(LPWORD r, LPWVEC3 Scale);
-void cdecl VEC3swap(LPVEC3 a, LPVEC3 b);
-void cdecl VEC3divK(LPVEC3 r, LPVEC3 v, double d);
-void cdecl VEC3perK(LPVEC3 r, LPVEC3 v, double d);
-void cdecl VEC3minus(LPVEC3 r, LPVEC3 a, LPVEC3 b);
-void cdecl VEC3perComp(LPVEC3 r, LPVEC3 a, LPVEC3 b);
-BOOL cdecl VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance);
-BOOL cdecl VEC3equalF(LPVEC3 a, LPVEC3 b, double Tolerance);
-void cdecl VEC3scaleAndCut(LPWVEC3 r, LPVEC3 v, double d);
-void cdecl VEC3cross(LPVEC3 r, LPVEC3 u, LPVEC3 v);
-void cdecl VEC3saturate(LPVEC3 v);
-double cdecl VEC3distance(LPVEC3 a, LPVEC3 b);
-double cdecl VEC3length(LPVEC3 a);
-
-void cdecl MAT3identity(LPMAT3 a);
-void cdecl MAT3per(LPMAT3 r, LPMAT3 a, LPMAT3 b);
-void cdecl MAT3perK(LPMAT3 r, LPMAT3 v, double d);
-int cdecl MAT3inverse(LPMAT3 a, LPMAT3 b);
-BOOL cdecl MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b);
-double cdecl MAT3det(LPMAT3 m);
-void cdecl MAT3eval(LPVEC3 r, LPMAT3 a, LPVEC3 v);
-void cdecl MAT3toFix(LPWMAT3 r, LPMAT3 v);
-void cdecl MAT3fromFix(LPMAT3 r, LPWMAT3 v);
-void cdecl MAT3evalW(LPWVEC3 r, LPWMAT3 a, LPWVEC3 v);
-BOOL cdecl MAT3isIdentity(LPWMAT3 a, double Tolerance);
-void cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
+void cdecl VEC3init(LPVEC3 r, double x, double y, double z); // double version
+void cdecl VEC3initF(LPWVEC3 r, double x, double y, double z); // Fix32 version
+void cdecl VEC3toFix(LPWVEC3 r, LPVEC3 v);
+void cdecl VEC3fromFix(LPVEC3 r, LPWVEC3 v);
+void cdecl VEC3scaleFix(LPWORD r, LPWVEC3 Scale);
+void cdecl VEC3swap(LPVEC3 a, LPVEC3 b);
+void cdecl VEC3divK(LPVEC3 r, LPVEC3 v, double d);
+void cdecl VEC3perK(LPVEC3 r, LPVEC3 v, double d);
+void cdecl VEC3minus(LPVEC3 r, LPVEC3 a, LPVEC3 b);
+void cdecl VEC3perComp(LPVEC3 r, LPVEC3 a, LPVEC3 b);
+LCMSBOOL cdecl VEC3equal(LPWVEC3 a, LPWVEC3 b, double Tolerance);
+LCMSBOOL cdecl VEC3equalF(LPVEC3 a, LPVEC3 b, double Tolerance);
+void cdecl VEC3scaleAndCut(LPWVEC3 r, LPVEC3 v, double d);
+void cdecl VEC3cross(LPVEC3 r, LPVEC3 u, LPVEC3 v);
+void cdecl VEC3saturate(LPVEC3 v);
+double cdecl VEC3distance(LPVEC3 a, LPVEC3 b);
+double cdecl VEC3length(LPVEC3 a);
+
+void cdecl MAT3identity(LPMAT3 a);
+void cdecl MAT3per(LPMAT3 r, LPMAT3 a, LPMAT3 b);
+void cdecl MAT3perK(LPMAT3 r, LPMAT3 v, double d);
+int cdecl MAT3inverse(LPMAT3 a, LPMAT3 b);
+LCMSBOOL cdecl MAT3solve(LPVEC3 x, LPMAT3 a, LPVEC3 b);
+double cdecl MAT3det(LPMAT3 m);
+void cdecl MAT3eval(LPVEC3 r, LPMAT3 a, LPVEC3 v);
+void cdecl MAT3toFix(LPWMAT3 r, LPMAT3 v);
+void cdecl MAT3fromFix(LPMAT3 r, LPWMAT3 v);
+void cdecl MAT3evalW(LPWVEC3 r, LPWMAT3 a, LPWVEC3 v);
+LCMSBOOL cdecl MAT3isIdentity(LPWMAT3 a, double Tolerance);
+void cdecl MAT3scaleAndCut(LPWMAT3 r, LPMAT3 v, double d);
// Is a table linear?
@@ -1520,7 +1589,7 @@ typedef struct _lcms_l16params_struc { // Used on 16 bits interpolations
void cdecl cmsCalcL16Params(int nSamples, LPL16PARAMS p);
void cdecl cmsCalcCLUT16Params(int nSamples, int InputChan, int OutputChan, LPL16PARAMS p);
void cdecl cmsCalcCLUT16ParamsEx(int nSamples, int InputChan, int OutputChan,
- BOOL lUseTetrahedral, LPL16PARAMS p);
+ LCMSBOOL lUseTetrahedral, LPL16PARAMS p);
WORD cdecl cmsLinearInterpLUT16(WORD Value, WORD LutTable[], LPL16PARAMS p);
Fixed32 cdecl cmsLinearInterpFixed(WORD Value1, WORD LutTable[], LPL16PARAMS p);
@@ -1604,18 +1673,18 @@ struct _lcms_LUT_struc {
// Gray axes fixup. Only on v2 8-bit Lab LUT
- BOOL FixGrayAxes;
+ LCMSBOOL FixGrayAxes;
- // Parameters used for curve creation
+ // Parameters used for curve creation
- LCMSGAMMAPARAMS LCurvesBirth[4][MAXCHANNELS];
+ LCMSGAMMAPARAMS LCurvesSeed[4][MAXCHANNELS];
}; // LUT, FAR* LPLUT;
-BOOL cdecl _cmsSmoothEndpoints(LPWORD Table, int nEntries);
+LCMSBOOL cdecl _cmsSmoothEndpoints(LPWORD Table, int nEntries);
// CRC of gamma tables
@@ -1633,7 +1702,7 @@ LPGAMMATABLE cdecl cmsConvertSampledCurveToGamma(LPSAMPLEDCURVE Sampled, doubl
void cdecl cmsEndpointsOfSampledCurve(LPSAMPLEDCURVE p, double* Min, double* Max);
void cdecl cmsClampSampledCurve(LPSAMPLEDCURVE p, double Min, double Max);
-BOOL cdecl cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double SmoothingLambda);
+LCMSBOOL cdecl cmsSmoothSampledCurve(LPSAMPLEDCURVE Tab, double SmoothingLambda);
void cdecl cmsRescaleSampledCurve(LPSAMPLEDCURVE p, double Min, double Max, int nPoints);
LPSAMPLEDCURVE cdecl cmsJoinSampledCurves(LPSAMPLEDCURVE X, LPSAMPLEDCURVE Y, int nResultingPoints);
@@ -1667,19 +1736,19 @@ LPMATSHAPER cdecl cmsAllocMatShaper2(LPMAT3 matrix, LPGAMMATABLE In[], LPGAMMATA
void cdecl cmsFreeMatShaper(LPMATSHAPER MatShaper);
void cdecl cmsEvalMatShaper(LPMATSHAPER MatShaper, WORD In[], WORD Out[]);
-BOOL cdecl cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile);
+LCMSBOOL cdecl cmsReadICCMatrixRGB2XYZ(LPMAT3 r, cmsHPROFILE hProfile);
-LPMATSHAPER cdecl cmsBuildInputMatrixShaper(cmsHPROFILE InputProfile);
-LPMATSHAPER cdecl cmsBuildOutputMatrixShaper(cmsHPROFILE OutputProfile);
+LPMATSHAPER cdecl cmsBuildInputMatrixShaper(cmsHPROFILE InputProfile);
+LPMATSHAPER cdecl cmsBuildOutputMatrixShaper(cmsHPROFILE OutputProfile);
// White Point & Primary chromas handling
-BOOL cdecl cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcmsCIEXYZ ToIll);
-BOOL cdecl cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt);
-BOOL cdecl cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt);
+LCMSBOOL cdecl cmsAdaptationMatrix(LPMAT3 r, LPMAT3 ConeMatrix, LPcmsCIEXYZ FromIll, LPcmsCIEXYZ ToIll);
+LCMSBOOL cdecl cmsAdaptMatrixToD50(LPMAT3 r, LPcmsCIExyY SourceWhitePt);
+LCMSBOOL cdecl cmsAdaptMatrixFromD50(LPMAT3 r, LPcmsCIExyY DestWhitePt);
-BOOL cdecl cmsReadChromaticAdaptationMatrix(LPMAT3 r, cmsHPROFILE hProfile);
+LCMSBOOL cdecl cmsReadChromaticAdaptationMatrix(LPMAT3 r, cmsHPROFILE hProfile);
// Inter-PCS conversion routines. They assume D50 as white point.
void cdecl cmsXYZ2LabEncoded(WORD XYZ[3], WORD Lab[3]);
@@ -1694,7 +1763,7 @@ WORD cdecl _cmsQuantizeVal(double i, int MaxSamples);
LPcmsNAMEDCOLORLIST cdecl cmsAllocNamedColorList(int n);
int cdecl cmsReadICCnamedColorList(cmsHTRANSFORM xform, cmsHPROFILE hProfile, icTagSignature sig);
void cdecl cmsFreeNamedColorList(LPcmsNAMEDCOLORLIST List);
-BOOL cdecl cmsAppendNamedColor(cmsHTRANSFORM xform, const char* Name, WORD PCS[3], WORD Colorant[MAXCHANNELS]);
+LCMSBOOL cdecl cmsAppendNamedColor(cmsHTRANSFORM xform, const char* Name, WORD PCS[3], WORD Colorant[MAXCHANNELS]);
// I/O
@@ -1716,7 +1785,7 @@ typedef struct _lcms_iccprofile_struct {
icColorSpaceSignature PCS;
icRenderingIntent RenderingIntent;
icUInt32Number flags;
- icUInt32Number attributes;
+ icUInt32Number attributes;
cmsCIEXYZ Illuminant;
// Additions for V4 profiles
@@ -1738,22 +1807,22 @@ typedef struct _lcms_iccprofile_struct {
char PhysicalFile[MAX_PATH];
- BOOL IsWrite;
- BOOL SaveAs8Bits;
+ LCMSBOOL IsWrite;
+ LCMSBOOL SaveAs8Bits;
struct tm Created;
// I/O handlers
- size_t (* Read)(void *buffer, size_t size, size_t count, struct _lcms_iccprofile_struct* Icc);
+ size_t (* Read)(void *buffer, size_t size, size_t count, struct _lcms_iccprofile_struct* Icc);
- BOOL (* Seek)(struct _lcms_iccprofile_struct* Icc, size_t offset);
- BOOL (* Close)(struct _lcms_iccprofile_struct* Icc);
- size_t (* Tell)(struct _lcms_iccprofile_struct* Icc);
+ LCMSBOOL (* Seek)(struct _lcms_iccprofile_struct* Icc, size_t offset);
+ LCMSBOOL (* Close)(struct _lcms_iccprofile_struct* Icc);
+ size_t (* Tell)(struct _lcms_iccprofile_struct* Icc);
// Writting
- BOOL (* Write)(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr);
+ LCMSBOOL (* Write)(struct _lcms_iccprofile_struct* Icc, size_t size, LPVOID Ptr);
size_t UsedSpace;
@@ -1765,7 +1834,7 @@ typedef struct _lcms_iccprofile_struct {
cmsHPROFILE cdecl _cmsCreateProfilePlaceholder(void);
// Search into tag dictionary
-icInt32Number cdecl _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, BOOL lSignalError);
+icInt32Number cdecl _cmsSearchTag(LPLCMSICCPROFILE Profile, icTagSignature sig, LCMSBOOL lSignalError);
// Search for a particular tag, replace if found or add new one else
LPVOID _cmsInitTag(LPLCMSICCPROFILE Icc, icTagSignature sig, size_t size, const void* Init);
@@ -1781,6 +1850,7 @@ void _cmsSetSaveToMemory(LPLCMSICCPROFILE Icc, LPVOID MemPtr, size_t dwSize);
// These macros unpack format specifiers into integers
+#define T_DITHER(s) (((s)>>22)&1)
#define T_COLORSPACE(s) (((s)>>16)&31)
#define T_SWAPFIRST(s) (((s)>>14)&1)
#define T_FLAVOR(s) (((s)>>13)&1)
@@ -1834,6 +1904,8 @@ typedef struct _cmstransform_struct {
icColorSpaceSignature EntryColorSpace;
icColorSpaceSignature ExitColorSpace;
+
+ DWORD dwOriginalFlags; // Flags as specified by user
WMAT3 m1, m2; // Matrix holding inter PCS operation
WVEC3 of1, of2; // Offset terms
@@ -1865,7 +1937,6 @@ typedef struct _cmstransform_struct {
LPMATSHAPER OutMatShaper;
LPMATSHAPER SmeltMatShaper;
-
// Phase of Lab/XYZ, Abs/Rel
int Phase1, Phase2, Phase3;
@@ -1876,16 +1947,17 @@ typedef struct _cmstransform_struct {
// Flag for transform involving v4 profiles
- BOOL lInputV4Lab, lOutputV4Lab;
+ LCMSBOOL lInputV4Lab, lOutputV4Lab;
+
// 1-pixel cache
WORD CacheIn[MAXCHANNELS];
WORD CacheOut[MAXCHANNELS];
-
double AdaptationState; // Figure for v4 incomplete state of adaptation
+ LCMS_RWLOCK_T rwlock;
} _cmsTRANSFORM,FAR *_LPcmsTRANSFORM;
@@ -1922,7 +1994,7 @@ int cdecl cmsChooseCnvrt(int Absolute,
// Clamping & Gamut handling
-BOOL cdecl _cmsEndPointsBySpace(icColorSpaceSignature Space,
+LCMSBOOL cdecl _cmsEndPointsBySpace(icColorSpaceSignature Space,
WORD **White, WORD **Black, int *nOutputs);
WORD * cdecl _cmsWhiteBySpace(icColorSpaceSignature Space);
@@ -1951,7 +2023,7 @@ LPLUT _cmsPrecalculateBlackPreservingDeviceLink(cmsHTRANSFORM hCMYK2CMYK, DWORD
LPLUT cdecl _cmsPrecalculateGamutCheck(cmsHTRANSFORM h);
// Hot fixes bad profiles
-BOOL cdecl _cmsFixWhiteMisalignment(_LPcmsTRANSFORM p);
+LCMSBOOL cdecl _cmsFixWhiteMisalignment(_LPcmsTRANSFORM p);
// Marks LUT as 8 bit on input
LPLUT cdecl _cmsBlessLUT8(LPLUT Lut);
@@ -1969,6 +2041,10 @@ void cdecl _cmsComputePrelinearizationTablesFromXFORM(cmsHTRANSFORM h[], int nTr
// Build a tone curve for K->K' if possible (only works on CMYK)
LPGAMMATABLE _cmsBuildKToneCurve(cmsHTRANSFORM hCMYK2CMYK, int nPoints);
+// Validates a LUT
+LCMSBOOL cdecl _cmsValidateLUT(LPLUT NewLUT);
+
+
// These are two VITAL macros, from converting between 8 and 16 bit
// representation.
diff --git a/includer-man b/includer-man
new file mode 100755
index 0000000..0f04d44
--- /dev/null
+++ b/includer-man
@@ -0,0 +1,131 @@
+#!/bin/sh
+
+PROGNAME="$0"
+
+usage() {
+ cat <<EOF
+NAME
+ `basename $PROGNAME` - CPP replacement
+
+SYNOPSIS
+ `basename $PROGNAME` [options] file
+
+DESCRIPTION
+ CPP replacement.
+
+ Handles:
+ #include "file"
+ #ifdef symbol
+ #ifndef symbol
+ #endif
+
+OPTIONS
+ -v DEFn=symbol Symbol is defined, n = 1, ... 9.
+ i.e. -v DEF1=groff is equivalent to:
+ #define groff 1
+ -D lvl Debug level
+EOF
+
+ exit 1
+}
+
+#
+# Report an error and exit
+#
+error() {
+ echo "`basename $PROGNAME`: $1" >&2
+ exit 1
+}
+
+debug() {
+ if [ $DEBUG -ge $1 ]; then
+ echo "`basename $PROGNAME`: $2" >&2
+ fi
+}
+
+#
+# Process the options
+#
+DEBUG=0
+VARS=""
+while getopts "v:D:h?" opt
+do
+ case $opt in
+ v) VARS="$VARS -v $OPTARG";;
+ D) DEBUG="$OPTARG";;
+ h|\?) usage;;
+ esac
+done
+shift `expr $OPTIND - 1`
+
+#
+# Main Program
+#
+if [ -x /opt/sfw/bin/gawk ]; then
+ AWK=/opt/sfw/bin/gawk
+else
+ AWK=awk
+fi
+
+$AWK $VARS '
+function do1(file, i) {
+ if (nfiles++ == 0)
+ {
+ print comment " t"
+ print comment
+ print comment " DO NOT EDIT! This file is generated from " file
+ print comment
+ }
+ while ((getline < file) > 0)
+ {
+ split($0, a)
+ if (a[1] == "#include")
+ {
+ gsub(/"/, "", a[2])
+ print comment
+ do1(a[2])
+ }
+ else if (a[1] == "#define")
+ {
+ def[a[2]] = 1
+ print comment
+ }
+ else if (a[1] == "#ifdef")
+ {
+ if (!def[a[2]])
+ skip = 1
+ print comment
+ }
+ else if (a[1] == "#ifndef")
+ {
+ if (def[a[2]])
+ skip = 1
+ print comment
+ }
+ else if (a[1] == "#endif")
+ {
+ skip = 0
+ print comment
+ }
+ else if (skip)
+ print comment
+ else
+ print $0
+ }
+}
+BEGIN {
+ comment = "'"'"'\\\""
+ if (DEF1) def[DEF1] = 1;
+ if (DEF2) def[DEF2] = 1;
+ if (DEF3) def[DEF3] = 1;
+ if (DEF4) def[DEF4] = 1;
+ if (DEF5) def[DEF5] = 1;
+ if (DEF6) def[DEF6] = 1;
+ if (DEF7) def[DEF7] = 1;
+ if (DEF8) def[DEF8] = 1;
+ if (DEF9) def[DEF9] = 1;
+ #for (i in def)
+ #print i, def[i]
+ do1(ARGV[1])
+ exit
+}' $*
diff --git a/jbig.c b/jbig.c
index 6631472..6001d1a 100644
--- a/jbig.c
+++ b/jbig.c
@@ -1,16 +1,15 @@
/*
- * Portable Free JBIG image compression library
+ * Portable JBIG image compression library
*
- * Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/
+ * Copyright 1995-2007 -- Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/
*
- * Id: jbig.c,v 1.22 2004-06-11 15:17:06+01 mgk25 Exp $
- * $Id: jbig.c,v 1.4 2004/06/12 02:33:05 rick Exp $
+ * $Id: jbig.c,v 1.5 2008/09/05 15:05:54 rick Exp $
*
* This module implements a portable standard C encoder and decoder
- * using the JBIG lossless bi-level image compression algorithm as
- * specified in International Standard ISO 11544:1993 or equivalently
- * as specified in ITU-T Recommendation T.82. See the file jbig.doc
- * for usage instructions and application examples.
+ * using the JBIG1 lossless bi-level image compression algorithm
+ * specified in International Standard ISO 11544:1993 and
+ * ITU-T Recommendation T.82. See the file jbig.txt for usage
+ * instructions and application examples.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -51,20 +50,6 @@
#include "jbig.h"
-
-/* optional export of arithmetic coder functions for test purposes */
-#ifdef TEST_CODEC
-#define ARITH
-#define ARITH_INL
-#else
-#define ARITH static
-#ifdef __GNUC__
-#define ARITH_INL static __inline__
-#else
-#define ARITH_INL static
-#endif
-#endif
-
#define MX_MAX 127 /* maximal supported mx offset for
* adaptive template in the encoder */
@@ -95,8 +80,9 @@
/* object code version id */
const char jbg_version[] =
-" JBIG-KIT " JBG_VERSION " -- Markus Kuhn -- "
-"$Id: jbig.c,v 1.4 2004/06/12 02:33:05 rick Exp $ ";
+ "JBIG-KIT " JBG_VERSION " -- (c) 1995-2008 Markus Kuhn -- "
+ "Licence: " JBG_LICENCE "\n"
+ "$Id: jbig.c,v 1.5 2008/09/05 15:05:54 rick Exp $ ";
/*
* the following array specifies for each combination of the 3
@@ -114,54 +100,25 @@ static const int iindex[8][3] = {
{ -1, -1, -1 } /* SEQ + SMID + ILEAVE -> illegal combination */
};
+#define _(String) String /* to mark translatable string for GNU gettext */
/*
- * Array [language][message] with text string error messages that correspond
+ * Array with English ASCII error messages that correspond
* to return values from public functions in this library.
*/
-#define NEMSG 9 /* number of error codes */
-#define NEMSG_LANG 3 /* number of supported languages */
-static const char *errmsg[NEMSG_LANG][NEMSG] = {
- /* English (JBG_EN) */
- {
- "Everything is ok", /* JBG_EOK */
- "Reached specified maximum size", /* JBG_EOK_INTR */
- "Unexpected end of data", /* JBG_EAGAIN */
- "Not enough memory available", /* JBG_ENOMEM */
- "ABORT marker found", /* JBG_EABORT */
- "Unknown marker segment encountered", /* JBG_EMARKER */
- "Incremental BIE does not fit to previous one", /* JBG_ENOCONT */
- "Invalid data encountered", /* JBG_EINVAL */
- "Unimplemented features used" /* JBG_EIMPL */
- },
- /* German (JBG_DE_8859_1) */
- {
- "Kein Problem aufgetreten", /* JBG_EOK */
- "Angegebene maximale Bildgr\366\337e erreicht", /* JBG_EOK_INTR */
- "Unerwartetes Ende der Daten", /* JBG_EAGAIN */
- "Nicht gen\374gend Speicher vorhanden", /* JBG_ENOMEM */
- "Es wurde eine Abbruch-Sequenz gefunden", /* JBG_EABORT */
- "Eine unbekannte Markierungssequenz wurde gefunden", /* JBG_EMARKER */
- "Neue Daten passen nicht zu vorangegangenen Daten", /* JBG_ENOCONT */
- "Es wurden ung\374ltige Daten gefunden", /* JBG_EINVAL */
- "Noch nicht implementierte Optionen wurden benutzt" /* JBG_EIMPL */
- },
- /* German (JBG_DE_UTF_8) */
- {
- "Kein Problem aufgetreten", /* JBG_EOK */
- "Angegebene maximale Bildgr\303\266\303\237e erreicht", /* JBG_EOK_INTR */
- "Unerwartetes Ende der Daten", /* JBG_EAGAIN */
- "Nicht gen\303\274gend Speicher vorhanden", /* JBG_ENOMEM */
- "Es wurde eine Abbruch-Sequenz gefunden", /* JBG_EABORT */
- "Eine unbekannte Markierungssequenz wurde gefunden", /* JBG_EMARKER */
- "Neue Daten passen nicht zu vorangegangenen Daten", /* JBG_ENOCONT */
- "Es wurden ung\303\274ltige Daten gefunden", /* JBG_EINVAL */
- "Noch nicht implementierte Optionen wurden benutzt" /* JBG_EIMPL */
- }
+static const char *errmsg[] = {
+ _("All OK"), /* JBG_EOK */
+ _("Reached specified image size"), /* JBG_EOK_INTR */
+ _("Unexpected end of input data stream"), /* JBG_EAGAIN */
+ _("Not enough memory available"), /* JBG_ENOMEM */
+ _("ABORT marker segment encountered"), /* JBG_EABORT */
+ _("Unknown marker segment encountered"), /* JBG_EMARKER */
+ _("Input data stream contains invalid data"), /* JBG_EINVAL */
+ _("Input data stream uses unimplemented JBIG features"), /* JBG_EIMPL */
+ _("Incremental BIE does not continue previous one") /* JBG_ENOCONT */
};
-
/*
* The following three functions are the only places in this code, were
* C library memory management functions are called. The whole JBIG
@@ -245,291 +202,6 @@ static void checked_free(void *ptr)
-/*
- * The next functions implement the arithmedic encoder and decoder
- * required for JBIG. The same algorithm is also used in the arithmetic
- * variant of JPEG.
- */
-
-#ifdef DEBUG
-static long encoded_pixels = 0;
-#endif
-
-ARITH void arith_encode_init(struct jbg_arenc_state *s, int reuse_st)
-{
- int i;
-
- if (!reuse_st)
- for (i = 0; i < 4096; s->st[i++] = 0);
- s->c = 0;
- s->a = 0x10000L;
- s->sc = 0;
- s->ct = 11;
- s->buffer = -1; /* empty */
-
- return;
-}
-
-
-ARITH void arith_encode_flush(struct jbg_arenc_state *s)
-{
- unsigned long temp;
-
-#ifdef DEBUG
- fprintf(stderr, " encoded pixels = %ld, a = %05lx, c = %08lx\n",
- encoded_pixels, s->a, s->c);
-#endif
-
- /* find the s->c in the coding interval with the largest
- * number of trailing zero bits */
- if ((temp = (s->a - 1 + s->c) & 0xffff0000L) < s->c)
- s->c = temp + 0x8000;
- else
- s->c = temp;
- /* send remaining bytes to output */
- s->c <<= s->ct;
- if (s->c & 0xf8000000L) {
- /* one final overflow has to be handled */
- if (s->buffer >= 0) {
- s->byte_out(s->buffer + 1, s->file);
- if (s->buffer + 1 == MARKER_ESC)
- s->byte_out(MARKER_STUFF, s->file);
- }
- /* output 0x00 bytes only when more non-0x00 will follow */
- if (s->c & 0x7fff800L)
- for (; s->sc; --s->sc)
- s->byte_out(0x00, s->file);
- } else {
- if (s->buffer >= 0)
- s->byte_out(s->buffer, s->file);
- /* T.82 figure 30 says buffer+1 for the above line! Typo? */
- for (; s->sc; --s->sc) {
- s->byte_out(0xff, s->file);
- s->byte_out(MARKER_STUFF, s->file);
- }
- }
- /* output final bytes only if they are not 0x00 */
- if (s->c & 0x7fff800L) {
- s->byte_out((s->c >> 19) & 0xff, s->file);
- if (((s->c >> 19) & 0xff) == MARKER_ESC)
- s->byte_out(MARKER_STUFF, s->file);
- if (s->c & 0x7f800L) {
- s->byte_out((s->c >> 11) & 0xff, s->file);
- if (((s->c >> 11) & 0xff) == MARKER_ESC)
- s->byte_out(MARKER_STUFF, s->file);
- }
- }
-
- return;
-}
-
-
-ARITH_INL void arith_encode(struct jbg_arenc_state *s, int cx, int pix)
-{
- extern short jbg_lsz[];
- extern unsigned char jbg_nmps[], jbg_nlps[];
- register unsigned lsz, ss;
- register unsigned char *st;
- long temp;
-
-#ifdef DEBUG
- ++encoded_pixels;
-#endif
-
- assert(cx >= 0 && cx < 4096);
- st = s->st + cx;
- ss = *st & 0x7f;
- assert(ss < 113);
- lsz = jbg_lsz[ss];
-
-#if 0
- fprintf(stderr, "pix = %d, cx = %d, mps = %d, st = %3d, lsz = 0x%04x, "
- "a = 0x%05lx, c = 0x%08lx, ct = %2d, buf = 0x%02x\n",
- pix, cx, !!(s->st[cx] & 0x80), ss, lsz, s->a, s->c, s->ct,
- s->buffer);
-#endif
-
- if (((pix << 7) ^ s->st[cx]) & 0x80) {
- /* encode the less probable symbol */
- if ((s->a -= lsz) >= lsz) {
- /* If the interval size (lsz) for the less probable symbol (LPS)
- * is larger than the interval size for the MPS, then exchange
- * the two symbols for coding efficiency, otherwise code the LPS
- * as usual: */
- s->c += s->a;
- s->a = lsz;
- }
- /* Check whether MPS/LPS exchange is necessary
- * and chose next probability estimator status */
- *st &= 0x80;
- *st ^= jbg_nlps[ss];
- } else {
- /* encode the more probable symbol */
- if ((s->a -= lsz) & 0xffff8000L)
- return; /* A >= 0x8000 -> ready, no renormalization required */
- if (s->a < lsz) {
- /* If the interval size (lsz) for the less probable symbol (LPS)
- * is larger than the interval size for the MPS, then exchange
- * the two symbols for coding efficiency: */
- s->c += s->a;
- s->a = lsz;
- }
- /* chose next probability estimator status */
- *st &= 0x80;
- *st |= jbg_nmps[ss];
- }
-
- /* renormalization of coding interval */
- do {
- s->a <<= 1;
- s->c <<= 1;
- --s->ct;
- if (s->ct == 0) {
- /* another byte is ready for output */
- temp = s->c >> 19;
- if (temp & 0xffffff00L) {
- /* handle overflow over all buffered 0xff bytes */
- if (s->buffer >= 0) {
- ++s->buffer;
- s->byte_out(s->buffer, s->file);
- if (s->buffer == MARKER_ESC)
- s->byte_out(MARKER_STUFF, s->file);
- }
- for (; s->sc; --s->sc)
- s->byte_out(0x00, s->file);
- s->buffer = temp & 0xff; /* new output byte, might overflow later */
- assert(s->buffer != 0xff);
- /* can s->buffer really never become 0xff here? */
- } else if (temp == 0xff) {
- /* buffer 0xff byte (which might overflow later) */
- ++s->sc;
- } else {
- /* output all buffered 0xff bytes, they will not overflow any more */
- if (s->buffer >= 0)
- s->byte_out(s->buffer, s->file);
- for (; s->sc; --s->sc) {
- s->byte_out(0xff, s->file);
- s->byte_out(MARKER_STUFF, s->file);
- }
- s->buffer = temp; /* buffer new output byte (can still overflow) */
- }
- s->c &= 0x7ffffL;
- s->ct = 8;
- }
- } while (s->a < 0x8000);
-
- return;
-}
-
-
-ARITH void arith_decode_init(struct jbg_ardec_state *s, int reuse_st)
-{
- int i;
-
- if (!reuse_st)
- for (i = 0; i < 4096; s->st[i++] = 0);
- s->c = 0;
- s->a = 1;
- s->ct = 0;
- s->result = JBG_OK;
- s->startup = 1;
- return;
-}
-
-
-ARITH_INL int arith_decode(struct jbg_ardec_state *s, int cx)
-{
- extern short jbg_lsz[];
- extern unsigned char jbg_nmps[], jbg_nlps[];
- register unsigned lsz, ss;
- register unsigned char *st;
- int pix;
-
- /* renormalization */
- while (s->a < 0x8000 || s->startup) {
- if (s->ct < 1 && s->result != JBG_READY) {
- /* first we have to move a new byte into s->c */
- if (s->pscd_ptr >= s->pscd_end) {
- s->result = JBG_MORE;
- return -1;
- }
- if (*s->pscd_ptr == 0xff)
- if (s->pscd_ptr + 1 >= s->pscd_end) {
- s->result = JBG_MARKER;
- return -1;
- } else {
- if (*(s->pscd_ptr + 1) == MARKER_STUFF) {
- s->c |= 0xffL << (8 - s->ct);
- s->ct += 8;
- s->pscd_ptr += 2;
- s->result = JBG_OK;
- } else
- s->result = JBG_READY;
- }
- else {
- s->c |= (long)*(s->pscd_ptr++) << (8 - s->ct);
- s->ct += 8;
- s->result = JBG_OK;
- }
- }
- s->c <<= 1;
- s->a <<= 1;
- --s->ct;
- if (s->a == 0x10000L)
- s->startup = 0;
- }
-
- st = s->st + cx;
- ss = *st & 0x7f;
- assert(ss < 113);
- lsz = jbg_lsz[ss];
-
-#if 0
- fprintf(stderr, "cx = %d, mps = %d, st = %3d, lsz = 0x%04x, a = 0x%05lx, "
- "c = 0x%08lx, ct = %2d\n",
- cx, !!(s->st[cx] & 0x80), ss, lsz, s->a, s->c, s->ct);
-#endif
-
- if ((s->c >> 16) < (s->a -= lsz))
- if (s->a & 0xffff8000L)
- return *st >> 7;
- else {
- /* MPS_EXCHANGE */
- if (s->a < lsz) {
- pix = 1 - (*st >> 7);
- /* Check whether MPS/LPS exchange is necessary
- * and chose next probability estimator status */
- *st &= 0x80;
- *st ^= jbg_nlps[ss];
- } else {
- pix = *st >> 7;
- *st &= 0x80;
- *st |= jbg_nmps[ss];
- }
- }
- else {
- /* LPS_EXCHANGE */
- if (s->a < lsz) {
- s->c -= s->a << 16;
- s->a = lsz;
- pix = *st >> 7;
- *st &= 0x80;
- *st |= jbg_nmps[ss];
- } else {
- s->c -= s->a << 16;
- s->a = lsz;
- pix = 1 - (*st >> 7);
- /* Check whether MPS/LPS exchange is necessary
- * and chose next probability estimator status */
- *st &= 0x80;
- *st ^= jbg_nlps[ss];
- }
- }
-
- return pix;
-}
-
-
/*
* Memory management for buffers which are used for temporarily
@@ -729,8 +401,8 @@ static void jbg_set_default_l0(struct jbg_enc_state *s)
/*
* Calculate the number of stripes, as defined in clause 6.2.3 of T.82.
*/
-static unsigned long jbg_stripes(unsigned long l0, unsigned long yd,
- unsigned long d)
+unsigned long jbg_stripes(unsigned long l0, unsigned long yd,
+ unsigned long d)
{
unsigned long y0 = jbg_ceil_half(yd, d);
@@ -739,6 +411,371 @@ static unsigned long jbg_stripes(unsigned long l0, unsigned long yd,
/*
+ * Resolution reduction table given by ITU-T T.82 Table 17
+ */
+
+static char jbg_resred[4096] = {
+ 0,0,0,1,0,0,0,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+ 0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,1,1,1,0,1,1,
+ 0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+ 1,0,0,1,0,0,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,
+ 0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,1,0,0,0,1,0,1,1,0,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
+ 1,1,1,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+ 1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,
+ 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0,1,1,
+ 1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,
+ 0,0,1,0,1,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,
+ 0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,
+ 0,0,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,
+ 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,1,
+ 0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,1,1,1,0,1,0,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,
+ 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,1,1,0,1,1,1,
+ 0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,1,1,0,1,0,0,0,1,1,0,1,0,0,0,0,1,1,1,1,0,0,1,1,1,0,1,1,0,0,1,1,
+ 0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,1,0,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+ 0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,
+ 0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,0,1,1,
+ 1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,
+ 0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,0,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,
+ 1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+ 1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,
+ 0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,1,0,1,0,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+ 1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,0,1,1,0,
+ 0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+ 0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,
+ 0,0,1,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,
+ 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,
+ 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,1,
+ 0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,
+ 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,
+ 0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
+ 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,
+ 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,
+ 0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,1,0,1,1,1
+};
+
+/*
+ * Deterministic prediction tables given by ITU-T T.82 tables
+ * 19 to 22. The table below is organized differently, the
+ * index bits are permutated for higher efficiency.
+ */
+
+static char jbg_dptable[256 + 512 + 2048 + 4096] = {
+ /* phase 0: offset=0 */
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,0,2,2,2,2,2,2,2,
+ 0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,0,2,0,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ /* phase 1: offset=256 */
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,0,2,0,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,2,2,2,2,0,2,2,2,2,2,2,2,
+ 0,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,0,0,2,2,2,2,2,0,0,2,2,2,2,2,
+ 0,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
+ 1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,2,0,2,2,2,2,2,2,
+ 2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,0,2,0,2,2,2,2,2,0,2,2,2,2,2,2,2,
+ 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
+ 2,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,1,
+ 0,2,0,2,2,1,2,1,2,2,2,2,1,1,1,1,0,0,0,0,2,2,2,2,0,2,0,2,2,2,2,1,
+ 2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,0,0,0,2,2,2,2,2,
+ 2,2,2,2,2,1,2,1,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,2,2,2,2,1,
+ 2,2,2,2,2,2,2,2,0,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,0,0,0,2,2,2,2,2,
+ /* phase 2: offset=768 */
+ 2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
+ 0,2,2,2,2,1,2,1,2,2,2,2,1,2,1,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,1,2,2,2,2,2,1,1,1,
+ 2,0,2,2,2,1,2,1,0,2,2,2,1,2,1,2,2,2,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
+ 0,2,0,0,1,1,1,1,2,2,2,2,1,1,1,1,0,2,0,2,1,1,1,1,2,2,2,2,1,1,1,1,
+ 2,2,0,2,2,2,1,2,2,2,2,2,1,2,1,2,2,2,0,2,2,1,2,1,0,2,0,2,1,1,1,1,
+ 2,0,0,2,2,2,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,2,1,2,2,0,2,1,1,2,1,
+ 2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
+ 0,0,0,0,2,2,2,2,0,0,0,0,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,0,2,2,2,2,1,0,2,2,2,1,1,1,1,2,0,2,2,2,2,2,2,0,2,0,2,2,1,2,1,
+ 2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,
+ 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 2,2,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,2,2,1,2,1,0,2,2,2,1,1,1,1,
+ 2,2,2,0,2,2,2,2,2,2,0,2,2,0,2,0,2,1,2,2,2,2,2,2,1,2,1,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,
+ 2,2,2,1,2,2,2,2,2,2,1,2,0,0,0,0,2,2,0,2,2,1,2,2,2,2,2,2,1,1,1,1,
+ 2,0,0,0,2,2,2,2,0,2,2,2,2,2,2,0,2,2,2,0,2,2,2,2,2,0,0,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,1,
+ 0,2,0,2,2,1,1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,
+ 2,0,2,0,2,1,2,1,0,2,0,2,2,2,1,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,1,2,
+ 2,2,2,0,2,2,2,2,2,2,0,2,2,2,2,2,2,2,1,2,2,2,2,2,2,0,1,2,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,1,2,1,0,2,2,2,1,1,1,1,
+ 2,0,2,0,2,1,2,2,0,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,2,
+ 2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,1,2,1,
+ 2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,0,0,2,2,2,1,2,2,2,
+ 0,0,2,0,2,2,2,2,0,2,0,2,2,0,2,0,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
+ 2,2,0,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
+ 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 2,0,0,2,2,2,2,2,0,2,0,2,2,2,2,2,1,0,1,2,2,2,2,1,0,2,2,2,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,0,2,2,0,2,0,2,1,2,2,2,2,2,2,2,2,0,2,2,1,2,2,
+ 0,2,0,0,1,1,1,1,0,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,0,2,2,1,2,1,1,
+ 2,2,0,2,2,1,2,2,2,2,2,2,1,2,2,2,2,0,2,2,2,2,2,2,0,2,0,2,1,2,1,1,
+ 2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,2,2,2,2,1,1,2,2,2,2,2,1,2,2,2,
+ 2,0,2,2,2,1,2,1,0,2,2,2,2,2,1,2,2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,
+ 0,2,0,0,2,2,2,2,1,2,2,2,2,2,2,0,2,1,2,2,2,2,2,2,1,2,2,2,2,2,2,2,
+ 0,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,1,0,2,2,
+ 0,0,0,2,2,1,1,1,2,2,2,2,1,2,2,2,2,0,2,0,2,2,2,1,2,2,2,2,1,2,1,2,
+ 0,0,0,0,2,2,2,2,2,2,0,2,2,1,2,2,2,1,2,1,2,2,2,2,1,2,1,2,0,2,2,2,
+ 2,0,2,0,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,1,2,2,2,2,2,0,2,2,1,2,2,0,0,0,2,2,2,2,2,1,2,2,0,2,2,2,1,2,1,2,
+ 2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,0,2,0,0,2,2,2,2,2,2,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
+ 1,2,0,2,2,1,2,1,2,2,2,2,1,2,2,2,2,0,2,0,2,2,2,2,2,0,2,2,1,1,1,1,
+ 0,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,1,2,1,
+ 2,2,0,0,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,
+ 2,2,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,
+ 2,0,2,0,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,1,0,2,0,2,2,2,1,2,
+ 2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,1,2,1,
+ 2,2,2,2,2,1,2,1,0,2,0,2,2,2,2,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,1,
+ 2,0,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,
+ 2,0,2,0,2,2,2,1,2,2,2,0,2,2,2,1,2,0,2,0,2,2,2,2,0,0,0,2,2,2,2,1,
+ 2,0,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,
+ /* phase 3: offset=2816 */
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,0,2,2,2,1,2,0,2,2,2,1,2,2,2,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,
+ 2,2,2,1,2,2,2,0,1,1,1,1,0,0,0,0,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,0,2,0,2,1,2,1,
+ 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,
+ 2,0,2,2,2,1,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,2,0,1,1,2,1,
+ 2,2,2,0,2,2,2,1,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
+ 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
+ 2,0,0,2,2,1,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,1,1,1,2,0,0,0,
+ 2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,2,2,2,0,2,2,2,1,2,0,2,0,2,1,2,1,
+ 2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
+ 2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,0,2,0,2,1,2,1,0,0,2,0,1,1,2,1,
+ 2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,0,0,2,1,1,1,
+ 2,2,2,1,2,2,2,0,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
+ 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,
+ 2,0,2,2,2,1,2,2,0,0,2,0,1,1,2,1,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,0,0,0,1,1,1,1,
+ 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,1,0,2,2,0,1,2,
+ 2,2,2,1,2,2,2,0,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,
+ 2,1,2,1,2,0,2,0,1,2,1,1,0,2,0,0,0,0,2,1,1,1,2,0,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,0,2,1,2,1,2,0,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,2,2,0,0,2,2,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
+ 2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,0,0,2,1,1,1,
+ 2,2,2,0,2,2,2,1,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,0,2,2,2,1,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,1,2,1,2,0,2,0,1,2,1,1,0,2,0,0,2,0,2,2,2,1,2,2,0,2,1,2,1,2,0,2,
+ 2,2,2,1,2,2,2,0,2,2,1,2,2,2,0,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,
+ 0,0,2,0,1,1,2,1,0,0,1,0,1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,0,2,2,2,1,1,2,2,2,0,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,0,0,2,2,1,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
+ 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,1,2,2,2,0,2,1,2,1,2,0,2,0,
+ 2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,2,0,0,0,2,1,1,1,
+ 2,2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,1,2,1,2,0,2,0,2,0,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,1,1,1,2,0,0,0,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
+ 2,1,2,1,2,0,2,0,2,1,2,2,2,0,2,2,2,2,2,0,2,2,2,1,2,0,2,0,2,1,2,1,
+ 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,0,1,0,0,1,0,1,1,
+ 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,2,1,0,2,0,2,2,2,1,2,2,2,
+ 2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,
+ 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 0,2,0,0,1,2,1,1,2,0,0,0,2,1,1,1,2,2,2,2,2,2,2,2,1,0,1,2,0,1,0,2,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,1,2,2,2,0,2,2,1,1,2,2,0,0,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,1,2,1,2,0,2,0,2,1,2,2,2,0,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,1,2,2,2,0,2,2,2,
+ 2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,
+ 0,0,0,0,1,1,1,1,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,0,2,2,2,1,2,
+ 2,0,2,0,2,1,2,1,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
+ 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,1,2,2,2,0,1,1,2,1,0,0,2,0,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,
+ 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,
+ 0,2,0,0,1,2,1,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,2,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,2,1,1,1,2,0,0,2,2,2,1,2,2,2,
+ 2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
+ 0,0,2,2,1,1,2,2,0,2,1,2,1,2,0,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
+ 2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
+ 2,2,0,0,2,2,1,1,2,2,0,0,2,2,1,1,2,2,2,2,2,2,2,2,2,2,0,0,2,2,1,1,
+ 2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
+ 2,2,2,0,2,2,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,
+ 2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,
+ 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,
+ 2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,
+ 2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,0,2,0,2,1,2,1,2,1,2,0,2,0,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,0,2,0,2,1,2,1,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,
+ 2,0,2,1,2,1,2,0,0,2,1,2,1,2,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
+ 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,1,2,1,2,0,2,0,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
+ 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+ 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
+};
+
+
+/*
* Initialize the status struct for the encoder.
*/
void jbg_enc_init(struct jbg_enc_state *s, unsigned long x, unsigned long y,
@@ -750,8 +787,7 @@ void jbg_enc_init(struct jbg_enc_state *s, unsigned long x, unsigned long y,
unsigned long l, lx;
int i;
- extern char jbg_resred[], jbg_dptable[];
-
+ assert(x > 0 && y > 0 && planes > 0 && planes < 256);
s->xd = x;
s->yd = y;
s->yd1 = y; /* This is the hight initially announced in BIH. To provoke
@@ -769,6 +805,7 @@ void jbg_enc_init(struct jbg_enc_state *s, unsigned long x, unsigned long y,
s->my = 0;
s->order = JBG_ILEAVE | JBG_SMID;
s->options = JBG_TPBON | JBG_TPDON | JBG_DPON;
+ s->comment = NULL;
s->dppriv = jbg_dptable;
s->res_tab = jbg_resred;
@@ -884,7 +921,9 @@ static void encode_sde(struct jbg_enc_state *s,
unsigned long line_h0 = 0, line_h1 = 0;
unsigned long line_h2, line_h3, line_l1, line_l2, line_l3;
struct jbg_arenc_state *se;
- unsigned long i, j, y;
+ unsigned long y; /* current line number in highres image */
+ unsigned long i; /* current line number within highres stripe */
+ unsigned long j; /* current column number in highres image */
long o;
unsigned a, p, t;
int ltp, ltp_old, cx;
@@ -892,6 +931,7 @@ static void encode_sde(struct jbg_enc_state *s,
int tmax, at_determined;
int new_tx;
long new_tx_line = -1;
+ int reset;
struct jbg_buf *new_jbg_buf;
#ifdef DEBUG
@@ -930,9 +970,12 @@ static void encode_sde(struct jbg_enc_state *s,
lp2 = s->lhp[1 - s->highres[plane]][plane] + stripe * ll * lbpl;
lp1 = lp2 + lbpl;
+ /* check whether we can refer to any state of a previous stripe */
+ reset = (stripe == 0) || (s->options & JBG_SDRST);
+
/* initialize arithmetic encoder */
se = s->s + plane;
- arith_encode_init(se, stripe != 0);
+ arith_encode_init(se, !reset);
s->sde[stripe][layer][plane] = jbg_buf_init(&s->free_list);
se->byte_out = jbg_buf_write;
se->file = s->sde[stripe][layer][plane];
@@ -941,7 +984,7 @@ static void encode_sde(struct jbg_enc_state *s,
c_all = 0;
for (t = 0; t <= s->mx; t++)
c[t] = 0;
- if (stripe == 0)
+ if (stripe == 0) /* the SDRST case is handled at the end */
s->tx[plane] = 0;
new_tx = -1;
at_determined = 0; /* we haven't yet decided the template move */
@@ -950,7 +993,7 @@ static void encode_sde(struct jbg_enc_state *s,
/* initialize typical prediction */
ltp = 0;
- if (stripe == 0)
+ if (reset)
ltp_old = 0;
else {
ltp_old = 1;
@@ -1009,7 +1052,7 @@ static void encode_sde(struct jbg_enc_state *s,
if (s->options & JBG_TPBON) {
ltp = 1;
p1 = hp;
- if (y > 0) {
+ if (i > 0 || !reset) {
q1 = hp - hbpl;
while (q1 < hp && (ltp = (*p1++ == *q1++)) != 0);
} else
@@ -1037,15 +1080,15 @@ static void encode_sde(struct jbg_enc_state *s,
*/
line_h1 = line_h2 = line_h3 = 0;
- if (y > 0) line_h2 = (long)*(hp - hbpl) << 8;
- if (y > 1) line_h3 = (long)*(hp - hbpl - hbpl) << 8;
+ if (i > 0 || !reset) line_h2 = (long)*(hp - hbpl) << 8;
+ if (i > 1 || !reset) line_h3 = (long)*(hp - hbpl - hbpl) << 8;
/* encode line */
for (j = 0; j < hx; hp++) {
line_h1 |= *hp;
- if (j < hbpl * 8 - 8 && y > 0) {
+ if (j < hbpl * 8 - 8 && (i > 0 || !reset)) {
line_h2 |= *(hp - hbpl + 1);
- if (y > 1)
+ if (i > 1 || !reset)
line_h3 |= *(hp - hbpl - hbpl + 1);
}
if (s->options & JBG_LRLTWO) {
@@ -1192,7 +1235,7 @@ static void encode_sde(struct jbg_enc_state *s,
p0 = p1 = hp;
if (i < hl - 1 && y < hy - 1)
p0 = hp + hbpl;
- if (y > 1)
+ if (i > 1 || !reset)
line_l3 = (long)*(q2 - lbpl) << 8;
else
line_l3 = 0;
@@ -1201,7 +1244,7 @@ static void encode_sde(struct jbg_enc_state *s,
ltp = 1;
for (j = 0; j < lx && ltp; q1++, q2++) {
if (j < lbpl * 8 - 8) {
- if (y > 1)
+ if (i > 1 || !reset)
line_l3 |= *(q2 - lbpl + 1);
line_l2 |= *(q2 + 1);
line_l1 |= *(q1 + 1);
@@ -1271,8 +1314,8 @@ static void encode_sde(struct jbg_enc_state *s,
line_h1 = line_h2 = line_h3 = line_l1 = line_l2 = line_l3 = 0;
- if (y > 0) line_h2 = (long)*(hp - hbpl) << 8;
- if (y > 1) {
+ if (i > 0 || !reset) line_h2 = (long)*(hp - hbpl) << 8;
+ if (i > 1 || !reset) {
line_h3 = (long)*(hp - hbpl - hbpl) << 8;
line_l3 = (long)*(lp2 - lbpl) << 8;
}
@@ -1282,7 +1325,7 @@ static void encode_sde(struct jbg_enc_state *s,
/* encode line */
for (j = 0; j < hx; lp1++, lp2++) {
if ((j >> 1) < lbpl * 8 - 8) {
- if (y > 1)
+ if (i > 1 || !reset)
line_l3 |= *(lp2 - lbpl + 1);
line_l2 |= *(lp2 + 1);
line_l1 |= *(lp1 + 1);
@@ -1299,9 +1342,9 @@ static void encode_sde(struct jbg_enc_state *s,
line_h1 |= *hp;
if (j < hbpl * 8 - 8) {
- if (y > 0) {
+ if (i > 0 || !reset) {
line_h2 |= *(hp - hbpl + 1);
- if (y > 1)
+ if (i > 1 || !reset)
line_h3 |= *(hp - hbpl - hbpl + 1);
}
}
@@ -1433,7 +1476,10 @@ static void encode_sde(struct jbg_enc_state *s,
arith_encode_flush(se);
jbg_buf_remove_zeros(s->sde[stripe][layer][plane]);
jbg_buf_write(MARKER_ESC, s->sde[stripe][layer][plane]);
- jbg_buf_write(MARKER_SDNORM, s->sde[stripe][layer][plane]);
+ jbg_buf_write((s->options & JBG_SDRST) ? MARKER_SDRST : MARKER_SDNORM,
+ s->sde[stripe][layer][plane]);
+ if (s->options & JBG_SDRST)
+ s->tx[plane] = 0;
/* add ATMOVE */
if (new_tx != -1) {
@@ -1481,12 +1527,18 @@ static void encode_sde(struct jbg_enc_state *s,
static void resolution_reduction(struct jbg_enc_state *s, int plane,
int higher_layer)
{
- unsigned long hx, hy, lx, ly, hbpl, lbpl;
+ unsigned long hl, ll, hx, hy, lx, ly, hbpl, lbpl;
unsigned char *hp1, *hp2, *hp3, *lp;
unsigned long line_h1, line_h2, line_h3, line_l2;
- unsigned long i, j;
+ unsigned long y; /* current line number in lowres image */
+ unsigned long i; /* current line number within lowres stripe */
+ unsigned long j; /* current column number in lowres image */
int pix, k, l;
+ /* number of lines per stripe in highres image */
+ hl = s->l0 << higher_layer;
+ /* number of lines per stripe in lowres image */
+ ll = hl >> 1;
/* number of pixels in highres image */
hx = jbg_ceil_half(s->xd, s->d - higher_layer);
hy = jbg_ceil_half(s->yd, s->d - higher_layer);
@@ -1525,39 +1577,43 @@ static void resolution_reduction(struct jbg_enc_state *s, int plane,
* X
*/
- for (i = 0; i < ly; i++) {
- if (2*i + 1 >= hy)
- hp1 = hp2;
- pix = 0;
- line_h1 = line_h2 = line_h3 = line_l2 = 0;
- for (j = 0; j < lbpl * 8; j += 8) {
- *lp = 0;
- line_l2 |= i ? *(lp-lbpl) : 0;
- for (k = 0; k < 8 && j + k < lx; k += 4) {
- if (((j + k) >> 2) < hbpl) {
- line_h3 |= i ? *hp3 : 0;
- ++hp3;
- line_h2 |= *(hp2++);
- line_h1 |= *(hp1++);
- }
- for (l = 0; l < 4 && j + k + l < lx; l++) {
- line_h3 <<= 2;
- line_h2 <<= 2;
- line_h1 <<= 2;
- line_l2 <<= 1;
- pix = s->res_tab[((line_h1 >> 8) & 0x007) |
- ((line_h2 >> 5) & 0x038) |
- ((line_h3 >> 2) & 0x1c0) |
- (pix << 9) | ((line_l2 << 2) & 0xc00)];
- *lp = (*lp << 1) | pix;
+ for (y = 0; y < ly;) {
+ for (i = 0; i < ll && y < ly; i++, y++) {
+ if (2*y + 1 >= hy)
+ hp1 = hp2;
+ pix = 0;
+ line_h1 = line_h2 = line_h3 = line_l2 = 0;
+ for (j = 0; j < lbpl * 8; j += 8) {
+ *lp = 0;
+ if (i > 0 || (y > 0 && !(s->options & JBG_SDRST)))
+ line_l2 |= *(lp-lbpl);
+ for (k = 0; k < 8 && j + k < lx; k += 4) {
+ if (((j + k) >> 2) < hbpl) {
+ if (i > 0 || (y > 0 && !(s->options & JBG_SDRST)))
+ line_h3 |= *hp3;
+ ++hp3;
+ line_h2 |= *(hp2++);
+ line_h1 |= *(hp1++);
+ }
+ for (l = 0; l < 4 && j + k + l < lx; l++) {
+ line_h3 <<= 2;
+ line_h2 <<= 2;
+ line_h1 <<= 2;
+ line_l2 <<= 1;
+ pix = s->res_tab[((line_h1 >> 8) & 0x007) |
+ ((line_h2 >> 5) & 0x038) |
+ ((line_h3 >> 2) & 0x1c0) |
+ (pix << 9) | ((line_l2 << 2) & 0xc00)];
+ *lp = (*lp << 1) | pix;
+ }
}
+ ++lp;
}
- ++lp;
+ *(lp - 1) <<= lbpl * 8 - lx;
+ hp1 += hbpl;
+ hp2 += hbpl;
+ hp3 += hbpl;
}
- *(lp - 1) <<= lbpl * 8 - lx;
- hp1 += hbpl;
- hp2 += hbpl;
- hp3 += hbpl;
}
#ifdef DEBUG
@@ -1582,16 +1638,15 @@ static void resolution_reduction(struct jbg_enc_state *s, int plane,
* order to write the next SDE. It has first to generate the required
* SDE and all SDEs which have to be encoded before this SDE can be
* created. The problem here is that if we want to output a lower
- * resolution layer, we have to allpy the resolution reduction
- * algorithm in order to get it. As we try to safe as much memory as
+ * resolution layer, we have to apply the resolution reduction
+ * algorithm first to get it. As we try to safe as much memory as
* possible, the resolution reduction will overwrite previous higher
* resolution bitmaps. Consequently, we have to encode and buffer SDEs
* which depend on higher resolution layers before we can start the
- * resolution reduction. All this logic about which SDE has to be
- * encoded before resolution reduction is allowed is handled here.
- * This approach might be a little bit more complex than alternative
- * ways to do it, but it allows us to do the encoding with the minimal
- * possible amount of temporary memory.
+ * resolution reduction. All the logic about which SDE has to be
+ * encoded before resolution reduction is allowed is handled
+ * here. This approach may be a bit more complex than alternative ways
+ * of doing it, but it minimizes the amount of temporary memory used.
*/
static void output_sde(struct jbg_enc_state *s,
unsigned long stripe, int layer, int plane)
@@ -1752,7 +1807,6 @@ void jbg_enc_out(struct jbg_enc_state *s)
int layer, plane;
int order;
unsigned char dpbuf[1728];
- extern char jbg_dptable[];
/* some sanity checks */
s->order &= JBG_HITOLO | JBG_SEQ | JBG_ILEAVE | JBG_SMID;
@@ -1865,7 +1919,7 @@ void jbg_enc_out(struct jbg_enc_state *s)
* stripe depends on the option flags.
*/
- /* start and end value vor each loop */
+ /* start and end value for each loop */
is[iindex[order][STRIPE]] = 0;
ie[iindex[order][STRIPE]] = s->stripes - 1;
is[iindex[order][LAYER]] = s->dl;
@@ -1884,6 +1938,19 @@ void jbg_enc_out(struct jbg_enc_state *s)
layer = ii[iindex[order][LAYER]];
plane = ii[iindex[order][PLANE]];
+ /* output comment marker segment if there is any pending */
+ if (s->comment) {
+ buf[0] = MARKER_ESC;
+ buf[1] = MARKER_COMMENT;
+ buf[2] = s->comment_len >> 24;
+ buf[3] = (s->comment_len >> 16) & 0xff;
+ buf[4] = (s->comment_len >> 8) & 0xff;
+ buf[5] = s->comment_len & 0xff;
+ s->data_out(buf, 6, s->file);
+ s->data_out(s->comment, s->comment_len, s->file);
+ s->comment = NULL;
+ }
+
output_sde(s, stripe, layer, plane);
/*
@@ -1971,17 +2038,15 @@ void jbg_enc_free(struct jbg_enc_state *s)
/*
- * Convert the error codes used by jbg_dec_in() into a string
- * written in the selected language and character set.
+ * Convert the error codes used by jbg_dec_in() into an English ASCII string
*/
-const char *jbg_strerror(int errnum, int language)
+const char *jbg_strerror(int errnum)
{
- if (errnum < 0 || errnum >= NEMSG)
+ errnum >>= 4;
+ if (errnum < 0 || (unsigned) errnum >= sizeof(errmsg)/sizeof(errmsg[0]))
return "Unknown error code passed to jbg_strerror()";
- if (language < 0 || language >= NEMSG_LANG)
- return "Unknown language code passed to jbg_strerror()";
- return errmsg[language][errnum];
+ return errmsg[errnum];
}
@@ -2085,19 +2150,18 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
line_l3 = s->line_l3;
x = s->x;
- if (s->x == 0 && s->i == 0 &&
- (stripe == 0 || s->reset[plane][layer - s->dl])) {
- s->tx[plane][layer - s->dl] = s->ty[plane][layer - s->dl] = 0;
- if (s->pseudo)
- s->lntp[plane][layer - s->dl] = 1;
- }
-
#ifdef DEBUG
if (s->x == 0 && s->i == 0 && s->pseudo)
fprintf(stderr, "decode_pscd(%p, %p, %ld): s/d/p = %2lu/%2u/%2u\n",
(void *) s, (void *) data, (long) len, stripe, layer, plane);
#endif
+ if (s->x == 0 && s->i == 0 &&
+ (stripe == 0 || s->reset[plane][layer - s->dl]) && s->pseudo) {
+ s->tx[plane][layer - s->dl] = s->ty[plane][layer - s->dl] = 0;
+ s->lntp[plane][layer - s->dl] = 1;
+ }
+
if (layer == 0) {
/*
@@ -2107,7 +2171,7 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
for (; s->i < hl && y < hy; s->i++, y++) {
/* adaptive template changes */
- if (x == 0)
+ if (x == 0 && s->pseudo)
for (n = 0; n < s->at_moves; n++)
if (s->at_line[n] == s->i) {
s->tx[plane][layer - s->dl] = s->at_tx[n];
@@ -2123,14 +2187,11 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
/* typical prediction */
if (s->options & JBG_TPBON && s->pseudo) {
slntp = arith_decode(se, (s->options & JBG_LRLTWO) ? TPB2CX : TPB3CX);
- if (se->result == JBG_MORE || se->result == JBG_MARKER)
+ if (slntp < 0)
goto leave;
s->lntp[plane][layer - s->dl] =
!(slntp ^ s->lntp[plane][layer - s->dl]);
- if (s->lntp[plane][layer - s->dl]) {
- /* this line is 'not typical' and has to be coded completely */
- s->pseudo = 0;
- } else {
+ if (!s->lntp[plane][layer - s->dl]) {
/* this line is 'typical' (i.e. identical to the previous one) */
p1 = hp;
if (s->i == 0 && (stripe == 0 || s->reset[plane][layer - s->dl]))
@@ -2142,7 +2203,9 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
hp += hbpl;
continue;
}
+ /* this line is 'not typical' and has to be coded completely */
}
+ s->pseudo = 0;
/*
* Layout of the variables line_h1, line_h2, line_h3, which contain
@@ -2235,7 +2298,7 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
} else
pix = arith_decode(se, (((line_h2 >> 9) & 0x3f0) |
(line_h1 & 0x00f)));
- if (se->result == JBG_MORE || se->result == JBG_MARKER)
+ if (pix < 0)
goto leave;
line_h1 = (line_h1 << 1) | pix;
line_h2 <<= 1;
@@ -2262,7 +2325,7 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
pix = arith_decode(se, (((line_h3 >> 7) & 0x380) |
((line_h2 >> 11) & 0x07c) |
(line_h1 & 0x003)));
- if (se->result == JBG_MORE || se->result == JBG_MARKER)
+ if (pix < 0)
goto leave;
line_h1 = (line_h1 << 1) | pix;
@@ -2303,13 +2366,11 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
lp1 = lp2;
/* typical prediction */
- if (s->options & JBG_TPDON && s->pseudo) {
- s->lntp[plane][layer - s->dl] = arith_decode(se, TPDCX);
- if (se->result == JBG_MORE || se->result == JBG_MARKER)
+ if ((s->options & JBG_TPDON) && s->pseudo) {
+ if ((s->lntp[plane][layer - s->dl] = arith_decode(se, TPDCX)) < 0)
goto leave;
- s->pseudo = 0;
}
-
+ s->pseudo = 0;
/*
* Layout of the variables line_h1, line_h2, line_h3, which contain
@@ -2436,7 +2497,7 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
cx |= (y & 1) << 11;
pix = arith_decode(se, cx);
- if (se->result == JBG_MORE || se->result == JBG_MARKER)
+ if (pix < 0)
goto leave;
}
@@ -2482,23 +2543,38 @@ static size_t decode_pscd(struct jbg_dec_state *s, unsigned char *data,
/*
- * Provide a new BIE fragment to the decoder.
+ * Provide to the decoder a new BIE fragment of len bytes starting at data.
+ *
+ * Unless cnt is NULL, *cnt will contain the number of actually read bytes
+ * on return.
+ *
+ * Normal return values:
+ *
+ * JBG_EAGAIN All data bytes provided so far have been processed
+ * (*cnt == len) but the end of the data stream has
+ * not yet been recognized. Call the function again
+ * with additional BIE bytes.
+ * JBG_EOK The function has reached the end of a and
+ * a full image has been decoded. The function can
+ * be called again with data from the next BIE, if
+ * there exists one, in order to get to a higher
+ * resolution layer. The remaining len - *cnt bytes
+ * of the previous data block will then have to passed
+ * to this function again if len > *cnt.
+ * JBG_EOK_INTR Parsing the BIE has been interrupted as had been
+ * requested by a jbg_dec_maxsize() specification.
+ * This function can be called again with the
+ * rest of the BIE to continue the decoding process.
+ * The remaining len - *cnt bytes of the previous
+ * data block will then have to be passed to this
+ * function again if len > *cnt.
*
- * If cnt is not NULL, then *cnt will contain after the call the
- * number of actually read bytes. If the data was not complete, then
- * the return value will be JBG_EAGAIN and *cnt == len. In case this
- * function has returned with JBG_EOK, then it has reached the end of
- * a BIE but it can be called again with data from the next BIE if
- * there exists one in order to get to a higher resolution layer. In
- * case the return value was JBG_EOK_INTR then this function can be
- * called again with the rest of the BIE, because parsing the BIE has
- * been interrupted by a jbg_dec_maxsize() specification. In both
- * cases the remaining len - *cnt bytes of the previous block will
- * have to passed to this function again (if len > *cnt). In case of
- * any other return value than JBG_EOK, JBG_EOK_INTR or JBG_EAGAIN, a
- * serious problem has occured and the only function you should call
- * is jbg_dec_free() in order to remove the mess (and probably
- * jbg_strerror() in order to find out what to tell the user).
+ * Any other return value indicates that the decoding process was
+ * aborted by a serious problem and the only function you can then
+ * still call is jbg_dec_free() in order to remove the mess, and
+ * jbg85_strerror() to find out what to tell the user. (Looking at the
+ * least significant bits of the return value will provide additional
+ * information by identifying which test exactly has failed.)
*/
int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
size_t *cnt)
@@ -2506,7 +2582,6 @@ int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
int i, j, required_length;
unsigned long x, y;
unsigned long is[3], ie[3];
- extern char jbg_dptable[];
size_t dummy_cnt;
if (!cnt) cnt = &dummy_cnt;
@@ -2519,56 +2594,61 @@ int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
s->buffer[s->bie_len++] = data[(*cnt)++];
if (s->bie_len < 20)
return JBG_EAGAIN;
- if (s->buffer[1] < s->buffer[0])
- return JBG_EINVAL;
/* test whether this looks like a valid JBIG header at all */
- if (s->buffer[3] != 0 || (s->buffer[18] & 0xf0) != 0 ||
- (s->buffer[19] & 0x80) != 0)
- return JBG_EINVAL;
+ if (s->buffer[1] < s->buffer[0])
+ return JBG_EINVAL | 1;
+ if (s->buffer[3] != 0) return JBG_EINVAL | 2; /* padding != 0 */
+ if ((s->buffer[18] & 0xf0) != 0) return JBG_EINVAL | 3; /* padding != 0 */
+ if ((s->buffer[19] & 0x80) != 0) return JBG_EINVAL | 4; /* padding != 0 */
if (s->buffer[0] != s->d + 1)
- return JBG_ENOCONT;
+ return JBG_ENOCONT | 1;
s->dl = s->buffer[0];
s->d = s->buffer[1];
if (s->dl == 0)
s->planes = s->buffer[2];
else
if (s->planes != s->buffer[2])
- return JBG_ENOCONT;
+ return JBG_ENOCONT | 2;
x = (((long) s->buffer[ 4] << 24) | ((long) s->buffer[ 5] << 16) |
((long) s->buffer[ 6] << 8) | (long) s->buffer[ 7]);
y = (((long) s->buffer[ 8] << 24) | ((long) s->buffer[ 9] << 16) |
((long) s->buffer[10] << 8) | (long) s->buffer[11]);
if (s->dl != 0 && ((s->xd << (s->d - s->dl + 1)) != x &&
(s->yd << (s->d - s->dl + 1)) != y))
- return JBG_ENOCONT;
+ return JBG_ENOCONT | 3;
s->xd = x;
s->yd = y;
s->l0 = (((long) s->buffer[12] << 24) | ((long) s->buffer[13] << 16) |
((long) s->buffer[14] << 8) | (long) s->buffer[15]);
/* ITU-T T.85 trick not directly supported by decoder; for full
* T.85 compatibility with respect to all NEWLEN marker scenarios,
- * preprocess BIE with jbg_newlen() before passing it to the decoder. */
+ * preprocess BIE with jbg_newlen() before passing it to the decoder,
+ * or consider using the decoder found in jbig85.c instead. */
if (s->yd == 0xffffffff)
- return JBG_EIMPL;
- if (!s->planes || !s->xd || !s->yd || !s->l0)
- return JBG_EINVAL;
+ return JBG_EIMPL | 1;
+ if (!s->planes) return JBG_EINVAL | 5;
+ if (!s->xd) return JBG_EINVAL | 6;
+ if (!s->yd) return JBG_EINVAL | 7;
+ if (!s->l0) return JBG_EINVAL | 8;
/* prevent uint32 overflow: s->l0 * 2 ^ s->d < 2 ^ 32 */
- if (s->d > 31 || (s->d != 0 && s->l0 >= (1UL << (32 - s->d))))
- return JBG_EIMPL;
+ if (s->d > 31)
+ return JBG_EIMPL | 2;
+ if ((s->d != 0 && s->l0 >= (1UL << (32 - s->d))))
+ return JBG_EIMPL | 3;
s->mx = s->buffer[16];
if (s->mx > 127)
- return JBG_EINVAL;
+ return JBG_EINVAL | 9;
s->my = s->buffer[17];
#if 0
- if (s->my > 0)
- return JBG_EIMPL;
+ if (s->my > 0)
+ return JBG_EIMPL | 4;
#endif
s->order = s->buffer[18];
if (iindex[s->order & 7][0] < 0)
- return JBG_EINVAL;
+ return JBG_EINVAL | 10;
/* HITOLO and SEQ currently not yet implemented */
if (s->dl != s->d && (s->order & JBG_HITOLO || s->order & JBG_SEQ))
- return JBG_EIMPL;
+ return JBG_EIMPL | 5;
s->options = s->buffer[19];
/* calculate number of stripes that will be required */
@@ -2711,18 +2791,18 @@ int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
s->at_tx[s->at_moves] > (int) s->mx ||
s->at_ty[s->at_moves] > (int) s->my ||
(s->at_ty[s->at_moves] == 0 && s->at_tx[s->at_moves] < 0))
- return JBG_EINVAL;
+ return JBG_EINVAL | 11;
if (s->at_ty[s->at_moves] != 0)
- return JBG_EIMPL;
+ return JBG_EIMPL | 6;
s->at_moves++;
} else
- return JBG_EIMPL;
+ return JBG_EIMPL | 7; /* more than JBG_ATMOVES_MAX ATMOVES */
break;
case MARKER_NEWLEN:
y = (((long) s->buffer[2] << 24) | ((long) s->buffer[3] << 16) |
((long) s->buffer[4] << 8) | (long) s->buffer[5]);
- if (y > s->yd || !(s->options & JBG_VLENGTH))
- return JBG_EINVAL;
+ if (y > s->yd) return JBG_EINVAL | 12;
+ if (!(s->options & JBG_VLENGTH)) return JBG_EINVAL | 13;
s->yd = y;
/* calculate again number of stripes that will be required */
s->stripes = jbg_stripes(s->l0, s->yd, s->d);
@@ -2813,7 +2893,7 @@ int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
"%02x %02x %02x %02x ...\n", data[*cnt], data[*cnt+1],
data[*cnt+2], data[*cnt+3]);
#endif
- return JBG_EINVAL;
+ return JBG_EINVAL | 14;
}
}
@@ -2825,15 +2905,16 @@ int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
/*
* After jbg_dec_in() returned JBG_EOK or JBG_EOK_INTR, you can call this
- * function in order to find out the width of the image.
+ * function in order to find out the width of the image. Returns 0 if
+ * there is no image available yet.
*/
-long jbg_dec_getwidth(const struct jbg_dec_state *s)
+unsigned long jbg_dec_getwidth(const struct jbg_dec_state *s)
{
if (s->d < 0)
- return -1;
+ return 0;
if (iindex[s->order & 7][LAYER] == 0) {
if (s->ii[0] < 1)
- return -1;
+ return 0;
else
return jbg_ceil_half(s->xd, s->d - (s->ii[0] - 1));
}
@@ -2844,15 +2925,16 @@ long jbg_dec_getwidth(const struct jbg_dec_state *s)
/*
* After jbg_dec_in() returned JBG_EOK or JBG_EOK_INTR, you can call this
- * function in order to find out the height of the image.
+ * function in order to find out the height of the image. Returns 0 if
+ * there is no image available yet.
*/
-long jbg_dec_getheight(const struct jbg_dec_state *s)
+unsigned long jbg_dec_getheight(const struct jbg_dec_state *s)
{
if (s->d < 0)
- return -1;
+ return 0;
if (iindex[s->order & 7][LAYER] == 0) {
if (s->ii[0] < 1)
- return -1;
+ return 0;
else
return jbg_ceil_half(s->yd, s->d - (s->ii[0] - 1));
}
@@ -2863,7 +2945,8 @@ long jbg_dec_getheight(const struct jbg_dec_state *s)
/*
* After jbg_dec_in() returned JBG_EOK or JBG_EOK_INTR, you can call this
- * function in order to get a pointer to the image.
+ * function in order to get a pointer to the image. Returns NULL if
+ * there is no image available yet.
*/
unsigned char *jbg_dec_getimage(const struct jbg_dec_state *s, int plane)
{
@@ -2885,16 +2968,16 @@ unsigned char *jbg_dec_getimage(const struct jbg_dec_state *s, int plane)
* this function in order to find out the size in bytes of one
* bitplane of the image.
*/
-long jbg_dec_getsize(const struct jbg_dec_state *s)
+unsigned long jbg_dec_getsize(const struct jbg_dec_state *s)
{
if (s->d < 0)
- return -1;
+ return 0;
if (iindex[s->order & 7][LAYER] == 0) {
if (s->ii[0] < 1)
- return -1;
+ return 0;
else
return
- jbg_ceil_half(s->xd, s->d - (s->ii[0] - 1) + 3) *
+ jbg_ceil_half(s->xd, s->d - (s->ii[0] - 1) + 3) * /* overflow risk? */
jbg_ceil_half(s->yd, s->d - (s->ii[0] - 1));
}
@@ -2907,16 +2990,16 @@ long jbg_dec_getsize(const struct jbg_dec_state *s)
* this function in order to find out the size of the image that you
* can retrieve with jbg_merge_planes().
*/
-long jbg_dec_getsize_merged(const struct jbg_dec_state *s)
+unsigned long jbg_dec_getsize_merged(const struct jbg_dec_state *s)
{
if (s->d < 0)
- return -1;
+ return 0;
if (iindex[s->order & 7][LAYER] == 0) {
if (s->ii[0] < 1)
- return -1;
+ return 0;
else
return
- jbg_ceil_half(s->xd, s->d - (s->ii[0] - 1)) *
+ jbg_ceil_half(s->xd, s->d - (s->ii[0] - 1)) * /* overflow risk? */
jbg_ceil_half(s->yd, s->d - (s->ii[0] - 1)) *
((s->planes + 7) / 8);
}
@@ -2932,7 +3015,6 @@ long jbg_dec_getsize_merged(const struct jbg_dec_state *s)
void jbg_dec_free(struct jbg_dec_state *s)
{
int i;
- extern char jbg_dptable[];
if (s->d < 0 || s->s == NULL)
return;
@@ -3053,7 +3135,7 @@ void jbg_dec_merge_planes(const struct jbg_dec_state *s, int use_graycode,
x = jbg_dec_getwidth(s);
y = jbg_dec_getheight(s);
- if (x <= 0 || y <= 0)
+ if (x == 0 || y == 0)
return;
bpp = (s->planes + 7) / 8; /* bytes per pixel in dest image */
bpl = jbg_ceil_half(x, 3); /* bytes per line in src plane */
@@ -3098,7 +3180,12 @@ void jbg_dec_merge_planes(const struct jbg_dec_state *s, int use_graycode,
* PSCD, as well as the length len of the remaining data, return
* either the pointer to the first byte of the next marker segment or
* PSCD, or p+len if this was the last one, or NULL if some error was
- * encountered.
+ * encountered. Possible errors are:
+ *
+ * - not enough bytes left for complete marker segment
+ * - no marker segment terminates the PSCD
+ * - unknown marker code encountered
+ *
*/
unsigned char *jbg_next_pscdms(unsigned char *p, size_t len)
{
@@ -3106,17 +3193,20 @@ unsigned char *jbg_next_pscdms(unsigned char *p, size_t len)
unsigned long l;
if (len < 2)
- return NULL;
+ return NULL; /* not enough bytes left for complete marker segment */
if (p[0] != MARKER_ESC || p[1] == MARKER_STUFF) {
do {
while (p[0] == MARKER_ESC && p[1] == MARKER_STUFF) {
p += 2;
len -= 2;
- if (len < 2) return NULL;
+ if (len < 2)
+ return NULL; /* not enough bytes left for complete marker segment */
}
+ assert(len >= 2);
pp = (unsigned char *) memchr(p, MARKER_ESC, len - 1);
- if (!pp) return NULL;
+ if (!pp)
+ return NULL; /* no marker segment terminates the PSCD */
l = pp - p;
assert(l < len);
p += l;
@@ -3129,18 +3219,23 @@ unsigned char *jbg_next_pscdms(unsigned char *p, size_t len)
case MARKER_ABORT:
return p + 2;
case MARKER_NEWLEN:
- if (len < 6) return NULL;
+ if (len < 6)
+ return NULL; /* not enough bytes left for complete marker segment */
return p + 6;
case MARKER_ATMOVE:
- if (len < 8) return NULL;
+ if (len < 8)
+ return NULL; /* not enough bytes left for complete marker segment */
return p + 8;
case MARKER_COMMENT:
- if (len < 6) return NULL;
+ if (len < 6)
+ return NULL; /* not enough bytes left for complete marker segment */
l = (((long) p[2] << 24) | ((long) p[3] << 16) |
((long) p[4] << 8) | (long) p[5]);
- if (len - 6 < l) return NULL;
+ if (len - 6 < l)
+ return NULL; /* not enough bytes left for complete marker segment */
return p + 6 + l;
default:
+ /* unknown marker sequence encountered */
return NULL;
}
}
@@ -3190,5 +3285,5 @@ int jbg_newlen(unsigned char *bie, size_t len)
return JBG_EABORT;
}
}
- return JBG_EINVAL;
+ return JBG_EINVAL | 0;
}
diff --git a/jbig.h b/jbig.h
index c095a14..250977e 100644
--- a/jbig.h
+++ b/jbig.h
@@ -1,22 +1,32 @@
/*
- * Header file for the portable free JBIG compression library
+ * Header file for the portable JBIG compression library
*
- * Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/
+ * Copyright 1995-2008 -- Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/
*
- * Id: jbig.h,v 1.17 2004-06-11 15:18:21+01 mgk25 Exp $
- * $Id: jbig.h,v 1.3 2004/06/12 02:33:05 rick Exp $
+ * $Id: jbig.h,v 1.4 2008/09/05 15:05:54 rick Exp $
*/
#ifndef JBG_H
#define JBG_H
#include <stddef.h>
+#include "jbig_ar.h"
/*
* JBIG-KIT version number
*/
-#define JBG_VERSION "1.6"
+#define JBG_VERSION "2.0"
+
+/*
+ * JBIG-KIT licence agreement reference code:
+ * If you use JBIG-KIT under a commercial licence, please replace
+ * below the letters GPL with the reference code that you received
+ * with your licence agreement. (This code is typically a letter "A"
+ * followed by four decimal digits, e.g. "A1234".)
+ */
+
+#define JBG_LICENCE "GPL"
/*
* Buffer block for SDEs which are temporarily stored by encoder
@@ -57,84 +67,30 @@ struct jbg_buf {
#define JBG_DPPRIV 0x02
#define JBG_DPLAST 0x01
-#define JBG_DELAY_AT 0x100 /* delay ATMOVE until the first line of the next
+/* encoding options that will not be indicated in the header */
+
+#define JBG_DELAY_AT 0x100 /* Delay ATMOVE until the first line of the next
* stripe. Option available for compatibility
- * with conformance test example in clause 7.2.*/
+ * with conformance test example in clause 7.2. */
+#define JBG_SDRST 0x200 /* Use SDRST instead of SDNORM. This option is
+ * there for anyone who needs to generate
+ * test data that covers the SDRST cases. */
/*
* Possible error code return values
*/
-#define JBG_EOK 0
-#define JBG_EOK_INTR 1
-#define JBG_EAGAIN 2
-#define JBG_ENOMEM 3
-#define JBG_EABORT 4
-#define JBG_EMARKER 5
-#define JBG_ENOCONT 6
-#define JBG_EINVAL 7
-#define JBG_EIMPL 8
-
-/*
- * Language code for error message strings (based on ISO 639 2-letter
- * standard language name abbreviations).
- */
-
-#define JBG_EN 0 /* English */
-#define JBG_DE_8859_1 1 /* German in ISO Latin 1 character set */
-#define JBG_DE_UTF_8 2 /* German in Unicode UTF-8 encoding */
-
-/*
- * Status description of an arithmetic encoder
- */
-
-struct jbg_arenc_state {
- unsigned char st[4096]; /* probability status for contexts, MSB = MPS */
- unsigned long c; /* C register, base of coding intervall, *
- * layout as in Table 23 */
- unsigned long a; /* A register, normalized size of coding intervall */
- long sc; /* counter for buffered 0xff values which might overflow */
- int ct; /* bit shift counter, determines when next byte will be written */
- int buffer; /* buffer for most recent output byte != 0xff */
- void (*byte_out)(int, void *); /* function which receives all PSCD bytes */
- void *file; /* parameter passed to byte_out */
-};
-
-
-/*
- * Status description of an arithmetic decoder
- */
-
-enum jbg_ardec_result {
- JBG_OK, /* symbol has been successfully decoded */
- JBG_READY, /* no more bytes of this PSCD required, marker *
- * encountered, probably more symbols available */
- JBG_MORE, /* more PSCD data bytes required to decode a symbol */
- JBG_MARKER /* more PSCD data bytes required, ignored final 0xff byte */
-};
-
-struct jbg_ardec_state {
- unsigned char st[4096]; /* probability status for contexts, MSB = MPS */
- unsigned long c; /* C register, base of coding intervall, *
- * layout as in Table 25 */
- unsigned long a; /* A register, normalized size of coding intervall */
- int ct; /* bit shift counter, determines when next byte will be read */
- unsigned char *pscd_ptr; /* pointer to next PSCD data byte */
- unsigned char *pscd_end; /* pointer to byte after PSCD */
- enum jbg_ardec_result result; /* result of previous decode call */
- int startup; /* controls initial fill of s->c */
-};
-
-#ifdef TEST_CODEC
-void arith_encode_init(struct jbg_arenc_state *s, int reuse_st);
-void arith_encode_flush(struct jbg_arenc_state *s);
-void arith_encode(struct jbg_arenc_state *s, int cx, int pix);
-void arith_decode_init(struct jbg_ardec_state *s, int reuse_st);
-int arith_decode(struct jbg_ardec_state *s, int cx);
-#endif
+#define JBG_EOK (0 << 4)
+#define JBG_EOK_INTR (1 << 4)
+#define JBG_EAGAIN (2 << 4)
+#define JBG_ENOMEM (3 << 4)
+#define JBG_EABORT (4 << 4)
+#define JBG_EMARKER (5 << 4)
+#define JBG_EINVAL (6 << 4)
+#define JBG_EIMPL (7 << 4)
+#define JBG_ENOCONT (8 << 4)
-
/*
* Status of a JBIG encoder
*/
@@ -166,6 +122,10 @@ struct jbg_enc_state {
/* data write callback */
void *file; /* parameter passed to data_out() */
char *tp; /* buffer for temp. values used by diff. typical prediction */
+ unsigned char *comment; /* content of comment marker segment to be added
+ at next opportunity (will be reset to NULL
+ as soon as comment has been written) */
+ unsigned long comment_len; /* length of data pointed to by comment */
};
@@ -250,17 +210,17 @@ void jbg_dec_maxsize(struct jbg_dec_state *s, unsigned long xmax,
unsigned long ymax);
int jbg_dec_in(struct jbg_dec_state *s, unsigned char *data, size_t len,
size_t *cnt);
-long jbg_dec_getwidth(const struct jbg_dec_state *s);
-long jbg_dec_getheight(const struct jbg_dec_state *s);
+unsigned long jbg_dec_getwidth(const struct jbg_dec_state *s);
+unsigned long jbg_dec_getheight(const struct jbg_dec_state *s);
unsigned char *jbg_dec_getimage(const struct jbg_dec_state *s, int plane);
-long jbg_dec_getsize(const struct jbg_dec_state *s);
+unsigned long jbg_dec_getsize(const struct jbg_dec_state *s);
void jbg_dec_merge_planes(const struct jbg_dec_state *s, int use_graycode,
void (*data_out)(unsigned char *start, size_t len,
void *file), void *file);
-long jbg_dec_getsize_merged(const struct jbg_dec_state *s);
+unsigned long jbg_dec_getsize_merged(const struct jbg_dec_state *s);
void jbg_dec_free(struct jbg_dec_state *s);
-const char *jbg_strerror(int errnum, int language);
+const char *jbg_strerror(int errnum);
void jbg_int2dppriv(unsigned char *dptable, const char *internal);
void jbg_dppriv2int(char *internal, const unsigned char *dptable);
unsigned long jbg_ceil_half(unsigned long x, int n);
diff --git a/jbig_ar.c b/jbig_ar.c
new file mode 100644
index 0000000..29f13bd
--- /dev/null
+++ b/jbig_ar.c
@@ -0,0 +1,426 @@
+/*
+ * Arithmetic encoder and decoder of the portable JBIG
+ * compression library
+ *
+ * Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/jbigkit/
+ *
+ * This module implements a portable standard C arithmetic encoder
+ * and decoder used by the JBIG lossless bi-level image compression
+ * algorithm as specified in International Standard ISO 11544:1993
+ * and ITU-T Recommendation T.82.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * If you want to use this program under different license conditions,
+ * then contact the author for an arrangement.
+ *
+ * It is possible that certain products which can be built using this
+ * software module might form inventions protected by patent rights in
+ * some countries (e.g., by patents about arithmetic coding algorithms
+ * owned by IBM and AT&T in the USA). Provision of this software by the
+ * author does NOT include any licences for any patents. In those
+ * countries where a patent licence is required for certain applications
+ * of this software module, you will have to obtain such a licence
+ * yourself.
+ */
+
+#include <assert.h>
+#include "jbig_ar.h"
+
+/*
+ * Probability estimation tables for the arithmetic encoder/decoder
+ * given by ITU T.82 Table 24.
+ */
+
+static short lsztab[113] = {
+ 0x5a1d, 0x2586, 0x1114, 0x080b, 0x03d8, 0x01da, 0x00e5, 0x006f,
+ 0x0036, 0x001a, 0x000d, 0x0006, 0x0003, 0x0001, 0x5a7f, 0x3f25,
+ 0x2cf2, 0x207c, 0x17b9, 0x1182, 0x0cef, 0x09a1, 0x072f, 0x055c,
+ 0x0406, 0x0303, 0x0240, 0x01b1, 0x0144, 0x00f5, 0x00b7, 0x008a,
+ 0x0068, 0x004e, 0x003b, 0x002c, 0x5ae1, 0x484c, 0x3a0d, 0x2ef1,
+ 0x261f, 0x1f33, 0x19a8, 0x1518, 0x1177, 0x0e74, 0x0bfb, 0x09f8,
+ 0x0861, 0x0706, 0x05cd, 0x04de, 0x040f, 0x0363, 0x02d4, 0x025c,
+ 0x01f8, 0x01a4, 0x0160, 0x0125, 0x00f6, 0x00cb, 0x00ab, 0x008f,
+ 0x5b12, 0x4d04, 0x412c, 0x37d8, 0x2fe8, 0x293c, 0x2379, 0x1edf,
+ 0x1aa9, 0x174e, 0x1424, 0x119c, 0x0f6b, 0x0d51, 0x0bb6, 0x0a40,
+ 0x5832, 0x4d1c, 0x438e, 0x3bdd, 0x34ee, 0x2eae, 0x299a, 0x2516,
+ 0x5570, 0x4ca9, 0x44d9, 0x3e22, 0x3824, 0x32b4, 0x2e17, 0x56a8,
+ 0x4f46, 0x47e5, 0x41cf, 0x3c3d, 0x375e, 0x5231, 0x4c0f, 0x4639,
+ 0x415e, 0x5627, 0x50e7, 0x4b85, 0x5597, 0x504f, 0x5a10, 0x5522,
+ 0x59eb
+};
+
+static unsigned char nmpstab[113] = {
+ 1, 2, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 13, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 9, 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, 32,
+ 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 48,
+ 81, 82, 83, 84, 85, 86, 87, 71,
+ 89, 90, 91, 92, 93, 94, 86, 96,
+ 97, 98, 99, 100, 93, 102, 103, 104,
+ 99, 106, 107, 103, 109, 107, 111, 109,
+ 111
+};
+
+/*
+ * least significant 7 bits (mask 0x7f) of nlpstab[] contain NLPS value,
+ * most significant bit (mask 0x80) contains SWTCH bit
+ */
+static unsigned char nlpstab[113] = {
+ 129, 14, 16, 18, 20, 23, 25, 28,
+ 30, 33, 35, 9, 10, 12, 143, 36,
+ 38, 39, 40, 42, 43, 45, 46, 48,
+ 49, 51, 52, 54, 56, 57, 59, 60,
+ 62, 63, 32, 33, 165, 64, 65, 67,
+ 68, 69, 70, 72, 73, 74, 75, 77,
+ 78, 79, 48, 50, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 61, 61,
+ 193, 80, 81, 82, 83, 84, 86, 87,
+ 87, 72, 72, 74, 74, 75, 77, 77,
+ 208, 88, 89, 90, 91, 92, 93, 86,
+ 216, 95, 96, 97, 99, 99, 93, 223,
+ 101, 102, 103, 104, 99, 105, 106, 107,
+ 103, 233, 108, 109, 110, 111, 238, 112,
+ 240
+};
+
+/*
+ * The next functions implement the arithmedic encoder and decoder
+ * required for JBIG. The same algorithm is also used in the arithmetic
+ * variant of JPEG.
+ */
+
+/* marker codes */
+#define MARKER_STUFF 0x00
+#define MARKER_ESC 0xff
+
+void arith_encode_init(struct jbg_arenc_state *s, int reuse_st)
+{
+ int i;
+
+ if (!reuse_st)
+ for (i = 0; i < 4096; s->st[i++] = 0);
+ s->c = 0;
+ s->a = 0x10000L;
+ s->sc = 0;
+ s->ct = 11;
+ s->buffer = -1; /* empty */
+
+ return;
+}
+
+
+void arith_encode_flush(struct jbg_arenc_state *s)
+{
+ unsigned long temp;
+
+ /* find the s->c in the coding interval with the largest
+ * number of trailing zero bits */
+ if ((temp = (s->a - 1 + s->c) & 0xffff0000L) < s->c)
+ s->c = temp + 0x8000;
+ else
+ s->c = temp;
+ /* send remaining bytes to output */
+ s->c <<= s->ct;
+ if (s->c & 0xf8000000L) {
+ /* one final overflow has to be handled */
+ if (s->buffer >= 0) {
+ s->byte_out(s->buffer + 1, s->file);
+ if (s->buffer + 1 == MARKER_ESC)
+ s->byte_out(MARKER_STUFF, s->file);
+ }
+ /* output 0x00 bytes only when more non-0x00 will follow */
+ if (s->c & 0x7fff800L)
+ for (; s->sc; --s->sc)
+ s->byte_out(0x00, s->file);
+ } else {
+ if (s->buffer >= 0)
+ s->byte_out(s->buffer, s->file);
+ /* T.82 figure 30 says buffer+1 for the above line! Typo? */
+ for (; s->sc; --s->sc) {
+ s->byte_out(0xff, s->file);
+ s->byte_out(MARKER_STUFF, s->file);
+ }
+ }
+ /* output final bytes only if they are not 0x00 */
+ if (s->c & 0x7fff800L) {
+ s->byte_out((s->c >> 19) & 0xff, s->file);
+ if (((s->c >> 19) & 0xff) == MARKER_ESC)
+ s->byte_out(MARKER_STUFF, s->file);
+ if (s->c & 0x7f800L) {
+ s->byte_out((s->c >> 11) & 0xff, s->file);
+ if (((s->c >> 11) & 0xff) == MARKER_ESC)
+ s->byte_out(MARKER_STUFF, s->file);
+ }
+ }
+
+ return;
+}
+
+
+void arith_encode(struct jbg_arenc_state *s, int cx, int pix)
+{
+ register unsigned lsz, ss;
+ register unsigned char *st;
+ long temp;
+
+ assert(cx >= 0 && cx < 4096);
+ st = s->st + cx;
+ ss = *st & 0x7f;
+ assert(ss < 113);
+ lsz = lsztab[ss];
+
+#if 0
+ fprintf(stderr, "pix = %d, cx = %d, mps = %d, st = %3d, lsz = 0x%04x, "
+ "a = 0x%05lx, c = 0x%08lx, ct = %2d, buf = 0x%02x\n",
+ pix, cx, !!(s->st[cx] & 0x80), ss, lsz, s->a, s->c, s->ct,
+ s->buffer);
+#endif
+
+ if (((pix << 7) ^ s->st[cx]) & 0x80) {
+ /* encode the less probable symbol */
+ if ((s->a -= lsz) >= lsz) {
+ /* If the interval size (lsz) for the less probable symbol (LPS)
+ * is larger than the interval size for the MPS, then exchange
+ * the two symbols for coding efficiency, otherwise code the LPS
+ * as usual: */
+ s->c += s->a;
+ s->a = lsz;
+ }
+ /* Check whether MPS/LPS exchange is necessary
+ * and chose next probability estimator status */
+ *st &= 0x80;
+ *st ^= nlpstab[ss];
+ } else {
+ /* encode the more probable symbol */
+ if ((s->a -= lsz) & 0xffff8000L)
+ return; /* A >= 0x8000 -> ready, no renormalization required */
+ if (s->a < lsz) {
+ /* If the interval size (lsz) for the less probable symbol (LPS)
+ * is larger than the interval size for the MPS, then exchange
+ * the two symbols for coding efficiency: */
+ s->c += s->a;
+ s->a = lsz;
+ }
+ /* chose next probability estimator status */
+ *st &= 0x80;
+ *st |= nmpstab[ss];
+ }
+
+ /* renormalization of coding interval */
+ do {
+ s->a <<= 1;
+ s->c <<= 1;
+ --s->ct;
+ if (s->ct == 0) {
+ /* another byte is ready for output */
+ temp = s->c >> 19;
+ if (temp & 0xffffff00L) {
+ /* handle overflow over all buffered 0xff bytes */
+ if (s->buffer >= 0) {
+ ++s->buffer;
+ s->byte_out(s->buffer, s->file);
+ if (s->buffer == MARKER_ESC)
+ s->byte_out(MARKER_STUFF, s->file);
+ }
+ for (; s->sc; --s->sc)
+ s->byte_out(0x00, s->file);
+ s->buffer = temp & 0xff; /* new output byte, might overflow later */
+ assert(s->buffer != 0xff);
+ /* can s->buffer really never become 0xff here? */
+ } else if (temp == 0xff) {
+ /* buffer 0xff byte (which might overflow later) */
+ ++s->sc;
+ } else {
+ /* output all buffered 0xff bytes, they will not overflow any more */
+ if (s->buffer >= 0)
+ s->byte_out(s->buffer, s->file);
+ for (; s->sc; --s->sc) {
+ s->byte_out(0xff, s->file);
+ s->byte_out(MARKER_STUFF, s->file);
+ }
+ s->buffer = temp; /* buffer new output byte (can still overflow) */
+ }
+ s->c &= 0x7ffffL;
+ s->ct = 8;
+ }
+ } while (s->a < 0x8000);
+
+ return;
+}
+
+
+void arith_decode_init(struct jbg_ardec_state *s, int reuse_st)
+{
+ int i;
+
+ if (!reuse_st)
+ for (i = 0; i < 4096; s->st[i++] = 0);
+ s->c = 0;
+ s->a = 1;
+ s->ct = 0;
+ s->startup = 1;
+ s->nopadding = 0;
+ return;
+}
+
+/*
+ * Decode and return one symbol from the provided PSCD byte stream
+ * that starts in s->pscd_ptr and ends in the byte before s->pscd_end.
+ * The context cx is a 12-bit integer in the range 0..4095. This
+ * function will advance s->pscd_ptr each time it has consumed all
+ * information from that PSCD byte.
+ *
+ * If a symbol has been decoded successfully, the return value will be
+ * 0 or 1 (depending on the symbol).
+ *
+ * If the decoder was not able to decode a symbol from the provided
+ * PSCD, then the return value will be -1, and two cases can be
+ * distinguished:
+ *
+ * s->pscd_ptr == s->pscd_end:
+ *
+ * The decoder has used up all information in the provided PSCD
+ * bytes. Further PSCD bytes have to be provided (via new values of
+ * s->pscd_ptr and/or s->pscd_end) before another symbol can be
+ * decoded.
+ *
+ * s->pscd_ptr == s->pscd_end - 1:
+ *
+ * The decoder has used up all provided PSCD bytes except for the
+ * very last byte, because that has the value 0xff. The decoder can
+ * at this point not yet tell whether this 0xff belongs to a
+ * MARKER_STUFF sequence or marks the end of the PSCD. Further PSCD
+ * bytes have to be provided (via new values of s->pscd_ptr and/or
+ * s->pscd_end), including the not yet processed 0xff byte, before
+ * another symbol can be decoded successfully.
+ *
+ * If s->nopadding != 0, the decoder will return -2 when it reaches
+ * the first two bytes of the marker segment that follows (and
+ * terminates) the PSCD, but before decoding the first symbol that
+ * depends on a bit in the input data that could have been the result
+ * of zero padding, and might, therefore, never have been encoded.
+ * This gives the caller the opportunity to lookahead early enough
+ * beyond a terminating SDNORM/SDRST for a trailing NEWLEN (as
+ * required by T.85) before decoding remaining symbols. Call the
+ * decoder again afterwards as often as necessary (leaving s->pscd_ptr
+ * pointing to the start of the marker segment) to retrieve any
+ * required remaining symbols that might depend on padding.
+ *
+ * [Note that each PSCD can be decoded into an infinitely long
+ * sequence of symbols, because the encoder might have truncated away
+ * an arbitrarily long sequence of trailing 0x00 bytes, which the
+ * decoder will append automatically as needed when it reaches the end
+ * of the PSCD. Therefore, the decoder cannot report any end of the
+ * symbol sequence and other means (external to the PSCD and
+ * arithmetic decoding process) are needed to determine that.]
+ */
+
+int arith_decode(struct jbg_ardec_state *s, int cx)
+{
+ register unsigned lsz, ss;
+ register unsigned char *st;
+ int pix;
+
+ /* renormalization */
+ while (s->a < 0x8000 || s->startup) {
+ while (s->ct <= 8 && s->ct >= 0) {
+ /* first we can move a new byte into s->c */
+ if (s->pscd_ptr >= s->pscd_end) {
+ return -1; /* more bytes needed */
+ }
+ if (*s->pscd_ptr == 0xff)
+ if (s->pscd_ptr + 1 >= s->pscd_end) {
+ return -1; /* final 0xff byte not processed */
+ } else {
+ if (*(s->pscd_ptr + 1) == MARKER_STUFF) {
+ s->c |= 0xffL << (8 - s->ct);
+ s->ct += 8;
+ s->pscd_ptr += 2;
+ } else {
+ s->ct = -1; /* start padding with zero bytes */
+ if (s->nopadding) {
+ s->nopadding = 0;
+ return -2; /* subsequent symbols might depend on zero padding */
+ }
+ }
+ }
+ else {
+ s->c |= (long)*(s->pscd_ptr++) << (8 - s->ct);
+ s->ct += 8;
+ }
+ }
+ s->c <<= 1;
+ s->a <<= 1;
+ if (s->ct >= 0) s->ct--;
+ if (s->a == 0x10000L)
+ s->startup = 0;
+ }
+
+ st = s->st + cx;
+ ss = *st & 0x7f;
+ assert(ss < 113);
+ lsz = lsztab[ss];
+
+#if 0
+ fprintf(stderr, "cx = %d, mps = %d, st = %3d, lsz = 0x%04x, a = 0x%05lx, "
+ "c = 0x%08lx, ct = %2d\n",
+ cx, !!(s->st[cx] & 0x80), ss, lsz, s->a, s->c, s->ct);
+#endif
+
+ if ((s->c >> 16) < (s->a -= lsz))
+ if (s->a & 0xffff8000L)
+ return *st >> 7;
+ else {
+ /* MPS_EXCHANGE */
+ if (s->a < lsz) {
+ pix = 1 - (*st >> 7);
+ /* Check whether MPS/LPS exchange is necessary
+ * and chose next probability estimator status */
+ *st &= 0x80;
+ *st ^= nlpstab[ss];
+ } else {
+ pix = *st >> 7;
+ *st &= 0x80;
+ *st |= nmpstab[ss];
+ }
+ }
+ else {
+ /* LPS_EXCHANGE */
+ if (s->a < lsz) {
+ s->c -= s->a << 16;
+ s->a = lsz;
+ pix = *st >> 7;
+ *st &= 0x80;
+ *st |= nmpstab[ss];
+ } else {
+ s->c -= s->a << 16;
+ s->a = lsz;
+ pix = 1 - (*st >> 7);
+ /* Check whether MPS/LPS exchange is necessary
+ * and chose next probability estimator status */
+ *st &= 0x80;
+ *st ^= nlpstab[ss];
+ }
+ }
+
+ return pix;
+}
diff --git a/jbig_ar.h b/jbig_ar.h
new file mode 100644
index 0000000..8902759
--- /dev/null
+++ b/jbig_ar.h
@@ -0,0 +1,55 @@
+/*
+ * Header file for the arithmetic encoder and decoder of
+ * the portable JBIG compression library
+ *
+ * Markus Kuhn -- http://www.cl.cam.ac.uk/~mgk25/jbigkit/
+ *
+ * $Id: jbig_ar.h,v 1.1 2008/09/05 15:05:54 rick Exp $
+ */
+
+#ifndef JBG_AR_H
+#define JBG_AR_H
+
+/*
+ * Status of arithmetic encoder
+ */
+
+struct jbg_arenc_state {
+ unsigned char st[4096]; /* probability status for contexts, MSB = MPS */
+ unsigned long c; /* register C: base of coding intervall, *
+ * layout as in Table 23 */
+ unsigned long a; /* register A: normalized size of coding interval */
+ long sc; /* number of buffered 0xff values that might still overflow */
+ int ct; /* bit shift counter, determines when next byte will be written */
+ int buffer; /* buffer for most recent output byte != 0xff */
+ void (*byte_out)(int, void *); /* function that receives all PSCD bytes */
+ void *file; /* parameter passed to byte_out */
+};
+
+/*
+ * Status of arithmetic decoder
+ */
+
+struct jbg_ardec_state {
+ unsigned char st[4096]; /* probability status for contexts, MSB = MPS */
+ unsigned long c; /* register C: base of coding intervall, *
+ * layout as in Table 25 */
+ unsigned long a; /* register A: normalized size of coding interval */
+ unsigned char *pscd_ptr; /* pointer to next PSCD data byte */
+ unsigned char *pscd_end; /* pointer to byte after PSCD */
+ int ct; /* bit-shift counter, determines when next byte will be read;
+ * special value -1 signals that zero-padding has started */
+ int startup; /* boolean flag that controls initial fill of s->c */
+ int nopadding; /* boolean flag that triggers return -2 between
+ * reaching PSCD end and decoding the first symbol
+ * that might never have been encoded in the first
+ * place */
+};
+
+void arith_encode_init(struct jbg_arenc_state *s, int reuse_st);
+void arith_encode_flush(struct jbg_arenc_state *s);
+void arith_encode(struct jbg_arenc_state *s, int cx, int pix);
+void arith_decode_init(struct jbg_ardec_state *s, int reuse_st);
+int arith_decode(struct jbg_ardec_state *s, int cx);
+
+#endif /* JBG_AR_H */
diff --git a/jbig_tab.c b/jbig_tab.c
deleted file mode 100644
index bea768a..0000000
--- a/jbig_tab.c
+++ /dev/null
@@ -1,429 +0,0 @@
-/*
- * Probability estimation tables for the arithmetic encoder/decoder
- * given by ITU T.82 Table 24.
- *
- * Id: jbig_tab.c,v 1.6 1998-04-05 18:36:19+01 mgk25 Rel $
- * $Id: jbig_tab.c,v 1.3 2004/06/12 02:33:05 rick Exp $
- */
-
-short jbg_lsz[113] = {
- 0x5a1d, 0x2586, 0x1114, 0x080b, 0x03d8, 0x01da, 0x00e5, 0x006f,
- 0x0036, 0x001a, 0x000d, 0x0006, 0x0003, 0x0001, 0x5a7f, 0x3f25,
- 0x2cf2, 0x207c, 0x17b9, 0x1182, 0x0cef, 0x09a1, 0x072f, 0x055c,
- 0x0406, 0x0303, 0x0240, 0x01b1, 0x0144, 0x00f5, 0x00b7, 0x008a,
- 0x0068, 0x004e, 0x003b, 0x002c, 0x5ae1, 0x484c, 0x3a0d, 0x2ef1,
- 0x261f, 0x1f33, 0x19a8, 0x1518, 0x1177, 0x0e74, 0x0bfb, 0x09f8,
- 0x0861, 0x0706, 0x05cd, 0x04de, 0x040f, 0x0363, 0x02d4, 0x025c,
- 0x01f8, 0x01a4, 0x0160, 0x0125, 0x00f6, 0x00cb, 0x00ab, 0x008f,
- 0x5b12, 0x4d04, 0x412c, 0x37d8, 0x2fe8, 0x293c, 0x2379, 0x1edf,
- 0x1aa9, 0x174e, 0x1424, 0x119c, 0x0f6b, 0x0d51, 0x0bb6, 0x0a40,
- 0x5832, 0x4d1c, 0x438e, 0x3bdd, 0x34ee, 0x2eae, 0x299a, 0x2516,
- 0x5570, 0x4ca9, 0x44d9, 0x3e22, 0x3824, 0x32b4, 0x2e17, 0x56a8,
- 0x4f46, 0x47e5, 0x41cf, 0x3c3d, 0x375e, 0x5231, 0x4c0f, 0x4639,
- 0x415e, 0x5627, 0x50e7, 0x4b85, 0x5597, 0x504f, 0x5a10, 0x5522,
- 0x59eb
-};
-
-unsigned char jbg_nmps[113] = {
- 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 13, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 9, 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, 32,
- 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 48,
- 81, 82, 83, 84, 85, 86, 87, 71,
- 89, 90, 91, 92, 93, 94, 86, 96,
- 97, 98, 99, 100, 93, 102, 103, 104,
- 99, 106, 107, 103, 109, 107, 111, 109,
- 111
-};
-
-/*
- * least significant 7 bits (mask 0x7f) of jbg_nlps[] contain NLPS value,
- * most significant bit (mask 0x80) contains SWTCH bit
- */
-unsigned char jbg_nlps[113] = {
- 129, 14, 16, 18, 20, 23, 25, 28,
- 30, 33, 35, 9, 10, 12, 143, 36,
- 38, 39, 40, 42, 43, 45, 46, 48,
- 49, 51, 52, 54, 56, 57, 59, 60,
- 62, 63, 32, 33, 165, 64, 65, 67,
- 68, 69, 70, 72, 73, 74, 75, 77,
- 78, 79, 48, 50, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 61, 61,
- 193, 80, 81, 82, 83, 84, 86, 87,
- 87, 72, 72, 74, 74, 75, 77, 77,
- 208, 88, 89, 90, 91, 92, 93, 86,
- 216, 95, 96, 97, 99, 99, 93, 223,
- 101, 102, 103, 104, 99, 105, 106, 107,
- 103, 233, 108, 109, 110, 111, 238, 112,
- 240
-};
-
-/*
- * Resolution reduction table given by ITU-T T.82 Table 17
- */
-
-char jbg_resred[4096] = {
- 0,0,0,1,0,0,0,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
- 0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,1,0,1,0,0,1,1,1,0,1,1,
- 0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,1,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
- 1,0,0,1,0,0,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,0,1,1,1,0,
- 0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,1,0,0,0,1,0,1,1,0,1,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
- 1,1,1,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
- 1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,
- 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,1,1,0,1,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,0,1,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,0,1,1,
- 1,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,
- 0,0,1,0,1,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,0,
- 0,0,0,0,1,0,0,1,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,
- 0,0,1,0,0,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,
- 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,1,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,1,0,1,0,1,1,0,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,1,1,0,0,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,1,
- 0,0,1,0,0,1,1,1,0,0,0,0,1,0,0,1,0,0,0,1,1,1,1,0,1,0,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,
- 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,1,1,1,0,1,1,1,
- 0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,1,1,0,1,0,0,0,1,1,0,1,0,0,0,0,1,1,1,1,0,0,1,1,1,0,1,1,0,0,1,1,
- 0,0,0,0,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,0,0,1,1,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,1,0,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,1,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
- 0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,
- 0,0,0,1,0,0,0,1,0,0,1,0,0,0,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,1,1,0,1,1,1,0,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,1,0,0,1,0,0,1,1,0,0,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,1,0,1,1,
- 1,0,1,0,1,0,0,1,1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,1,1,0,1,1,1,
- 0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,0,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,1,0,1,0,1,0,1,1,0,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,
- 1,1,1,0,1,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
- 1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,
- 0,0,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,1,1,0,1,1,0,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,1,0,1,0,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
- 1,0,0,0,1,0,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,0,1,1,0,
- 0,0,1,1,1,1,1,1,0,0,0,0,1,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,1,0,0,0,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
- 0,0,1,0,1,0,1,1,0,0,1,0,1,1,1,1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,0,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,
- 0,0,1,0,1,0,1,1,0,1,1,1,1,1,1,1,0,0,1,1,1,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,
- 0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,1,
- 0,0,0,0,0,0,0,1,0,1,1,1,0,1,0,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,1,0,1,0,0,1,0,0,1,0,0,0,0,0,0,0,1,
- 0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,
- 1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,1,0,0,1,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,
- 0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
- 0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,1,0,1,1,1,1,1,1,1,
- 0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,
- 0,0,0,0,0,0,0,1,0,1,0,1,0,1,0,0,0,0,1,1,0,0,0,1,0,1,1,1,0,1,1,1
-};
-
-/*
- * Deterministic prediction tables given by ITU-T T.82 tables
- * 19 to 22. The table below is organized differently, the
- * index bits are permutated for higher efficiency.
- */
-
-char jbg_dptable[256 + 512 + 2048 + 4096] = {
- /* phase 0: offset=0 */
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,0,2,2,2,2,2,2,2,
- 0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,0,2,0,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- /* phase 1: offset=256 */
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,2,2,2,0,2,0,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,2,2,2,2,0,2,2,2,2,2,2,2,
- 0,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,0,0,2,2,2,2,2,0,0,2,2,2,2,2,
- 0,2,2,2,2,1,2,1,2,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,
- 1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,1,1,2,2,2,2,2,0,2,2,2,2,2,2,
- 2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,0,2,0,2,2,2,2,2,0,2,2,2,2,2,2,2,
- 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
- 2,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,1,
- 0,2,0,2,2,1,2,1,2,2,2,2,1,1,1,1,0,0,0,0,2,2,2,2,0,2,0,2,2,2,2,1,
- 2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,0,0,0,2,2,2,2,2,
- 2,2,2,2,2,1,2,1,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,1,2,1,2,2,2,2,1,
- 2,2,2,2,2,2,2,2,0,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,0,0,0,2,2,2,2,2,
- /* phase 2: offset=768 */
- 2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
- 0,2,2,2,2,1,2,1,2,2,2,2,1,2,1,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,1,2,2,2,2,2,1,1,1,
- 2,0,2,2,2,1,2,1,0,2,2,2,1,2,1,2,2,2,2,0,2,2,2,2,0,2,0,2,2,2,2,2,
- 0,2,0,0,1,1,1,1,2,2,2,2,1,1,1,1,0,2,0,2,1,1,1,1,2,2,2,2,1,1,1,1,
- 2,2,0,2,2,2,1,2,2,2,2,2,1,2,1,2,2,2,0,2,2,1,2,1,0,2,0,2,1,1,1,1,
- 2,0,0,2,2,2,2,2,0,2,0,2,2,0,2,0,2,0,2,0,2,2,2,1,2,2,0,2,1,1,2,1,
- 2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
- 0,0,0,0,2,2,2,2,0,0,0,0,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,0,2,2,2,2,1,0,2,2,2,1,1,1,1,2,0,2,2,2,2,2,2,0,2,0,2,2,1,2,1,
- 2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,
- 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 2,2,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,0,0,2,2,1,2,1,0,2,2,2,1,1,1,1,
- 2,2,2,0,2,2,2,2,2,2,0,2,2,0,2,0,2,1,2,2,2,2,2,2,1,2,1,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,1,1,1,2,2,2,2,1,1,1,1,
- 2,2,2,1,2,2,2,2,2,2,1,2,0,0,0,0,2,2,0,2,2,1,2,2,2,2,2,2,1,1,1,1,
- 2,0,0,0,2,2,2,2,0,2,2,2,2,2,2,0,2,2,2,0,2,2,2,2,2,0,0,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,1,
- 0,2,0,2,2,1,1,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,
- 2,0,2,0,2,1,2,1,0,2,0,2,2,2,1,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,1,2,
- 2,2,2,0,2,2,2,2,2,2,0,2,2,2,2,2,2,2,1,2,2,2,2,2,2,0,1,2,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,2,1,2,1,0,2,2,2,1,1,1,1,
- 2,0,2,0,2,1,2,2,0,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,1,2,2,
- 2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,1,2,1,
- 2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,0,0,2,2,2,1,2,2,2,
- 0,0,2,0,2,2,2,2,0,2,0,2,2,0,2,0,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
- 2,2,0,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,2,2,2,2,1,1,1,1,
- 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 2,0,0,2,2,2,2,2,0,2,0,2,2,2,2,2,1,0,1,2,2,2,2,1,0,2,2,2,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,0,2,2,0,2,0,2,1,2,2,2,2,2,2,2,2,0,2,2,1,2,2,
- 0,2,0,0,1,1,1,1,0,2,2,2,1,1,1,1,2,2,2,2,2,2,2,2,2,0,2,2,1,2,1,1,
- 2,2,0,2,2,1,2,2,2,2,2,2,1,2,2,2,2,0,2,2,2,2,2,2,0,2,0,2,1,2,1,1,
- 2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,2,2,2,2,1,1,2,2,2,2,2,1,2,2,2,
- 2,0,2,2,2,1,2,1,0,2,2,2,2,2,1,2,2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,
- 0,2,0,0,2,2,2,2,1,2,2,2,2,2,2,0,2,1,2,2,2,2,2,2,1,2,2,2,2,2,2,2,
- 0,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,1,0,2,2,
- 0,0,0,2,2,1,1,1,2,2,2,2,1,2,2,2,2,0,2,0,2,2,2,1,2,2,2,2,1,2,1,2,
- 0,0,0,0,2,2,2,2,2,2,0,2,2,1,2,2,2,1,2,1,2,2,2,2,1,2,1,2,0,2,2,2,
- 2,0,2,0,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 0,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,1,2,2,2,2,2,0,2,2,1,2,2,0,0,0,2,2,2,2,2,1,2,2,0,2,2,2,1,2,1,2,
- 2,0,2,0,2,2,2,2,0,2,0,2,2,1,2,2,0,2,0,0,2,2,2,2,2,2,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,2,2,1,
- 1,2,0,2,2,1,2,1,2,2,2,2,1,2,2,2,2,0,2,0,2,2,2,2,2,0,2,2,1,1,1,1,
- 0,2,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,2,1,2,1,
- 2,2,0,0,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,
- 2,2,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,2,
- 2,0,2,0,2,2,2,2,2,1,1,2,2,2,2,2,2,2,2,2,2,2,2,1,0,2,0,2,2,2,1,2,
- 2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,2,0,2,0,2,2,2,2,0,0,0,0,2,1,2,1,
- 2,2,2,2,2,1,2,1,0,2,0,2,2,2,2,2,2,0,2,0,2,2,2,2,0,2,0,2,2,2,2,1,
- 2,0,2,0,2,2,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,
- 2,0,2,0,2,2,2,1,2,2,2,0,2,2,2,1,2,0,2,0,2,2,2,2,0,0,0,2,2,2,2,1,
- 2,0,2,0,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,
- /* phase 3: offset=2816 */
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,0,2,2,2,1,2,0,2,2,2,1,2,2,2,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,
- 2,2,2,1,2,2,2,0,1,1,1,1,0,0,0,0,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,0,2,0,2,1,2,1,
- 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,
- 2,0,2,2,2,1,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,2,0,1,1,2,1,
- 2,2,2,0,2,2,2,1,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,
- 2,0,0,2,2,1,1,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,1,1,1,2,0,0,0,
- 2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,2,2,2,0,2,2,2,1,2,0,2,0,2,1,2,1,
- 2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
- 2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,0,2,0,2,1,2,1,0,0,2,0,1,1,2,1,
- 2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,0,0,2,1,1,1,
- 2,2,2,1,2,2,2,0,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
- 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,
- 2,0,2,2,2,1,2,2,0,0,2,0,1,1,2,1,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,0,0,0,1,1,1,1,
- 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,2,1,0,2,2,0,1,2,
- 2,2,2,1,2,2,2,0,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,
- 2,1,2,1,2,0,2,0,1,2,1,1,0,2,0,0,0,0,2,1,1,1,2,0,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,0,2,1,2,1,2,0,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,2,2,0,0,2,2,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
- 2,0,2,0,2,1,2,1,0,0,0,0,1,1,1,1,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,0,0,0,2,1,1,1,
- 2,2,2,0,2,2,2,1,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,0,2,2,2,1,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,1,2,1,2,0,2,0,1,2,1,1,0,2,0,0,2,0,2,2,2,1,2,2,0,2,1,2,1,2,0,2,
- 2,2,2,1,2,2,2,0,2,2,1,2,2,2,0,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,
- 0,0,2,0,1,1,2,1,0,0,1,0,1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,0,2,2,2,1,1,2,2,2,0,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,0,0,2,2,1,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
- 2,0,0,0,2,1,1,1,0,0,0,0,1,1,1,1,2,2,2,1,2,2,2,0,2,1,2,1,2,0,2,0,
- 2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,2,0,0,0,2,1,1,1,
- 2,2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,1,2,1,2,0,2,0,2,0,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,1,1,1,2,0,0,0,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
- 2,1,2,1,2,0,2,0,2,1,2,2,2,0,2,2,2,2,2,0,2,2,2,1,2,0,2,0,2,1,2,1,
- 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,0,1,0,0,1,0,1,1,
- 2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,2,2,1,2,2,2,0,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,2,2,1,0,2,0,2,2,2,1,2,2,2,
- 2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,
- 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 0,2,0,0,1,2,1,1,2,0,0,0,2,1,1,1,2,2,2,2,2,2,2,2,1,0,1,2,0,1,0,2,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,1,2,2,2,0,2,2,1,1,2,2,0,0,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,1,2,1,2,0,2,0,2,1,2,2,2,0,2,2,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,1,2,2,2,0,2,2,2,
- 2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,2,
- 0,0,0,0,1,1,1,1,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,0,2,2,2,1,2,
- 2,0,2,0,2,1,2,1,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,
- 0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,1,2,2,2,0,1,1,2,1,0,0,2,0,2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,2,2,0,2,2,2,1,2,
- 2,0,2,0,2,1,2,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,1,2,2,2,0,2,2,
- 0,2,0,0,1,2,1,1,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,2,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,2,1,1,1,2,0,0,2,2,2,1,2,2,2,
- 2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
- 0,0,2,2,1,1,2,2,0,2,1,2,1,2,0,2,2,1,2,1,2,0,2,0,1,2,1,2,0,2,0,2,
- 2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
- 2,2,0,0,2,2,1,1,2,2,0,0,2,2,1,1,2,2,2,2,2,2,2,2,2,2,0,0,2,2,1,1,
- 2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,0,2,0,0,1,2,1,1,
- 2,2,2,0,2,2,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,
- 2,2,2,2,2,2,2,2,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,
- 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,0,0,2,1,1,1,
- 2,0,2,2,2,1,2,2,0,2,2,2,1,2,2,2,2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,
- 2,0,2,0,2,1,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,0,2,0,2,1,2,1,2,1,2,0,2,0,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,0,2,0,2,1,2,1,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,1,2,1,2,0,2,0,2,2,1,2,1,2,0,2,0,2,2,2,2,2,2,2,2,
- 2,0,2,1,2,1,2,0,0,2,1,2,1,2,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,0,2,0,2,1,2,1,
- 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,1,2,1,2,0,2,0,1,1,1,2,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,
- 2,0,2,0,2,1,2,1,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
- 2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
-};
diff --git a/lavadecode.1in b/lavadecode.1in
index 1b8dc27..9c2dff7 100644
--- a/lavadecode.1in
+++ b/lavadecode.1in
@@ -1,176 +1,7 @@
.TH lavadecode 1 "${MODpage}" "lavadecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (zjsdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -209,42 +40,50 @@ Decode an LAVAFLOW stream file created by foo2lava.
$ lavadecode -h < testpage.prn
0: \\033%-12345X@PJL JOB NAME="stdin"
1f: \\033%-12345X@PJL JOB USERNAME=""
- 3d: \\033%-12345X@PJL JOB TIMESTAMP="12/12/2006"
- 66: \\033%-12345X@PJL JOB OSINFO="Linux/2.6.17-1.2187_FC5"
+ 3d: \\033%-12345X@PJL JOB TIMESTAMP="07/20/2007"
+ 66: \\033%-12345X@PJL JOB OSINFO="Linux/2.6.20-1.2316.fc5"
99: \\033%-12345X@PJL ENTER LANGUAGE=LAVAFLOW
- bf: \\033E RESET
- c1: \\033&l0S DUPLEX
+ bf: \\033E RESET
+ c1: \\033&l0S DUPLEX: [off]
c6: \\033&l0G
- cb: \\033&u1200D X RESOLUTION
- d3: \\033&l1X COPIES
- d8: \\033&x1X TRANSMIT ONCE COPIES
- dd: \\033&l0O ORIENTATION
- e2: \\033*r1U NBIE
- e7: \\033*g8W BW/COLOR
- ec: \\033*b1234M COMPRESSION
- f4: \\033&l2A PAGE SIZE
- f9: \\033&l255H PAPER SOURCE
- 100: \\033&l0M MEDIA TYPE
- 105: \\033&l0E TOP MARGIN
- 10a: \\033*r9820S X RASTER
- 112: \\033*r6410T Y RASTER
- 11a: \\033&l0U
- 11f: \\033&l0Z
- 124: \\033*p200X X OFFSET
- 12b: \\033*p200Y Y OFFSET
- 132: \\033*r1A [Page 1]
- 137: \\033*b20V [black]
- DL = 0, D = 0, P = 1, - = 0, XY = 9820 x 6410
- L0 = 128, MX = 16, MY = 0
- Order = 3 ILEAVE SMID
- Options = 92 LRLTWO TPDON TPBON DPON
- 51 stripes, 0 layers, 1 planes
-
- 151: \\033*b65536W JBIG data (cont)
- 1015a: \\033*b27374W JBIG data (cont)
- 16c51: \\033*r0C END PAGE
- 16c56: \\033E RESET
- 16c58: \\033%-12345X
+ cb: \\033&u1200D X RESOLUTION: [1200]
+ d3: \\033&l1X COPIES: [1]
+ d8: \\033&x1X TRANSMIT ONCE COPIES: [1]
+ dd: \\033&l0O ORIENTATION: [port]
+ e2: \\033*r1U NBIE: [1]
+ e7: \\033*g8W BW/COLOR: [8]
+ fmt=2 np=1
+ BLACK: X=1200, Y=600, unk=0, #=4(2)
+ f4: \\033*b1234M COMPRESSION: [1234]
+ fc: \\033&l2A PAGE SIZE: [letter]
+ 101: \\033&l255H PAPER SOURCE: [auto]
+ 108: \\033&l0M MEDIA TYPE: [plain]
+ 10d: \\033&l0E TOP MARGIN: [0]
+ 112: \\033*r9792S X RASTER: [9792,0x2640]
+ 11a: \\033*r6400T Y RASTER: [6400,0x1900]
+ 122: \\033&l0U
+ 127: \\033&l0Z
+ 12c: \\033*p200X X OFFSET: [200]
+ 133: \\033*p200Y Y OFFSET: [200]
+ 13a: \\033*r1A [Page 1]
+ 13f: \\033*b20V [black]
+ DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400
+ L0 = 128, MX = 0, MY = 0
+ Order = 3 ILEAVE SMID
+ Options = 92 LRLTWO TPDON TPBON DPON
+ 50 stripes, 0 layers, 1 planes
+ 159: \\033*b65536V JBIG data (first) [65536,0x10000]
+ ff 02 c2 79 54 3e be e1 a0 de 08 9a b1 d2 c2 59
+ ... ae 88 ef a7 c7 96 d3 96 a6 d7 2c 06 38 75 22 44
+ 10162: \\033*b26432W JBIG data (end) [26432,0x6740]
+ 0e 89 66 ce 01 41 41 41 41 41 41 41 41 41 41 41
+ ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
+ 168ab: \\033*x3887138K BLACK DOTS: [3887138]
+ 168b6: \\033*x58781662W BLACK WHITEDOTS: [58781662]
+ 168c2: \\033*rC END PAGE
+ 168c6: \\033&l0H PAPER SOURCE: [eject]
+ 168cb: \\033E RESET
+ 168cd: \\033%-12345X
.ft P
.fi
diff --git a/lavadecode.c b/lavadecode.c
index 27a41a5..ea2503e 100644
--- a/lavadecode.c
+++ b/lavadecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: lavadecode.c,v 1.29 2007/07/17 13:09:29 rick Exp $
+ * $Id: lavadecode.c,v 1.31 2008/09/05 15:05:54 rick Exp $
*/
/*b
@@ -468,7 +468,7 @@ decode(FILE *fp)
int h, w, len;
unsigned char *image;
- //debug(0, "JBG_OK: %d\n", pn);
+ //debug(0, "JBG_EOK: %d\n", pn);
h = jbg_dec_getheight(&s[pn]);
w = jbg_dec_getwidth(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
@@ -525,12 +525,31 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- for(;;)
- {
- decode(stdin);
- c = getc(stdin); ungetc(c, stdin);
- if (feof(stdin))
- break;
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ for (;;)
+ {
+ decode(fp);
+ c = getc(fp); ungetc(c, fp);
+ if (feof(fp))
+ break;
+ }
+ fclose(fp);
+ }
+ else
+ {
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
}
printf("\n");
diff --git a/macros.man b/macros.man
new file mode 100644
index 0000000..289c457
--- /dev/null
+++ b/macros.man
@@ -0,0 +1,172 @@
+'\"==========================================================================
+'\" STRINGS and MACROS
+'\"==========================================================================
+'\"
+'\" Define strings for special characters that nroff doesn't have
+'\"
+'\" N.B. using .if cua to test for special characters did not work.
+'\"
+.if !'\*[.T]'ps' .ds ua up
+.if '\*[.T]'ps' .ds ua \(ua
+.if !'\*[.T]'ps' .ds da down
+.if '\*[.T]'ps' .ds da \(da
+.if !'\*[.T]'ps' .ds <- left
+.if '\*[.T]'ps' .ds <- \(<-
+.if !'\*[.T]'ps' .ds -> right
+.if '\*[.T]'ps' .ds -> \(->
+'\"
+'\" bx - box a Courier string for making keycaps
+'\"
+'\" N.B. this mess is to make the line drawing come out only
+'\" if we are really generating postscript
+'\"
+.de bx
+.ie !'\*[.T]'ps' \{\
+. RB [ \\$1 ]\\$2
+.\}
+.el \{\
+. ie !r ps4html \{\
+'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
+. ft CW
+. nr par*bxw \w'\\$1'+.4m
+\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
+\Z'\h'.2m'\s-1\\$1\s+1'\
+\h'\\n[par*bxw]u'\\$2
+. ft P
+. \}
+. el \{\
+. RB [ \\$1 ]\\$2
+. \}
+.\}
+..
+'\"
+'\" strings to set current color (null with old groff)
+'\"
+.if mred .ds red \m[red]
+.if mgreen .ds green \m[green]
+.if mblue .ds blue \m[blue]
+.if mblack .ds black \m[black]
+.if mblack .ds mP \mP
+'\"
+'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
+'\" but xterm displays yellow as orange. The cycle is complete.
+'\"
+.if n .defcolor orange rgb #ffff00
+'\"
+'\" color <color> - set the current color (ignores request with old groff)
+'\"
+.de color
+.if mred \m[\\$1]\c
+..
+'\"
+'\" colorword <color> <word> - colorize a word (ignored by old groff)
+'\"
+.de colorword
+.ie m\\$1 \m[\\$1]\\$2\mP\c
+.el \\$2\c
+..
+'\"
+'\" colbox <fg> <bg> <word> - colorize a word in a filled box
+'\"
+.de colbox
+.ie mred \M[\\$2]\
+\v'+.167v'\
+\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
+\v'-.167v'\
+\m[\\$1]\\$3\mP\MP
+.el \\$3\c
+..
+'\"
+'\" Macros for doing pdfmarks
+'\"
+.de specialps
+.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c
+..
+'\"
+'\" pdfmark PDFMARKCODE
+'\"
+.ds pdfmarks
+.if d pdfmarks \{\
+.de pdfmark
+. specialps exec [\\$1 pdfmark
+..
+'\"
+'\" pdfdest LINKNAME
+'\"
+.de pdfdest
+.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
+..
+'\"
+'\" pdfbookmark COUNT LINKNAME STRING
+'\"
+.de pdfbookmark
+. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
+..
+'\"
+'\" Define the SH and SS macros to save pdfmark information
+'\" in "arrays" of numbers and strings.
+'\"
+.if !r rr_n \{\
+.nr rr_n 0 1
+.am SH
+. nr rr_levels!\\n+[rr_n] 2
+. ds rr_labels!\\n[rr_n] \\$*
+. pdfdest Link\\n[rr_n]
+..
+.am SS
+. nr rr_levels!\\n+[rr_n] 3
+. ds rr_labels!\\n[rr_n] \\$*
+. pdfdest Link\\n[rr_n]
+..
+.\}
+'\"
+'\" Called at the end of the document to generate the pdfmark outline
+'\"
+.de pdf_outline
+.nr rr_levels!\\n+[rr_n] 1
+.nr rr_i 0 1
+.while \\n+[rr_i]<\\n[rr_n] \{\
+. nr rr_ip1 \\n[rr_i]+1
+. nr rr_count 0
+. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
+. nr rr_j \\n[rr_i] 1
+. while \\n+[rr_j]<\\n[rr_n] \{\
+. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
+. break
+. \}
+. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
+. nr rr_count \\n[rr_count]+1
+. \}
+. \}
+. \}
+. ds hhh \\*[rr_labels!\\n[rr_i]]
+. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
+.\}
+..
+'\"
+'\" Some postscript to make pdfmarks harmless on old interpreters...
+'\"
+.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
+'\"
+'\" Force display of Bookmarks in Acrobat when document is viewed.
+'\"
+.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
+'\"
+'\" Output the document info in pdfmarks
+'\"
+.pdfmark "\
+ /Title (\*[an-title](\*[an-section])) \
+ /Subject (\*[an-title] Manual Page) \
+ /Author (Rick Richardson) \
+ /Keywords (printing) \
+ /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
+ /CreationDate (\*[an-extra1]) \
+ /ModDate (\*[an-extra1]) \
+ /DOCINFO"
+\}
+'\"
+'\" The manual page name is only 1st level mark
+'\"
+.nr rr_levels!\n+[rr_n] 1
+.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
+.pdfdest Link\n[rr_n]
diff --git a/oak.h b/oak.h
new file mode 100644
index 0000000..0587e54
--- /dev/null
+++ b/oak.h
@@ -0,0 +1,197 @@
+
+#include <inttypes.h>
+typedef uint32_t DWORD;
+typedef uint16_t WORD;
+typedef uint8_t BYTE;
+
+/*
+ * JBIG BIH. But note that Oak uses it little endian.
+ */
+typedef struct
+{
+ DWORD opt1;
+ DWORD xd; // Oak has this little endian
+ DWORD yd; // Oak has this little endian
+ DWORD l0; // Oak has this little endian
+ DWORD opt2;
+} OAKBIH;
+
+/*
+ * Oak record header. Every record starts with one of these and
+ * the entire record is always padded out to a multiple of 16 bytes.
+ */
+typedef struct
+{
+ char magic[4];
+ #define OAK_HDR_MAGIC "OAKT"
+ DWORD len; // Total length of record including this header
+ DWORD type; // Record type
+} OAK_HDR;
+
+/*
+ * Note that the upper nibble of the type number encodes the class
+ *
+ * 0x - start/end doc
+ * 1x - start/end page
+ * 2x - page parameters
+ * 3x - image data
+ */
+
+/************************************************************************/
+/* 0x - start/end doc */
+/************************************************************************/
+/*
+ * First record in file.
+ *
+ * No idea what the payload means yet. My guess is username.
+ */
+#define OAK_TYPE_OTHER 0x0D
+typedef struct
+{
+ WORD unk; // Always 1
+ char string[64]; // "OTHER" padded with 0's
+ // WORD pad; // "PAD_PAD_" as needed.
+} OAK_OTHER;
+typedef OAK_OTHER HDR_0D;
+
+/*
+ * date/time record
+ */
+#define OAK_TYPE_TIME 0x0C
+typedef struct
+{
+ char datetime[32]; // Date/time in string format (with NL)
+ DWORD time_t; // Time in seconds since the Unix epoch
+ WORD year; // e.g. 2003
+ WORD tm_mon; // Month-1
+ WORD tm_mday; // Day of month (1-31)
+ WORD tm_hour; // Hour (0-23)
+ WORD tm_min; // Minute (0-59)
+ WORD tm_sec; // Second (0-59)
+ // DWORD pad;
+} OAK_TIME;
+typedef OAK_TIME HDR_0C;
+
+/*
+ * Filename record
+ */
+#define OAK_TYPE_FILENAME 0x0A
+typedef struct
+{
+ char string[64]; // "OTHER" padded with 0's
+} OAK_FILENAME;
+
+/*
+ * End of document
+ */
+#define OAK_TYPE_END_DOC 0x0B
+
+/************************************************************************/
+/* 1x - start/end page */
+/************************************************************************/
+#define OAK_TYPE_START_PAGE 0x14 // No arguments
+#define OAK_TYPE_START_IMAGE 0x15 // No arguments
+#define OAK_TYPE_END_IMAGE 0x17 // No arguments
+#define OAK_TYPE_END_PAGE 0x18 // WORD argument (0)
+/************************************************************************/
+/* 2x - page parameters */
+/************************************************************************/
+#define OAK_TYPE_SOURCE 0x28 // DWORD argument: paper source
+ #define OAK_SOURCE_TRAY1 1
+ #define OAK_SOURCE_MANUAL 4
+ #define OAK_SOURCE_AUTO 7
+
+#define OAK_TYPE_MEDIA 0x29
+typedef struct
+{
+ BYTE media; // Media code
+ #define OAK_MEDIA_AUTO 0
+ #define OAK_MEDIA_PLAIN 1
+ #define OAK_MEDIA_PREPRINTED 2
+ #define OAK_MEDIA_LETTERHEAD 3
+ #define OAK_MEDIA_GRAYTRANS 4
+ #define OAK_MEDIA_PREPUNCHED 5
+ #define OAK_MEDIA_LABELS 6
+ #define OAK_MEDIA_BOND 7
+ #define OAK_MEDIA_RECYCLED 8
+ #define OAK_MEDIA_COLOR 9
+ #define OAK_MEDIA_CARDSTOCK 10
+ #define OAK_MEDIA_HEAVY 11
+ #define OAK_MEDIA_ENVELOPE 12
+ #define OAK_MEDIA_LIGHT 13
+ #define OAK_MEDIA_TOUGH 14
+ BYTE unk8[3]; // Unknown, 2, 0, 0
+ char string[64]; // Unknown string, padd with blanks
+} OAK_MEDIA;
+
+#define OAK_TYPE_COPIES 0x2A
+typedef struct
+{
+ DWORD copies; // Number of copies
+ DWORD unk; // collate????
+} OAK_COPIES;
+
+#define OAK_TYPE_PAPER 0x2B
+typedef struct
+{
+ DWORD paper; // Paper code
+ #define OAK_PAPER_LETTER 1 // 8.5 x 11in
+ #define OAK_PAPER_LEGAL 5 // 8.5 x 14in
+ #define OAK_PAPER_EXECUTIVE 7 // 7.25 x 10.5in
+ #define OAK_PAPER_A4 9 // 210 x 297mm
+ #define OAK_PAPER_A5 11 // 148 x 210mm
+ #define OAK_PAPER_B5_JIS 13 // 182 x 257mm
+ #define OAK_PAPER_ENV_10 20 // 4.125 x 9.5in
+ #define OAK_PAPER_ENV_DL 27 // 110 x 220mm
+ #define OAK_PAPER_ENV_C5 28 // 162 x 229mm
+ #define OAK_PAPER_ENV_B5 34 // 176 x 250mm
+ #define OAK_PAPER_ENV_MONARCH 37 // 3.875 x 7.5in
+ #define OAK_PAPER_B5_ISO 257 // 176 x 250mm
+ #define OAK_PAPER_EXECUTIVE_JIS 258 // 8 x 13in
+ #define OAK_PAPER_16K 93 // 7.75 x 10.75in
+ #define OAK_PAPER_DOUBLE_POSTCARD 69 // 5.8 x 7.9in
+ #define OAK_PAPER_POSTCARD 43 // 4.25 x 6in
+ #define OAK_PAPER_CUSTOM 256 // user defined
+ DWORD w1200; // Paper width at 1200 DPI
+ DWORD h1200; // Paper height at 1200 DPI
+ DWORD unk; // unknown, 0
+} OAK_PAPER;
+/************************************************************************/
+/* 3x - JBIG image data */
+/************************************************************************/
+#define OAK_TYPE_IMAGE_COLOR 0x32
+#define OAK_TYPE_IMAGE_MONO 0x33
+typedef struct
+{
+ DWORD unk0; // Likely x offset
+ DWORD unk1; // Likely y offset
+ DWORD w; // width of (clipped?) image
+ DWORD h; // height of (clipped?) image
+ DWORD resx; // X resolution in DPI
+ DWORD resy; // Y resolution in DPI
+ DWORD nbits; // bits per plane, 1 or 2
+ char unk[16]; // always 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f
+} OAK_IMAGE_PLANE;
+
+typedef struct
+{
+ OAK_IMAGE_PLANE plane;
+} OAK_IMAGE_MONO;
+
+typedef struct
+{
+ OAK_IMAGE_PLANE plane[4];
+} OAK_IMAGE_COLOR;
+
+#define OAK_TYPE_IMAGE_DATA 0x3C
+typedef struct
+{
+ OAKBIH bih; // Little-endian JBIG BIH
+ DWORD datalen; // Length of actual image data
+ DWORD padlen; // Padded length of image data
+ DWORD unk1C; // unknown, 000
+ DWORD y; // Y offset of this chunk
+ DWORD plane; // 0=, 1=, 2=, 3=K
+ DWORD subplane; // 0 or 1
+ // DWORD pad[2];
+} OAK_IMAGE_DATA;
diff --git a/oakdecode.1in b/oakdecode.1in
index 6fe5938..571a8f6 100644
--- a/oakdecode.1in
+++ b/oakdecode.1in
@@ -1,176 +1,7 @@
.TH oakdecode 1 "${MODpage}" "oakdecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (oakdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, OAKT) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
diff --git a/oakdecode.c b/oakdecode.c
new file mode 100644
index 0000000..0b0b289
--- /dev/null
+++ b/oakdecode.c
@@ -0,0 +1,673 @@
+/*
+ * $Id: oakdecode.c,v 1.31 2008/05/02 04:08:13 rick Exp $
+ *
+ * Work in progress decoder for Oak Tech. JBIG streams (HP1500)
+ *
+ * The image data appears to be a bastard little-endian version of JBIG,
+ * split into bands of 256 pixels (except for the last). The data needs
+ * to be directly driven into a hacked version of jbig.c. The -r and -d
+ * options are non-functional.
+ *
+ * In addition, the image data is left/right mirrored.
+ */
+
+/*b
+ * Copyright (C) 2003-2006 Rick Richardson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Rick Richardson <rick.richardson@comcast.net>
+b*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "jbig.h"
+
+/*
+ * Global option flags
+ */
+int Debug = 0;
+char *RawFile;
+char *DecFile;
+int PrintOffset = 0;
+int SupressImage = 0;
+
+int ImageRec[4];
+FILE *FpDec[4][2];
+FILE *FpRaw[4][2];
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+int
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, fatal ? "Error: " : "Warning: ");
+ if (errno)
+ fprintf(stderr, "%s: ", strerror(errno));
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ if (fatal > 0)
+ exit(fatal);
+ else
+ {
+ errno = 0;
+ return (fatal);
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" oakdecode [options] < OAKT-file\n"
+"\n"
+" Decode an Oak Tech. OAKT printer stream into human readable form.\n"
+"\n"
+" OAKT is the printer langauge used by the HP 1500 printers.\n"
+"\n"
+"Options:\n"
+" -d basename Basename of .pbm file for saving decompressed planes\n"
+" -r basename Basename of .jbg file for saving raw planes\n"
+" -i Supress display of image records\n"
+" -o Print file offsets\n"
+" -D lvl Set Debug level [%d]\n"
+ , Debug
+ );
+
+ exit(1);
+}
+
+#if 0
+BIH-style from foo2zjs/pbmtojbg...
+
+00000000: 00 00 01 00 00 00 26 40 00 00 18 f8 00 00 00 80
+00000010: 10 00 03 5c
+#endif
+
+#include <inttypes.h>
+typedef uint32_t DWORD;
+typedef uint16_t WORD;
+typedef uint8_t BYTE;
+
+typedef struct
+{
+ DWORD opt1;
+ DWORD xd; // Oak has this little endian
+ DWORD yd; // Oak has this little endian
+ DWORD l0; // Oak has this little endian
+ DWORD opt2;
+} OAKBIH;
+
+void
+iswap32(void *p)
+{
+ char *cp = (char *) p;
+ char tmp;
+ tmp = cp[0];
+ cp[0] = cp[3];
+ cp[3] = tmp;
+ tmp = cp[1];
+ cp[1] = cp[2];
+ cp[2] = tmp;
+}
+
+/*
+ * This is the standard JBIG-KIT big-endian BIH prettyprinter.
+ */
+void
+print_bih(unsigned char bih[20])
+{
+ unsigned int xd, yd, l0;
+
+ xd = (bih[4] << 24) | (bih[5] << 16) | (bih[6] << 8) | (bih[7] << 0);
+ yd = (bih[8] << 24) | (bih[9] << 16) | (bih[10] << 8) | (bih[11] << 0);
+ l0 = (bih[12] << 24) | (bih[13] << 16) | (bih[14] << 8) | (bih[15] << 0);
+
+ printf(" DL = %d, D = %d, P = %d, - = %d, XY = %d x %d\n",
+ bih[0], bih[1], bih[2], bih[3], xd, yd);
+
+ printf(" L0 = %d, MX = %d, MY = %d\n",
+ l0, bih[16], bih[17]);
+
+ printf(" Order = %d %s%s%s%s%s\n", bih[18],
+ bih[18] & JBG_HITOLO ? " HITOLO" : "",
+ bih[18] & JBG_SEQ ? " SEQ" : "",
+ bih[18] & JBG_ILEAVE ? " ILEAVE" : "",
+ bih[18] & JBG_SMID ? " SMID" : "",
+ bih[18] & 0xf0 ? " other" : "");
+
+ printf(" Options = %d %s%s%s%s%s%s%s%s\n", bih[19],
+ bih[19] & JBG_LRLTWO ? " LRLTWO" : "",
+ bih[19] & JBG_VLENGTH ? " VLENGTH" : "",
+ bih[19] & JBG_TPDON ? " TPDON" : "",
+ bih[19] & JBG_TPBON ? " TPBON" : "",
+ bih[19] & JBG_DPON ? " DPON" : "",
+ bih[19] & JBG_DPPRIV ? " DPPRIV" : "",
+ bih[19] & JBG_DPLAST ? " DPLAST" : "",
+ bih[19] & 0x80 ? " other" : "");
+ printf(" %u stripes, %d layers, %d planes\n",
+ ((yd >> bih[1]) + ((((1UL << bih[1]) - 1) & xd) != 0) + l0 - 1) / l0,
+ bih[1] - bih[0], bih[2]);
+}
+
+#if 0
+00000260: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+00000270: 60 13 00 00 80 00 00 00 80 00 00 00 20 00 03 58 | `........... ..X |
+00000280: 02 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 | ................ |
+00000290: 00 00 00 00 00 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+000002a0: ff 02 50 41 44 5f 50 41 44 5f 50 41 44 5f 50 41 | ..PAD_PAD_PAD_PA |
+
+000002b0: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+000002c0: 60 13 00 00 80 00 00 00 80 00 00 00 20 00 03 58 | `........... ..X |
+000002d0: 02 00 00 00 10 00 00 00 00 00 00 00 00 00 00 00 | ................ |
+000002e0: 00 00 00 00 01 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+000002f0: ff 02 50 41 44 5f 50 41 44 5f 50 41 44 5f 50 41 | ..PAD_PAD_PAD_PA |
+
+0000ba20: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+0000ba30: 60 13 00 00 00 01 00 00 00 01 00 00 20 00 03 58 | `........... ..X |
+0000ba40: 90 0d 00 00 a0 0d 00 00 00 00 00 00 40 02 00 00 | ............@... |
+0000ba50: 00 00 00 00 00 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+0000ba60: a6 ab 23 26 a0 78 7e 82 25 30 39 8b 95 16 32 4e | ..#&.x~.%09...2N |
+...
+0000c7f0: 50 41 44 5f 50 41 44 5f 50 41 44 5f 50 41 44 5f | PAD_PAD_PAD_PAD_ |
+
+0000c800: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+0000c810: 60 13 00 00 00 01 00 00 00 01 00 00 20 00 03 58 | `........... ..X |
+0000c820: 02 00 00 00 10 00 00 00 00 00 00 00 40 02 00 00 | ............@... |
+0000c830: 00 00 00 00 01 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+0000c840: ff 02 50 41 44 5f 50 41 44 5f 50 41 44 5f 50 41 | ..PAD_PAD_PAD_PA |
+
+000124d0: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+000124e0: 60 13 00 00 00 01 00 00 00 01 00 00 20 00 03 58 | `........... ..X |
+000124f0: fe 16 00 00 10 17 00 00 00 00 00 00 40 02 00 00 | ............@... |
+00012500: 03 00 00 00 00 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+00012510: 4c 8b 1a 0b 4d 74 19 a8 64 fa 91 c0 02 10 36 8c | L...Mt..d.....6. |
+...
+00013bf0: 11 f6 d3 e1 ca 98 ed b3 1a c3 2d a1 db 34 a9 db | ..........-..4.. |
+00013c00: 04 f4 b8 2e 53 cb d3 be b3 e4 8a 3c ff 02 50 41 | ....S......<..PA |
+00013c10: 44 5f 50 41 44 5f 50 41 44 5f 50 41 44 5f 50 41 | D_PAD_PAD_PAD_PA |
+
+00013c20: 4f 41 4b 54 40 00 00 00 3c 00 00 00 00 00 01 00 | OAKT@...<....... |
+00013c30: 60 13 00 00 00 01 00 00 00 01 00 00 20 00 03 58 | `........... ..X |
+00013c40: 7e 02 00 00 90 02 00 00 00 00 00 00 40 02 00 00 | ~...........@... |
+00013c50: 03 00 00 00 01 00 00 00 50 41 44 5f 50 41 44 5f | ........PAD_PAD_ |
+
+#endif
+
+typedef struct
+{
+ char magic[4];
+ DWORD len;
+ DWORD type;
+} OAK_HDR;
+
+typedef struct
+{
+ WORD unk;
+ char string[64];
+ WORD pad;
+} HDR_0D;
+
+typedef struct
+{
+ char datetime[32]; // Date/time in string format (with NL)
+ DWORD time_t; // Time in seconds since the Unix epoch
+ WORD year; // e.g. 2003
+ WORD tm_mon; // Month-1
+ WORD tm_mday; // Day of month (1-31)
+ WORD tm_hour; // Hour (0-23)
+ WORD tm_min; // Minute (0-59)
+ WORD tm_sec; // Second (0-59)
+ DWORD pad;
+} HDR_0C;
+
+typedef struct
+{
+ OAKBIH bih;
+ DWORD datalen;
+ DWORD padlen;
+ DWORD unk1C;
+ DWORD y; // Y offset of this chunk
+ DWORD plane; // 0=, 1=, 2=, 3=K
+ DWORD subplane; // 0 or 1
+ DWORD pad[2];
+} HDR_3C;
+
+typedef struct
+{
+ DWORD unk0;
+ DWORD unk1;
+ DWORD w;
+ DWORD h;
+ DWORD resx;
+ DWORD resy;
+ DWORD nbits;
+ DWORD unk7[4];
+} HDR_3X;
+
+void
+decode(FILE *fp)
+{
+ OAK_HDR hdr;
+ int rc;
+ int size;
+ int plane = 0;
+ int subplane;
+ int pageNum = 0;
+ int len;
+ int i, j;
+ int c;
+ char *p;
+ int curOff = 0;
+ int dwords[128];
+ short words[128];
+ unsigned char bytes[128];
+ char buf[512];
+ HDR_0D hdr0d;
+ HDR_0C hdr0c;
+ HDR_3C hdr3c;
+ HDR_3X hdr3x[4];
+ int firstPlane;
+ size_t cnt;
+ char *ibuf;
+ struct jbg_dec_state s[4][2];
+ int height[4][2];
+ int width[4][2];
+
+ for (;;)
+ {
+ static int first3c = 1;
+
+ rc = fread(&hdr, 1, len = sizeof(hdr), fp);
+ if (rc <=0)
+ break;
+ if (rc != len)
+ {
+ debug(0, "Expected OAK header, got short read: %d bytes\n", rc);
+ break;
+ }
+
+ if (hdr.type == 0x3c && first3c)
+ {
+ printf("\t"
+ "\t%8s %4s %4s %4s %8s %5s %5s %3s %4s %s %s\n",
+ "bih0", "w", "h", "l0", "bih5", "dlen", "plen",
+ "unk", "yOff", "P", "subP"
+ );
+ first3c = 0;
+ }
+
+ if (hdr.type != 0x3c || !SupressImage || !ImageRec[plane])
+ {
+ if (PrintOffset)
+ printf("%x: ", curOff);
+ printf("%02x (%d)", hdr.type, hdr.len);
+ }
+
+ curOff += len;
+ size = hdr.len;
+ size -= sizeof(hdr);
+
+ switch (hdr.type)
+ {
+ case 0x0d: // first record
+ rc = fread(&hdr0d, len = sizeof(hdr0d), 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ printf(" %x %s", hdr0d.unk, hdr0d.string);
+ break;
+ case 0x0c: // time
+ rc = fread(&hdr0c, len = sizeof(hdr0c), 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ p = strchr(hdr0c.datetime, '\n');
+ if (p) *p = 0;
+ printf(" %s", hdr0c.datetime);
+ printf(", %d", hdr0c.time_t);
+ printf(", %d/%02d/%02d %02d:%02d:%02d",
+ hdr0c.year, hdr0c.tm_mon+1, hdr0c.tm_mday,
+ hdr0c.tm_hour, hdr0c.tm_min, hdr0c.tm_sec);
+ break;
+ case 0x0a: // filename
+ printf(" ");
+ curOff += size;
+ while (size--)
+ {
+ c = fgetc(fp);
+ if (c == EOF)
+ break;
+ else if (c) putchar(c);
+ else break;
+ }
+ while (size--)
+ fgetc(fp);
+ break;
+ case 0x14:
+ printf(" (no args)");
+ ++pageNum;
+ curOff += size;
+ while (size--)
+ fgetc(fp);
+ break;
+ case 0x28:
+ rc = fread(dwords, len = 1*4, 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ switch (dwords[0])
+ {
+ case 1: printf(" Source=Tray1"); break;
+ case 4: printf(" Source=ManualFeed"); break;
+ case 7: printf(" Source=Auto"); break;
+ default: printf(" Source=%d", dwords[0]); break;
+ }
+ break;
+ case 0x29:
+ rc = fread(bytes, len = 17*4, 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ printf(" PaperType=%d UNK8=%d,%d,%d,%d, blanks(63)",
+ bytes[0],
+ bytes[1], bytes[2], bytes[3], bytes[4]);
+ // PaperType: 0=AutoSelect, 1=Plain, 2=Preprinted, 3=Letterhead
+ // 4=GrayscaleTransparency, 5=Prepunched, 6=Labels, 7=Bond
+ // 8=Recycled, 9=Color, 10=Cardstock, 11=Heavy, 12=Envelope
+ // 13=Light, 14=Tough
+ break;
+ case 0x2a:
+ rc = fread(dwords, len = 5*4, 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ printf(" Copies=0x%x UNK=0x%x", dwords[0], dwords[1]);
+ break;
+ case 0x2b:
+ rc = fread(dwords, len = 5*4, 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ printf(" papercode=%d(%x)", dwords[0], dwords[0]);
+ printf(" xwid=%d", dwords[1]);
+ printf(" ywid=%d", dwords[2]);
+ printf(" UNK=0x%x", dwords[3]);
+ break;
+ case 0x32:
+ firstPlane = 0;
+ goto prplanes;
+ case 0x33:
+ firstPlane = 3;
+ prplanes:
+ printf("\n\tunk0 unk1 w h resx resy nBits");
+ for (i = firstPlane; i < 4; ++i)
+ {
+ rc = fread(&hdr3x[i], len = sizeof(HDR_3X), 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ size -= len;
+ printf("\n\t0x%x\t0x%x\t%d\t%d\t%d\t%d\t0x%x",
+ hdr3x[i].unk0,
+ hdr3x[i].unk1,
+ hdr3x[i].w,
+ hdr3x[i].h,
+ hdr3x[i].resx,
+ hdr3x[i].resy,
+ hdr3x[i].nbits);
+ }
+ curOff += size;
+ while (size-- > 0)
+ fgetc(fp);
+ break;
+ case 0x15:
+ printf(" (no args)");
+ curOff += size;
+ while (size--)
+ fgetc(fp);
+ break;
+ case 0x3c:
+ // rc = fread(dwords, len = 48, 1, fp);
+ rc = fread(&hdr3c, len = sizeof(hdr3c), 1, fp);
+ if (rc != 1)
+ {
+ debug(0, "Short read of hdr3c\n");
+ goto out;
+ }
+ curOff += len;
+
+ plane = hdr3c.plane;
+ subplane = hdr3c.subplane;
+ if (!SupressImage || !ImageRec[plane])
+ {
+ printf(
+ "\t0x%08x %4d %4d %4d 0x%08x %5d %5d 0x%03x %4d %d %d\n",
+ hdr3c.bih.opt1,
+ hdr3c.bih.xd,
+ hdr3c.bih.yd,
+ hdr3c.bih.l0,
+ hdr3c.bih.opt2,
+ hdr3c.datalen,
+ hdr3c.padlen,
+ hdr3c.unk1C,
+ hdr3c.y,
+ hdr3c.plane,
+ hdr3c.subplane);
+ }
+
+ if (RawFile && !FpRaw[plane][subplane])
+ {
+ sprintf(buf, "%s-%02d-%d-%d.jbg",
+ RawFile, pageNum, plane, subplane);
+ FpRaw[plane][subplane] = fopen(buf, "w");
+ }
+ if (DecFile && !FpDec[plane][subplane])
+ {
+ height[plane][subplane] = 0;
+ sprintf(buf, "%s-%02d-%d-%d.pbm",
+ DecFile, pageNum, plane, subplane);
+ FpDec[plane][subplane] = fopen(buf, "w");
+ fprintf(FpDec[plane][subplane], "P4\n%8d %8d\n", 0, 0);
+ }
+
+ if (FpDec[plane][subplane])
+ jbg_dec_init(&s[plane][subplane]);
+
+ if (1||hdr3c.subplane == 0)
+ {
+ static int testend = 1;
+ static char *cp = (char *) &testend;
+ static int first_bih = 1;
+ // JBIGKIT is bigendian, Oak is little-endian
+ // swap the BIH header words before passing it to
+ // jbig-kit. N.B. - is there any issues with endianess
+ // inside the compressed stream itself????
+ if (*cp == 1)
+ {
+ iswap32(&hdr3c.bih.xd);
+ iswap32(&hdr3c.bih.yd);
+ iswap32(&hdr3c.bih.l0);
+ }
+ if (!SupressImage || !ImageRec[plane])
+ if (first_bih)
+ {
+ first_bih = 0;
+ print_bih((unsigned char *) &hdr3c);
+ }
+ if (0 && *cp == 1)
+ {
+ iswap32(&hdr3c.bih.xd);
+ iswap32(&hdr3c.bih.yd);
+ iswap32(&hdr3c.bih.l0);
+ }
+ if (FpRaw[plane][subplane])
+ fwrite(&hdr3c.bih, 1, 20, FpRaw[plane][subplane]);
+ if (FpDec[plane][subplane])
+ {
+ rc = jbg_dec_in(&s[plane][subplane],
+ (unsigned char *)&hdr3c.bih, 20, &cnt);
+ }
+ }
+
+ ImageRec[plane]++;
+
+ // image data
+ if (!hdr3c.padlen)
+ break;
+ size = hdr3c.datalen;
+ ibuf = malloc(size);
+ rc = fread(ibuf, 1, size, fp);
+ if (rc <= 0)
+ break;
+ curOff += size;
+ if (FpRaw[plane][subplane])
+ fwrite(ibuf, 1, size, FpRaw[plane][subplane]);
+ if (FpDec[plane][subplane])
+ {
+ unsigned char *image;
+
+ rc = JBG_EAGAIN;
+ p = ibuf;
+ while (size > 0 &&
+ (rc == JBG_EAGAIN || rc == JBG_EOK))
+ {
+ rc = jbg_dec_in(&s[plane][subplane],
+ (unsigned char *) p, size, &cnt);
+ p += cnt;
+ size -= cnt;
+ }
+ if (rc)
+ debug(0, "rc= %d size=%d\n", rc, size);
+
+ height[plane][subplane]
+ += jbg_dec_getheight(&s[plane][subplane]);
+ width[plane][subplane]
+ = jbg_dec_getwidth(&s[plane][subplane]);
+ image = jbg_dec_getimage(&s[plane][subplane], 0);
+ if (image)
+ fwrite(image, 1, jbg_dec_getsize(&s[plane][subplane]),
+ FpDec[plane][subplane]);
+ else
+ debug(0, "Missing image p=%d/%d %dx%d!\n",
+ plane, subplane,
+ jbg_dec_getwidth(&s[plane][subplane]),
+ jbg_dec_getheight(&s[plane][subplane]));
+ jbg_dec_free(&s[plane][subplane]);
+ }
+ free(ibuf);
+
+ size = hdr3c.padlen - hdr3c.datalen;
+ curOff += size;
+ while (size--)
+ c = fgetc(fp);
+ continue;
+ case 0x17:
+ printf(" (no args)");
+ for (i = 0; i < 4; ++i)
+ {
+ for (j = 0; j < 2; ++j)
+ {
+ if (FpRaw[i][j])
+ {
+ fclose(FpRaw[i][j]);
+ FpRaw[i][j] = NULL;
+ }
+ if (FpDec[i][j])
+ {
+ fseek(FpDec[i][j], 0, 0);
+ fprintf(FpDec[i][j], "P4\n%8d %8d\n",
+ width[i][j], height[i][j]);
+ fclose(FpDec[i][j]);
+ FpDec[i][j] = NULL;
+ }
+ }
+ }
+ while (size--)
+ fgetc(fp);
+ break;
+ case 0x18:
+ rc = fread(words, len = (1+1)*2, 1, fp);
+ if (rc != 1) goto out;
+ curOff += len;
+ printf(" UNK=%x", words[0]);
+ break;
+ case 0x0b:
+ printf(" (no args)");
+ curOff += size;
+ while (size--)
+ fgetc(fp);
+ break;
+ default:
+ curOff += size;
+ while (size--)
+ fgetc(fp);
+ }
+
+ printf("\n");
+ }
+out:
+ return;
+}
+
+int
+main(int argc, char *argv[])
+{
+ extern int optind;
+ extern char *optarg;
+ int c;
+
+ while ( (c = getopt(argc, argv, "d:ior:D:?h")) != EOF)
+ switch (c)
+ {
+ case 'd': DecFile = optarg; break;
+ case 'r': RawFile = optarg; break;
+ case 'i': SupressImage = 1; break;
+ case 'o': PrintOffset = 1; break;
+ case 'D': Debug = atoi(optarg); break;
+ default: usage(); exit(1);
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ decode(fp);
+ fclose(fp);
+ }
+ else
+ decode(stdin);
+
+ exit(0);
+}
diff --git a/oki.h b/oki.h
deleted file mode 100644
index bc2f2fc..0000000
--- a/oki.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Manifest constants for the ZjStream protocol (okidata flavor)
- */
-
-#include <inttypes.h>
-typedef uint32_t DWORD;
-typedef uint16_t WORD;
-typedef uint8_t BYTE;
-
-typedef enum {
- OKI_START_PAGE = 0,
- OKI_DATA = 1,
- OKI_END_PAGE = 255,
-} OKI_RECTYPE;
-
-typedef union _SWAP_32{
- char byte[sizeof(uint32_t)];
- uint32_t dword;
-} SWAP_32;
-
-typedef union _SWAP_16{
- char byte[sizeof(uint16_t)];
- uint16_t word;
-} SWAP_16;
-
-static inline uint32_t
-be32(uint32_t dword)
-{
- SWAP_32 swap;
- uint32_t probe = 1;
-
- if (((char *)&probe)[0] == 1)
- {
- swap.byte[3] = (( SWAP_32 )dword).byte[0];
- swap.byte[2] = (( SWAP_32 )dword).byte[1];
- swap.byte[1] = (( SWAP_32 )dword).byte[2];
- swap.byte[0] = (( SWAP_32 )dword).byte[3];
- return swap.dword;
- }
- else
- return dword;
-}
-
-static inline uint16_t
-be16(uint16_t word)
-{
- SWAP_16 swap;
- uint16_t probe = 1;
-
- if (((char *)&probe)[0] == 1)
- {
- swap.byte[1] = (( SWAP_16 )word).byte[0];
- swap.byte[0] = (( SWAP_16 )word).byte[1];
- return swap.word;
- }
- else
- return word;
-}
diff --git a/opldecode.1in b/opldecode.1in
index 22e1527..c5c6abb 100644
--- a/opldecode.1in
+++ b/opldecode.1in
@@ -1,187 +1,18 @@
-.TH rodecode 1 "${MODpage}" "rodecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (zjsdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+.TH opldecode 1 "${MODpage}" "opldecode ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
.SH NAME
-rodecode \- Decode a Raster Object (ro) stream into human readable form.
+opldecode \- Decode a Raster Object (opl) stream into human readable form.
.SH SYNOPSIS
-.B rodecode
+.B opldecode
.RI [ options "] <" zjs-file
.SH DESCRIPTION
-.B rodecode
-decodes a Raster Object (ro) stream into human readable form.
+.B opldecode
+decodes a Raster Object (opl) stream into human readable form.
.P
A Raster Object stream is the printer langauge used by some Konica Minolta
printers, such as the KM magicolor 2480 MF.
@@ -202,11 +33,11 @@ Print file offsets.
Set Debug level [0].
.SH EXAMPLES
-Decode an Raster Object stream file created by foo2ro.
+Decode an Raster Object stream file created by foo2lava-wrapper -z1.
.nf
.ft CW
-$ rodecode -h < testpage.prn
+$ foo2lava-wrapper -z1 testpage.ps | opldecode -h
0: Event=StartOfJob;
11: OSVersion=WindowsXP;
25: DrvVersion=2.0.1410.0;
@@ -276,10 +107,10 @@ $ rodecode -h < testpage.prn
.fi
.SH FILES
-.BR /usr/bin/rodecode
+.BR /usr/bin/opldecode
.SH SEE ALSO
-.BR foo2ro-wrapper (1),
-.BR foo2ro (1)
+.BR foo2lava-wrapper (1),
+.BR foo2opl (1)
.SH "AUTHOR"
Rick Richardson <rick.richardson@comcast.net>
.br
diff --git a/opldecode.c b/opldecode.c
index 681d395..ccf1a70 100644
--- a/opldecode.c
+++ b/opldecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: opldecode.c,v 1.2 2007/06/03 00:13:41 rick Exp $
+ * $Id: opldecode.c,v 1.5 2008/09/05 15:05:54 rick Exp $
*/
/*b
@@ -77,9 +77,9 @@ usage(void)
{
fprintf(stderr,
"Usage:\n"
-" rodecode [options] < zjs-file\n"
+" opldecode [options] < zjs-file\n"
"\n"
-" Decode a Raster Object (ro) stream into human readable form.\n"
+" Decode a Raster Object (opl) stream into human readable form.\n"
"\n"
" A Raster Object stream is the printer langauge used by some Konica\n"
" Minolta printers, such as the magicolor 2480 MF.\n"
@@ -223,7 +223,7 @@ jbig_decode1(unsigned char ch, int pn, int page, struct jbg_dec_state *pstate,
int h, w, len;
unsigned char *image;
- //debug(0, "JBG_OK: %d\n", pn);
+ //debug(0, "JBG_EOK: %d\n", pn);
h = jbg_dec_getheight(pstate);
w = jbg_dec_getwidth(pstate);
image = jbg_dec_getimage(pstate, 0);
@@ -351,12 +351,31 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- for(;;)
- {
- decode(stdin);
- c = getc(stdin); ungetc(c, stdin);
- if (feof(stdin))
- break;
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ for (;;)
+ {
+ decode(fp);
+ c = getc(fp); ungetc(c, fp);
+ if (feof(fp))
+ break;
+ }
+ fclose(fp);
+ }
+ else
+ {
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
}
printf("\n");
diff --git a/ppd-adjust b/ppd-adjust
new file mode 100755
index 0000000..5436b90
--- /dev/null
+++ b/ppd-adjust
@@ -0,0 +1,3 @@
+sed -e '/~*% For /i \
+*% (c) Copyright Rick Richardson 2008 \
+*%' -e '/~*NickName:/s/(/rkkda.com (/'
diff --git a/qpdldecode.1in b/qpdldecode.1in
index 6719e69..ebdfefe 100644
--- a/qpdldecode.1in
+++ b/qpdldecode.1in
@@ -1,176 +1,7 @@
.TH qpdldecode 1 "${MODpage}" "qpdldecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (zjsdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, QPDL) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -209,7 +40,7 @@ Decode an QPDL stream file created by foo2qpdl.
.nf
.ft CW
- 0: \033%-12345X@PJL DEFAULT SERVICEDATE=20070212
+ 0: \\033%-12345X@PJL DEFAULT SERVICEDATE=20070212
2c: @PJL SET USERNAME="Unknown"
49: @PJL SET JOBNAME="testpage.pdf"
6a: @PJL SET COLORMODE=COLOR
@@ -281,7 +112,7 @@ Decode an QPDL stream file created by foo2qpdl.
4209e: RECTYPE 0x1 len=3
copies=1
420a1: RECTYPE 0x9 len=0
- 420a2: \033%-12345X
+ 420a2: \\033%-12345X
.ft P
.fi
diff --git a/qpdldecode.c b/qpdldecode.c
index f323e3d..a7fc08f 100644
--- a/qpdldecode.c
+++ b/qpdldecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: qpdldecode.c,v 1.14 2007/06/29 01:51:48 rick Exp $
+ * $Id: qpdldecode.c,v 1.30 2008/09/18 09:35:34 rick Exp $
*/
/*b
@@ -171,7 +171,7 @@ decode(FILE *fp)
int c;
int rc;
FILE *dfp = NULL;
- int pageNum = 1;
+ int pageNum = 0;
int i;
int curOff = 0;
struct jbg_dec_state s[5];
@@ -210,7 +210,7 @@ decode(FILE *fp)
{
int reclen;
int rectype;
- int w, h, comp, stripe;
+ int wb, h, comp, stripe;
int cksum;
#define STRARY(X, A) \
@@ -223,6 +223,7 @@ decode(FILE *fp)
/*15*/ "UNK", "a5", "a6", "UNK", "UNK",
/*20*/ "UNK", "custom", "UNK", "envC6", "folio",
/*25*/ "env6.75", "env#9", "UNK", "oficio", "UNK",
+ /*30*/ "statement", "UNK", "UNK", "UNK", "UNK",
};
char *strsource[] = {
/*00*/ "unk", "auto", "manual", "multi", "tray1",
@@ -265,7 +266,7 @@ decode(FILE *fp)
goto done;
break;
case 0x00:
- printf(" len=17\n");
+ printf(" len=17 pageNum=%d\n", ++pageNum);
if (fread(buf+1, 16, 1, fp) != 1)
error(1, "Couldn't get 16 bytes\n");
curOff += 16;
@@ -292,6 +293,43 @@ decode(FILE *fp)
);
pn = 0;
+ memset(imageCnt, 0, sizeof(imageCnt));
+ break;
+ case 0x13:
+ printf(" len=15\n");
+ if (fread(buf+1, 14, 1, fp) != 1)
+ error(1, "Couldn't get 16 bytes\n");
+ curOff += 14;
+ printf("\t\t");
+ for (i = 1; i <= 14; ++i)
+ printf("%02x, ", buf[i]);
+ printf("\n");
+ break;
+ case 0x14:
+ /* BIH */
+ printf(" len=25\n");
+ if (fread(buf+1, 24, 1, fp) != 1)
+ error(1, "Couldn't get 16 bytes\n");
+ curOff += 24;
+ if (0)
+ {
+ printf("\t\t");
+ for (i = 1; i <= 16; ++i)
+ printf("%02x, ", (unsigned char) buf[i]);
+ printf("\n\t\t");
+ for (i = 17; i <= 24; ++i)
+ printf("%02x, ", (unsigned char) buf[i]);
+ }
+ else
+ {
+ printf("\t\t");
+ for (i = 21; i <= 24; ++i)
+ printf("%02x, ", (unsigned char) buf[i]);
+ }
+ printf("\n");
+ print_bih( (unsigned char *) buf+1);
+ for (i = 0; i <=4; ++i)
+ memcpy(bih[i], buf+1, 20);
break;
case 0x0c:
if (fread(buf+1, 11, 1, fp) != 1)
@@ -301,7 +339,7 @@ decode(FILE *fp)
}
curOff += 11;
stripe = buf[1];
- w = getBEword(buf+2);
+ wb = getBEword(buf+2);
h = getBEword(buf+4);
pn = buf[6];
comp = buf[7];
@@ -310,20 +348,24 @@ decode(FILE *fp)
reclen++;
if (comp == 0x11)
reclen++;
- printf(" len=%d(0x%x)\n", 12+reclen, 12+reclen);
+ printf("\tlen=%d(0x%x)\n", 12+reclen, 12+reclen);
printf("\t\tstripe=%d, WB=%d(0x%x), H=%d(0x%x), plane=%d, "
"comp=0x%x,\n\t\tlen=%d(0x%x)\n",
- stripe, w, w, h, h, pn, comp, reclen, reclen);
+ stripe, wb, wb, h, h, pn, comp, reclen, reclen);
if (fread(buf, reclen, 1, fp) != 1)
error(1, "Couldn't get 0x%x(%d) bytes\n", reclen, reclen);
curOff += reclen;
-
+
cksum = 0;
for (i = 0; i < reclen-4; ++i)
cksum += (unsigned char) buf[i];
- if ( ((unsigned char) buf[0]) == 0xef)
+ if (comp == 0x15)
+ {
+ if (0) printf("pn=%d\n", pn);
+ }
+ else if ( ((unsigned char) buf[0]) == 0xef)
{
ver = getLEdword(buf+0) >> 28;
end = (getBEdword(buf+8) >> 24) - 1;
@@ -366,10 +408,11 @@ decode(FILE *fp)
);
}
- if (comp == 0x13)
+ if (comp == 0x13 || comp == 0x15)
{
-printf("stripe=%d\n", stripe);
- if (stripe == 0)
+if (0) printf("stripe=%d\n", stripe);
+ // if ( (comp == 0x13 && stripe == 0) || comp == 0x15)
+ if (comp == 0x13 && stripe == 0)
{
size_t cnt;
@@ -382,12 +425,34 @@ printf("stripe=%d\n", stripe);
error(1, "JBIG uses unimpl feature\n");
break;
}
- else if (0 &&stripe == 1 && pn == 4)
- pn = 0;
+ else if (comp == 0x15)
+ {
+ size_t cnt;
+
+ jbg_dec_init(&s[pn]);
+ rc = jbg_dec_in(&s[pn], bih[pn], 20, &cnt);
+ if (rc == JBG_EIMPL)
+ error(1, "JBIG uses unimpl feature\n");
+ }
+ else if (comp == 0x13 && stripe >= 1)
+ {
+ printf("\t\tData: ");
+ for (i = 0; i < 16; ++i)
+ printf("%02x ", (unsigned char) buf[32+i]);
+ printf("...\n");
+ }
if (DecFile)
{
- for (i = 32; i < reclen; ++i)
+ if (comp == 0x15)
+ {
+ reclen -= 4;
+ i = 0;
+ }
+ else
+ i = 32;
+if (0 && comp == 0x15) printf("c=%02x ", (unsigned char) buf[i]);
+ for (; i < reclen; ++i)
{
size_t cnt;
unsigned char ch = c;
@@ -395,23 +460,28 @@ printf("stripe=%d\n", stripe);
ch = c = buf[i];
rc = JBG_EAGAIN;
+if (0 && comp == 0x15) printf("i=%d ", i);
rc = jbg_dec_in(&s[pn], &ch, 1, &cnt);
+if (0 && comp == 0x15) printf("rc=%d ", rc);
+if (0 && comp == 0x15 && i == (reclen-1)) printf("c=%02x ", ch);
+if (0 && comp == 0x15 && i == (reclen-2)) printf("c=%02x ", ch);
if (rc == JBG_EOK)
{
int h, w, len;
unsigned char *image;
-printf("OK\n");
- // debug(0, "JBG_OK: %d\n", pn);
+if (0 && comp == 0x15) printf("OK\n");
+if (0) printf("OK\n");
+ // debug(0, "JBG_EOK: %d\n", pn);
h = jbg_dec_getheight(&s[pn]);
w = jbg_dec_getwidth(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
len = jbg_dec_getsize(&s[pn]);
- if (image)
+ if (comp == 0x13 && image)
{
char buf[512];
sprintf(buf, "%s-%02d-%d.pbm",
- DecFile, pageNum, pn-1);
+ DecFile, pageNum, pn);
dfp = fopen(buf,
imageCnt[pn] ? "a" : "w");
if (dfp)
@@ -421,6 +491,29 @@ printf("OK\n");
//imageCnt[pn] += incrY;
fwrite(image, 1, len, dfp);
fclose(dfp);
+ dfp = NULL;
+ }
+ }
+ else if (comp == 0x15 && image)
+ {
+ char buf[512];
+ if (dfp == 0)
+ {
+ sprintf(buf, "%s-%02d-%d.pbm",
+ DecFile, pageNum, pn);
+ dfp = fopen(buf,
+ imageCnt[pn] ? "r+" : "w");
+ }
+ if (dfp)
+ {
+ fseek(dfp, 0, SEEK_SET);
+ // if (imageCnt[pn] == 0)
+ fprintf(dfp, "P4\n%8d %8d\n", w, h*stripe);
+ imageCnt[pn] += 1;
+ fseek(dfp, stripe * h * wb, SEEK_SET);
+ fwrite(image, 1, len, dfp);
+ fclose(dfp);
+ dfp = NULL;
}
}
else
@@ -484,7 +577,18 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- decode(stdin);
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ decode(fp);
+ fclose(fp);
+ }
+ else
+ decode(stdin);
exit(0);
}
diff --git a/regress.txt b/regress.txt
new file mode 100644
index 0000000..6dbdde1
--- /dev/null
+++ b/regress.txt
@@ -0,0 +1,55 @@
+# gs 7.05, gs 8.60, 8.61
+eafcf2ab43e8ecea78d1663491629869 testpage.zm 7.05 i386
+57e9101eb2b95db9ce519d108d06c2ec testpage.zm 8.60 x86_64
+3365dcef45a03b3686c00da0f5f711c3 testpage.zm 8.61 i386
+
+#
+94b77586bab210ad54eaf7b652817a4c testpage.zc10 7.05
+1c35cb5f615ab68acea9c271c8aeaf63 testpage.zc10 8.60amd
+e39c15277195366b9404c104640f275d testpage.zc10 8.61
+01244f6071a0394006b9482369d7cc16 testpage.zc10 8.62
+4d8fd851ce9b51c7b3d20e319c451874 testpage.zc10 8.61 ubuntu
+
+
+#
+29788ba74874c9be35ab1f8bcc5719b6 testpage.zc1 7.05
+6c39935476de0dffa94fe518296bcff9 testpage.zc1 8.60amd
+bf33fd5d11fbfb5c77215c83d24cb150 testpage.zc1 8.61
+699d7bb94cad6ec740a6fdc60772a09c testpage.zc1 8.61 ubuntu
+
+#
+69985fd15f67a66e79e8313a3c53e0d2 testpage.zc2 7.05
+dde475751f73eea612df7f1b2af4e084 testpage.zc2 8.60amd
+a3a5c601c846f90426368ebde349e42c testpage.zc2 8.61
+e6e9bd42e185eba3accc9170c97d6a4f testpage.zc2 8.61 ubuntu
+
+#
+061b4f389141cd0c71b95ca57a9f918c testpage.zc3 7.05
+41f7b2322d6262deff7514581f0432d4 testpage.zc3 8.60amd
+d0527fbf184f5f8594b9cafc2f8a266c testpage.zc3 8.61
+fb9defdcba1e5259f33e339f7f17e41e testpage.zc3 8.61 ubuntu
+
+#
+8ad5eb57140eca3a4cddc76645bcb9b4 lj1000.zm 7.05
+f30e09990c7c2ad460074fb38c3a1720 lj1000.zm 8.60amd
+89bb9a6748b9010d763e47ed5923460c lj1000.zm 8.61
+46d4a9157a2282a64a9b37e361b0059c lj1000.zm 8.62amd
+
+#
+afed329ee495b7575b908680a2512c30 lj1020.zm 7.05
+d124d799527de22bc65a3ad26acc9dd4 lj1020.zm 8.60amd
+b9c2e0cb9db463a219ec6decff4800f0 lj1020.zm 8.61
+41c692fa8af353ae36c7cc607b50440a lj1020.zm 8.62amd
+
+#
+b4ccadb72f1b386b1caabeed85c269dd lj2600.zm1 7.05
+282e09f3981560801842cc2b1c9bff0c lj2600.zm1 8.60amd
+4551ad72c645ad165ea614f7cdd5b666 lj2600.zm1 8.61
+a768fc2854434276dd8a274896af5d4f lj2600.zm1 8.62amd
+
+#
+500ee54205b85d18407b56cfea5cbb02 lj2600.zc1 7.05
+cf06670c4ad27e58aca458e612e059f8 lj2600.zc1 8.60amd
+452508bb8a7f8f501d47739ad25a9754 lj2600.zc1 8.61
+ddcdc6e87de6560bfc4e6053509ad575 lj2600.zc1 8.62amd
+312ddcb33b16698866eb4aa5f2b595fd lj2600.zc1 8.61 ubuntu
diff --git a/slx.h b/slx.h
new file mode 100644
index 0000000..1def925
--- /dev/null
+++ b/slx.h
@@ -0,0 +1,254 @@
+/*
+ * Manifest constants for the Software Imaging K.K. protocol
+ * for Lexmark printers.
+ *
+ * I.E. its a knock off of ZjStream...
+ */
+
+#include <inttypes.h>
+typedef uint32_t DWORD;
+typedef uint16_t WORD;
+typedef uint8_t BYTE;
+
+typedef enum {
+ SLT_START_DOC = 0,
+ SLT_END_DOC = 1,
+ SLT_START_PAGE = 2,
+ SLT_END_PAGE = 3,
+ SLT_JBIG_BIH = 4, // Bi-level Image Header
+ SLT_JBIG_BID = 5, // Bi-level Image Data blocks
+ SLT_END_JBIG = 6,
+ SLT_SIGNATURE = 7,
+ SLT_RAW_IMAGE = 8, // full uncompressed plane follows
+ SLT_START_PLANE = 9,
+ SLT_END_PLANE =10,
+
+ SLT_2600N_PAUSE =11,
+ SLT_2600N =12, // hplj2600n
+} SL_TYPE;
+
+typedef struct _SL_HEADER {
+ DWORD size; /* total record size, includes sizeof(SL_HEADER) */
+ DWORD type; /* SL_TYPE */
+ DWORD items; /* use varies by Type, e.g. item count */
+ WORD reserved; /* later to be sumcheck or CRC */
+ WORD signature; /* 'ZZ' */
+} SL_HEADER;
+
+typedef enum {
+/*
+ * 0x0000-0x7FFF : Zenographics reserved
+ */
+ /* for START_DOC */
+ SLI_PAGECOUNT = 0, // number of SLT_START_PAGE / SLT_END_PAGE
+ // pairs, if known
+ SLI_DMCOLLATE = 1, //
+ SLI_DMDUPLEX = 2, //
+ SLI_DISPLAY = 3, // Display string (16 letters max)
+ SLI_DISPLAY_PC = 4, // Display Paper Change string (4 letters max)
+ SLI_PRINT_SLOWLY = 5, // Print slowly
+ SLI_REMOVE_SLEEP_MODE= 6, // Remove Sleep Mode
+ SLI_USE_SEP_SHEETS = 8, // Use separator sheets
+ SLI_COUNT = 10, // An increasing count
+
+ /* for START_PAGE */
+ SLI_DMPAPER = 0x100, // E.G. letter, a4, etc.
+ SLI_DMCOPIES = 0x101, // from DEVMODE
+ SLI_DMDEFAULTSOURCE = 0x102, // from DEVMODE (DMBIN?)
+ SLI_DMMEDIATYPE = 0x103, // from DEVMODE
+ SLI_NBIE = 0x104, // number of Bi-level Image Entities,
+ // e.g. 1 for monochrome, 4 for color
+ SLI_RESOLUTION_X = 0x105, // dots per inch
+ SLI_RESOLUTION_Y = 0x106,
+ SLI_OFFSET_X = 0x107, // upper left corner
+ SLI_OFFSET_Y = 0x108,
+ SLI_RASTER_X = 0x109, // raster dimensions
+ SLI_RASTER_Y = 0x10a,
+ SLI_CUSTOM_X = 0x10b, // Custom Page Width
+ SLI_CUSTOM_Y = 0x10c, // Custom Page Width
+ SLI_VIDEO_X = 0x10d, // video dimensions (if diff. than raster)
+ SLI_VIDEO_Y = 0x10e,
+
+ SLI_PAD =99, // bogus item type for padding stream
+
+ SLI_LAST
+} SL_ITEM;
+
+typedef enum
+{
+ DMDUPLEX_OFF = 1,
+ DMDUPLEX_LONGEDGE = 2,
+ DMDUPLEX_SHORTEDGE = 3,
+ DMDUPLEX_MANUALLONG = 4,
+ DMDUPLEX_MANUALSHORT= 5
+} DMDUPLEX;
+
+typedef enum {
+ DMBIN_AUTO = 0,
+ DMBIN_CASSETTE1 = 1,
+} DM_BIN;
+
+typedef enum {
+ DMMEDIA_STANDARD = 0, // Standard paper
+ DMMEDIA_TRANSPARENCY= 1, // Transparency
+
+ DMMEDIA_GLOSSY = 3, // Glossy paper
+ DMMEDIA_USER = 4, // Device-specific media start here
+
+ DMMEDIA_ENVELOPE = 0x101, // Envelope
+ DMMEDIA_LETTERHEAD = 0x103, // Letterhead
+ DMMEDIA_THICK_STOCK = 0x105, // Thick Stock
+ DMMEDIA_POSTCARD = 0x106, // Postcard
+ DMMEDIA_LABELS = 0x107, // Labels
+} DMMEDIA;
+
+typedef enum {
+ DMCOLOR_MONOCHROME = 1,
+ DMCOLOR_COLOR = 2,
+} DMCOLOR;
+
+typedef enum {
+ DMORIENT_PORTRAIT = 1,
+ DMORIENT_LANDSCAPE = 2,
+} DMORIENT;
+
+typedef enum {
+ DMPAPER_A4 = 2, // A4 Sheet, 210- by 297-millimeters
+ DMPAPER_LETTER = 6, // Letter, 8 1/2- by 11-inches
+
+ DMPAPER_LETTERSMALL = 2, // Letter Small, 8 1/2- by 11-inches
+ DMPAPER_TABLOID = 3, // Tabloid, 11- by 17-inches
+ DMPAPER_LEDGER = 4, // Ledger, 17- by 11-inches
+ DMPAPER_LEGAL = 5, // Legal, 8 1/2- by 14-inches
+ DMPAPER_STATEMENT = 6, // Statement, 5 1/2- by 8 1/2-inches
+ DMPAPER_EXECUTIVE = 7, // Executive, 7 1/4- by 10 1/2-inches
+ DMPAPER_A3 = 8, // A3 sheet, 297- by 420-millimeters
+ DMPAPER_A4SMALL =10, // A4 small sheet, 210- by 297-millimeters
+ DMPAPER_A5 =11, // A5 sheet, 148- by 210-millimeters
+ DMPAPER_B4 =12, // B4 sheet, 250- by 354-millimeters
+ DMPAPER_B5 =13, // B5 sheet, 182- by 257-millimeter paper
+ DMPAPER_FOLIO =14, // Folio, 8 1/2- by 13-inch paper
+ DMPAPER_QUARTO =15, // Quarto, 215- by 275-millimeter paper
+ DMPAPER_10X14 =16, // 10- by 14-inch sheet
+ DMPAPER_11X17 =17, // 11- by 17-inch sheet
+ DMPAPER_NOTE =18, // Note, 8 1/2- by 11-inches
+ DMPAPER_ENV_9 =19, // #9 Envelope, 3 7/8- by 8 7/8-inches
+ DMPAPER_ENV_10 =20, // #10 Envelope, 4 1/8- by 9 1/2-inches
+ DMPAPER_ENV_11 =21, // #11 Envelope, 4 1/2- by 10 3/8-inches
+ DMPAPER_ENV_12 =22, // #12 Envelope, 4 3/4- by 11-inches
+ DMPAPER_ENV_14 =23, // #14 Envelope, 5- by 11 1/2-inches
+ DMPAPER_CSHEET =24, // C Sheet, 17- by 22-inches
+ DMPAPER_DSHEET =25, // D Sheet, 22- by 34-inches
+ DMPAPER_ESHEET =26, // E Sheet, 34- by 44-inches
+ DMPAPER_ENV_DL =27, // DL Envelope, 110- by 220-millimeters
+ DMPAPER_ENV_C5 =28, // C5 Envelope, 162- by 229-millimeters
+ DMPAPER_ENV_C3 =29, // C3 Envelope, 324- by 458-millimeters
+ DMPAPER_ENV_C4 =30, // C4 Envelope, 229- by 324-millimeters
+ DMPAPER_ENV_C6 =31, // C6 Envelope, 114- by 162-millimeters
+ DMPAPER_ENV_C65 =32, // C65 Envelope, 114- by 229-millimeters
+ DMPAPER_ENV_B4 =33, // B4 Envelope, 250- by 353-millimeters
+ DMPAPER_ENV_B5 =34, // B5 Envelope, 176- by 250-millimeters
+ DMPAPER_ENV_B6 =35, // B6 Envelope, 176- by 125-millimeters
+ DMPAPER_ENV_ITALY =36, // Italy Envelope, 110- by 230-millimeters
+ DMPAPER_ENV_MONARCH =37, // Monarch Envelope, 3 7/8- by 7 1/2-inches
+ DMPAPER_ENV_PERSONAL=38, // 6 3/4 Envelope, 3 5/8- by 6 1/2-inches
+ DMPAPER_FANFOLD_US =39, // US Std Fanfold, 14 7/8- by 11-inches
+ DMPAPER_FANFOLD_STD_GERMAN =40, // German Std Fanfold, 8 1/2 x 12 in
+ DMPAPER_FANFOLD_LGL_GERMAN =41, // German Legal Fanfold, 8 1/2 x 13 in
+
+ DMPAPER_ISO_B4 =42, // B4 (ISO) 250 x 353 mm
+ DMPAPER_JAPANESE_POSTCARD =43, // Japanese Postcard 100 x 148 mm
+ DMPAPER_9X11 =44, // 9 x 11 in
+ DMPAPER_10X11 =45, // 10 x 11 in
+ DMPAPER_15X11 =46, // 15 x 11 in
+ DMPAPER_ENV_INVITE =47, // Envelope Invite 220 x 220 mm
+ DMPAPER_RESERVED_48 =48, // RESERVED--DO NOT USE
+ DMPAPER_RESERVED_49 =49, // RESERVED--DO NOT USE
+ DMPAPER_LETTER_EXTRA =50, // Letter Extra 9 \275 x 12 in
+ DMPAPER_LEGAL_EXTRA =51, // Legal Extra 9 \275 x 15 in
+ DMPAPER_TABLOID_EXTRA =52, // Tabloid Extra 11.69 x 18 in
+ DMPAPER_A4_EXTRA =53, // A4 Extra 9.27 x 12.69 in
+ DMPAPER_LETTER_TRANSVERSE =54, // Letter Transverse 8 \275 x 11 in
+ DMPAPER_A4_TRANSVERSE =55, // A4 Transverse 210 x 297 mm
+ DMPAPER_LETTER_EXTRA_TRANSVERSE=56, // Letter Extra Transverse 9\275 x 12 in
+ DMPAPER_A_PLUS =57, // SuperA/SuperA/A4 227 x 356 mm
+ DMPAPER_B_PLUS =58, // SuperB/SuperB/A3 305 x 487 mm
+ DMPAPER_LETTER_PLUS =59, // Letter Plus 8.5 x 12.69 in
+ DMPAPER_A4_PLUS =60, // A4 Plus 210 x 330 mm
+ DMPAPER_A5_TRANSVERSE =61, // A5 Transverse 148 x 210 mm
+ DMPAPER_B5_TRANSVERSE =62, // B5 (JIS) Transverse 182 x 257 mm
+ DMPAPER_A3_EXTRA =63, // A3 Extra 322 x 445 mm
+ DMPAPER_A5_EXTRA =64, // A5 Extra 174 x 235 mm
+ DMPAPER_B5_EXTRA =65, // B5 (ISO) Extra 201 x 276 mm
+ DMPAPER_A2 =66, // A2 420 x 594 mm
+ DMPAPER_A3_TRANSVERSE =67, // A3 Transverse 297 x 420 mm
+ DMPAPER_A3_EXTRA_TRANSVERSE =68, // A3 Extra Transverse 322 x 445 mm
+} DMPAPER;
+
+typedef enum {
+ SLIT_UINT32 = 1, // unsigned integer
+ SLIT_INT32 = 2, // signed integer
+ SLIT_STRING = 3, // byte string, NUL-terminated, DWORD-aligned
+ SLIT_BYTELUT= 4 // DWORD count followed by that many byte entries
+} SL_ITEM_TYPE;
+
+typedef struct _SL_ITEM_HEADER {
+ DWORD size; // total record size, includes sizeof(SL_ITEM_HEADER)
+ WORD item; // SL_ITEM
+ BYTE type; // SL_ITEM_TYPE
+ BYTE param; // general use
+} SL_ITEM_HEADER;
+
+typedef struct _SL_ITEM_UINT32 {
+ SL_ITEM_HEADER header;
+ DWORD value;
+} SL_ITEM_UINT32;
+
+typedef struct _SL_ITEM_INT32 {
+ SL_ITEM_HEADER header;
+ int32_t value;
+} SL_ITEM_INT32;
+
+typedef union _SWAP_32{
+ char byte[sizeof(uint32_t)];
+ uint32_t dword;
+} SWAP_32;
+
+typedef union _SWAP_16{
+ char byte[sizeof(uint16_t)];
+ uint16_t word;
+} SWAP_16;
+
+static inline uint32_t
+be32(uint32_t dword)
+{
+ SWAP_32 swap;
+ uint32_t probe = 1;
+
+ if (((char *)&probe)[0] == 1)
+ {
+ swap.byte[3] = (( SWAP_32 )dword).byte[0];
+ swap.byte[2] = (( SWAP_32 )dword).byte[1];
+ swap.byte[1] = (( SWAP_32 )dword).byte[2];
+ swap.byte[0] = (( SWAP_32 )dword).byte[3];
+ return swap.dword;
+ }
+ else
+ return dword;
+}
+
+static inline uint16_t
+be16(uint16_t word)
+{
+ SWAP_16 swap;
+ uint16_t probe = 1;
+
+ if (((char *)&probe)[0] == 1)
+ {
+ swap.byte[1] = (( SWAP_16 )word).byte[0];
+ swap.byte[0] = (( SWAP_16 )word).byte[1];
+ return swap.word;
+ }
+ else
+ return word;
+}
diff --git a/slxdecode.1in b/slxdecode.1in
new file mode 100644
index 0000000..831ba07
--- /dev/null
+++ b/slxdecode.1in
@@ -0,0 +1,109 @@
+.TH slxdecode 1 "${MODpage}" "slxdecode ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+slxdecode \- Decode a SLX stream into human readable form.
+.SH SYNOPSIS
+.B slxdecode
+.RI [ options "] <" slx-file
+.SH DESCRIPTION
+.B slxdecode
+decodes a SLX stream into human readable form.
+.P
+A SLX stream is the printer langauge used by some Lexmark
+printers, such as the C500.
+.P
+More information on the Software Imaging K.K. SLX stream can be found at:
+.P
+.RS
+http://softwareimaging.com/products-services/sorcerer/index.asp
+.RE
+
+.SH COMMAND LINE OPTIONS
+These are the options that can appear on the command line.
+.TP
+.BI \-d\0 basename
+Basename of .pbm file for saving decompressed planes.
+.TP
+.BI \-r\0 basename
+Basename of .jbg file for saving raw planes
+.TP
+.BI \-h
+Print hex file offsets.
+.TP
+.BI \-o
+Print file offsets.
+.TP
+.BI \-D\0 level
+Set Debug level [0].
+
+.SH EXAMPLES
+Decode an SLX file created by foo2slx.
+
+.nf
+.ft CW
+$ slxdecode < testpage.zm
+SLX_MAGIC, 0x584c53a5 (SLX)
+SLT_START_DOC, 12 items
+ SLI_PAGECOUNT, 4294967295 (0xffffffff)
+ SLI_DMDUPLEX, 0 (0x0)
+ SLI_DMCOLLATE, 0 (0x0)
+ SLI_0x3, 0 (0x0)
+ SLI_DISPLAY, 0 (0x0)
+ SLI_0x5, 0 (0x0)
+ SLI_0x6, 0 (0x0)
+ SLI_0x7, 1 (0x1)
+ SLI_0x8, 0 (0x0)
+ SLI_0x9, 0 (0x0)
+ SLI_COUNT, 1 (0x1)
+ SLI_DMCOLLATE, 0 (0x0)
+SLT_START_PAGE, 16 items [Page 1]
+ SLI_DMPAPER, 6 (0x6)
+ SLI_CUSTOM_X, 0 (0x0)
+ SLI_CUSTOM_Y, 0 (0x0)
+ SLI_DMCOPIES, 1 (0x1)
+ SLI_DMDEFAULTSOURCE, 0 (0x0)
+ SLI_DMMEDIATYPE, 0 (0x0)
+ SLI_NBIE, 0 (0x0)
+ SLI_RESOLUTION_X, 600 (0x258)
+ SLI_RESOLUTION_Y, 600 (0x258)
+ SLI_OFFSET_X, 102 (0x66)
+ SLI_OFFSET_Y, 102 (0x66)
+ SLI_RASTER_X, 4896 (0x1320)
+ SLI_RASTER_Y, 6392 (0x18f8)
+ SLI_0x10d, 4896 (0x1320)
+ SLI_0x10e, 6392 (0x18f8)
+ SLI_0x10f, 1 (0x1)
+SLT_JBIG_BIH, 0 items
+ Data: 20 bytes
+ DL = 0, D = 0, P = 1, - = 0, XY = 4896 x 6392
+ L0 = 128, MX = 0, MY = 0
+ Order = 0
+ Options = 8 TPBON
+ 50 stripes, 0 layers, 1 planes
+SLT_JBIG_BID, 0 items
+ Data: 116 bytes
+SLT_END_JBIG, 0 items
+SLT_END_PAGE, 0 items
+SLT_END_DOC, 0 items
+.ft P
+.fi
+
+.SH FILES
+.BR /usr/bin/slxdecode
+.SH SEE ALSO
+.BR foo2slx-wrapper (1),
+.BR foo2slx (1),
+.BR jbg2pbm (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLSLX}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/slxdecode.c b/slxdecode.c
new file mode 100644
index 0000000..228c3f5
--- /dev/null
+++ b/slxdecode.c
@@ -0,0 +1,598 @@
+/*
+ * $Id: slxdecode.c,v 1.14 2008/09/23 23:30:35 rick Exp $
+ */
+
+/*b
+ * Copyright (C) 2003-2006 Rick Richardson
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Author: Rick Richardson <rick.richardson@comcast.net>
+b*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include "slx.h"
+#include "jbig.h"
+
+/*
+ * Global option flags
+ */
+int Debug = 0;
+char *RawFile;
+char *DecFile;
+int PrintOffset = 0;
+int PrintHexOffset = 0;
+
+void
+debug(int level, char *fmt, ...)
+{
+ va_list ap;
+
+ if (Debug < level)
+ return;
+
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+}
+
+int
+error(int fatal, char *fmt, ...)
+{
+ va_list ap;
+
+ fprintf(stderr, fatal ? "Error: " : "Warning: ");
+ if (errno)
+ fprintf(stderr, "%s: ", strerror(errno));
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ if (fatal > 0)
+ exit(fatal);
+ else
+ {
+ errno = 0;
+ return (fatal);
+ }
+}
+
+void
+usage(void)
+{
+ fprintf(stderr,
+"Usage:\n"
+" slxdecode [options] < zjs-file\n"
+"\n"
+" Decode a SLX stream into human readable form.\n"
+"\n"
+" A SLX stream is the printer langauge used by some Lexmark\n"
+" printers, such as the C500n.\n"
+"\n"
+" More information on SLX Stream can be found at:\n"
+"\n"
+" http://softwareimaging.com/products-services/sorcerer/index.asp\n"
+"\n"
+"Options:\n"
+" -d basename Basename of .pbm file for saving decompressed planes\n"
+" -r basename Basename of .jbg file for saving raw planes\n"
+" -o Print file offsets\n"
+" -h Print hex file offsets\n"
+" -D lvl Set Debug level [%d]\n"
+ , Debug
+ );
+
+ exit(1);
+}
+
+void
+print_bih(unsigned char bih[20])
+{
+ unsigned int xd, yd, l0;
+
+ xd = (bih[4] << 24) | (bih[5] << 16) | (bih[6] << 8) | (bih[7] << 0);
+ yd = (bih[8] << 24) | (bih[9] << 16) | (bih[10] << 8) | (bih[11] << 0);
+ l0 = (bih[12] << 24) | (bih[13] << 16) | (bih[14] << 8) | (bih[15] << 0);
+
+ printf(" DL = %d, D = %d, P = %d, - = %d, XY = %d x %d\n",
+ bih[0], bih[1], bih[2], bih[3], xd, yd);
+
+ printf(" L0 = %d, MX = %d, MY = %d\n",
+ l0, bih[16], bih[17]);
+
+ printf(" Order = %d %s%s%s%s%s\n", bih[18],
+ bih[18] & JBG_HITOLO ? " HITOLO" : "",
+ bih[18] & JBG_SEQ ? " SEQ" : "",
+ bih[18] & JBG_ILEAVE ? " ILEAVE" : "",
+ bih[18] & JBG_SMID ? " SMID" : "",
+ bih[18] & 0xf0 ? " other" : "");
+
+ printf(" Options = %d %s%s%s%s%s%s%s%s\n", bih[19],
+ bih[19] & JBG_LRLTWO ? " LRLTWO" : "",
+ bih[19] & JBG_VLENGTH ? " VLENGTH" : "",
+ bih[19] & JBG_TPDON ? " TPDON" : "",
+ bih[19] & JBG_TPBON ? " TPBON" : "",
+ bih[19] & JBG_DPON ? " DPON" : "",
+ bih[19] & JBG_DPPRIV ? " DPPRIV" : "",
+ bih[19] & JBG_DPLAST ? " DPLAST" : "",
+ bih[19] & 0x80 ? " other" : "");
+ printf(" %u stripes, %d layers, %d planes\n",
+ ((yd >> bih[1]) + ((((1UL << bih[1]) - 1) & xd) != 0) + l0 - 1) / l0,
+ bih[1] - bih[0], bih[2]);
+}
+
+void
+decode(FILE *fp)
+{
+ DWORD magic;
+ SL_HEADER hdr;
+ int c;
+ int rc;
+ int size;
+ int items;
+ char *codestr;
+ FILE *dfp = NULL;
+ FILE *rfp = NULL;
+ int pageNum = 0;
+ int padding;
+ int len;
+ int curOff = 0;
+ struct jbg_dec_state s[5];
+ unsigned char bih[20];
+ int bihlen = 0;
+ int imageCnt[5] = {0,0,0,0,0};
+ int pn = 0;
+ int incrY = 0;
+ int totSize = 0;
+
+ /*
+ * Zenographics ZX format
+ */
+ c = getc(fp);
+ if (c == EOF)
+ {
+ printf("EOF on file reading header.\n");
+ return;
+ }
+ ungetc(c, fp);
+ if (c == '\033')
+ {
+ char buf[1024];
+
+ while (fgets(buf, sizeof(buf), fp))
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ if (buf[0] == '\033')
+ {
+ printf("\\033");
+ fputs(buf+1, stdout);
+ }
+ else
+ fputs(buf, stdout);
+ curOff += strlen(buf);
+ if (strcmp(buf, "@PJL ENTER LANGUAGE = ZJS\r\n") == 0)
+ break;
+ if (strcmp(buf, "@PJL USTATUS TIMED = 30\n") == 0)
+ {
+ rc = fread(buf, 52, 1, fp);
+ break;
+ }
+ }
+ if (feof(fp))
+ {
+ printf("\n");
+ return;
+ }
+ }
+
+ /*
+ * Software Imaging K.K. SLX_MAGIC format
+ */
+ rc = fread(&magic, len = sizeof(magic), 1, fp);
+ if (rc != 1)
+ {
+ printf("Missing SLX Magic number\n");
+ return;
+ }
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+ printf("SLX_MAGIC, 0x%lx (%.3s)\n", (long)magic, (char *) &magic + 1);
+
+ if (memcmp((char *) &magic, "\245SLX", 4) &&
+ memcmp((char *) &magic, "XLS\245", 4))
+ {
+ printf(" Don't understand magic number 0x%lx\n", (long)magic);
+ return;
+ }
+
+ curOff += len;
+ for (;;)
+ {
+ if (PrintOffset)
+ printf("%d: ", curOff);
+ else if (PrintHexOffset)
+ printf("%6x: ", curOff);
+
+ rc = fread(&hdr, len = sizeof(hdr), 1, fp);
+ if (rc != 1) break;
+ curOff += len;
+
+ hdr.type = be32(hdr.type);
+ hdr.size = be32(hdr.size);
+ hdr.items = be32(hdr.items);
+ hdr.reserved = be16(hdr.reserved);
+ hdr.signature = be16(hdr.signature);
+
+ #define CODESTR(X) case X: codestr = #X;
+ switch (hdr.type)
+ {
+ CODESTR(SLT_START_DOC) break;
+ CODESTR(SLT_END_DOC) break;
+ CODESTR(SLT_START_PAGE) ++pageNum;
+ memset(imageCnt, 0, sizeof(imageCnt));
+ totSize = 0;
+ break;
+ CODESTR(SLT_END_PAGE) pn = 0;
+ break;
+ CODESTR(SLT_JBIG_BIH) break;
+ CODESTR(SLT_JBIG_BID) break;
+ CODESTR(SLT_END_JBIG) break;
+ CODESTR(SLT_SIGNATURE) break;
+ CODESTR(SLT_RAW_IMAGE) break;
+ CODESTR(SLT_START_PLANE) break;
+ CODESTR(SLT_END_PLANE) break;
+ CODESTR(SLT_2600N_PAUSE) break;
+ CODESTR(SLT_2600N) break;
+ default: codestr = NULL; break;
+ }
+
+ if (codestr)
+ printf("%s, %ld items", codestr, (long) hdr.items);
+ else
+ printf("SLT_0x%lx, %ld items", (long) hdr.type, (long) hdr.items);
+ if (hdr.size & 3)
+ {
+ printf(" (unaligned size)");
+ padding = 4 - (hdr.size & 3);
+ }
+ else
+ padding = 0;
+ if (hdr.reserved)
+ printf(" (reserved=0x%x)", hdr.reserved);
+ if (hdr.signature != 0xa5a5)
+ printf(" (funny siggy 0x%x)", hdr.signature);
+ if (hdr.type == SLT_START_PAGE)
+ printf(" [Page %d]", pageNum);
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ switch (++pn)
+ {
+ case 1: printf(" [black]"); break;
+ case 2: printf(" [cyan]"); break;
+ case 3: printf(" [magenta]"); break;
+ case 4: printf(" [yellow]"); break;
+ }
+ }
+ printf("\n");
+ fflush(stdout);
+
+ items = hdr.items;
+ size = hdr.size - sizeof(hdr);
+
+ while (items--)
+ {
+ SL_ITEM_HEADER ihdr;
+ int isize;
+ DWORD val;
+ char buf[512];
+ int i, c;
+
+ if (PrintOffset)
+ printf(" %d: ", curOff);
+ else if (PrintHexOffset)
+ printf(" %6x: ", curOff);
+
+ size -= sizeof(ihdr);
+
+ rc = fread(&ihdr, len = sizeof(ihdr), 1, fp);
+ if (rc != 1) break;
+ curOff += len;
+
+ ihdr.size = be32(ihdr.size);
+ ihdr.item = be16(ihdr.item);
+
+ isize = ihdr.size - sizeof(ihdr);
+ size -= isize;
+
+ switch (ihdr.item)
+ {
+ CODESTR(SLI_PAGECOUNT) break;
+ CODESTR(SLI_DMCOLLATE) break;
+ CODESTR(SLI_DMDUPLEX) break;
+ CODESTR(SLI_DISPLAY) break;
+ CODESTR(SLI_DISPLAY_PC) break;
+ CODESTR(SLI_PRINT_SLOWLY) break;
+ CODESTR(SLI_REMOVE_SLEEP_MODE) break;
+ CODESTR(SLI_USE_SEP_SHEETS) break;
+ CODESTR(SLI_COUNT) break;
+
+ CODESTR(SLI_DMPAPER) break;
+ CODESTR(SLI_DMCOPIES) break;
+ CODESTR(SLI_DMDEFAULTSOURCE) break;
+ CODESTR(SLI_DMMEDIATYPE) break;
+ CODESTR(SLI_NBIE) break;
+ CODESTR(SLI_RESOLUTION_X) break;
+ CODESTR(SLI_RESOLUTION_Y) break;
+ CODESTR(SLI_OFFSET_X) break;
+ CODESTR(SLI_OFFSET_Y) break;
+ CODESTR(SLI_RASTER_X) break;
+ CODESTR(SLI_RASTER_Y) break;
+ CODESTR(SLI_CUSTOM_X) break;
+ CODESTR(SLI_CUSTOM_Y) break;
+ CODESTR(SLI_VIDEO_X) break;
+ CODESTR(SLI_VIDEO_Y) break;
+ default: codestr = NULL; break;
+ }
+
+ switch (ihdr.type)
+ {
+ case SLIT_UINT32:
+ fread(&val, len = sizeof(val), 1, fp);
+ curOff += len;
+ val = be32(val);
+ isize -= 4;
+ if (codestr)
+ printf(" %s, %ld (0x%lx) %s",
+ codestr, (long) val, (long) val,
+ ihdr.type == SLIT_INT32 ? "(int)" : "");
+ else
+ printf(" SLI_0x%x, %ld (0x%lx) %s",
+ ihdr.item, (long) val, (long) val,
+ ihdr.type == SLIT_INT32 ? "(int)" : "");
+ if (ihdr.item == SLI_NBIE)
+ ; // pn = (val & 7);
+ break;
+ case SLIT_INT32:
+ case SLIT_STRING:
+ for (i = 0; i < sizeof(buf) - 1; )
+ {
+ c = fgetc(fp);
+ if (c == EOF) break;
+ ++curOff;
+ buf[i++] = c;
+ --isize;
+ if (isize == 0 || c == 0) break;
+ }
+ buf[i] = 0;
+ if (codestr)
+ printf(" %s, '%s'", codestr, buf);
+ else
+ printf(" SLI_0x%x, '%s'", ihdr.item, buf);
+ break;
+ default:
+ case SLIT_BYTELUT:
+ fread(&val, len = sizeof(val), 1, fp);
+ curOff += len;
+ val = be32(val);
+ isize -= 4;
+ if (codestr)
+ printf(" %s, BYTELUT (len=%d)", codestr, val);
+ else
+ printf(" SLI_0x%x, BYTELUT (len=%d)", ihdr.item, val);
+ if (0) // ihdr.item == SLI_JBIG_BIH && val == 20)
+ {
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
+ if (bihlen <= 0)
+ isize = 0;
+ else
+ {
+ isize -= bihlen;
+ curOff += len;
+ }
+ if (bihlen == 20)
+ {
+ printf("\n");
+ print_bih(bih);
+ }
+ }
+ break;
+ }
+
+ if (ihdr.param != 0)
+ printf(" (reserved=0x%x)", ihdr.param);
+ printf("\n");
+ fflush(stdout);
+
+ while (isize-- > 0)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+
+ if (size <= 0 && items)
+ {
+ printf(" #items is wrong!\n");
+ break;
+ }
+ }
+
+ if (size)
+ {
+ if (PrintOffset)
+ printf(" %d:", curOff);
+ else if (PrintHexOffset)
+ printf(" %6x:", curOff);
+ printf(" Data: %d bytes\n", size);
+ fflush(stdout);
+ totSize += size;
+
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
+ if (bihlen <= 0)
+ size = 0;
+ else
+ {
+ size -= bihlen;
+ curOff += len;
+ }
+ if (bihlen == 20)
+ print_bih(bih);
+ }
+
+ if ( (RawFile || DecFile) &&
+ (hdr.type == SLT_JBIG_BIH || hdr.type == SLT_JBIG_BID
+ || hdr.type == SLT_2600N) )
+ {
+ if (hdr.type == SLT_JBIG_BIH)
+ {
+ if (RawFile)
+ {
+ char buf[512];
+ sprintf(buf, "%s-%02d-%d.jbg",
+ RawFile, pageNum, pn);
+ rfp = fopen(buf, "w");
+ }
+ if (rfp)
+ fwrite(bih, bihlen, 1, rfp);
+ if (DecFile)
+ {
+ size_t cnt;
+
+ // debug(1, "pn = %d\n", pn);
+ imageCnt[pn] = 0;
+ jbg_dec_init(&s[pn]);
+ rc = jbg_dec_in(&s[pn], bih, bihlen, &cnt);
+ if (rc == JBG_EIMPL)
+ error(1, "JBIG uses unimplemented feature\n");
+ }
+ }
+ while (size--)
+ {
+ int c;
+ c = fgetc(fp);
+ ++curOff;
+ if (rfp)
+ fputc(c, rfp);
+ if (DecFile)
+ {
+ size_t cnt;
+ unsigned char ch = c;
+
+ rc = JBG_EAGAIN;
+ rc = jbg_dec_in(&s[pn], &ch, 1, &cnt);
+ if (rc == JBG_EOK)
+ {
+ int h, w, len;
+ unsigned char *image;
+
+ // debug(1, "JBG_EOK: %d\n", pn);
+ h = jbg_dec_getheight(&s[pn]);
+ w = jbg_dec_getwidth(&s[pn]);
+ image = jbg_dec_getimage(&s[pn], 0);
+ len = jbg_dec_getsize(&s[pn]);
+ if (image)
+ {
+ char buf[512];
+ sprintf(buf, "%s-%02d-%d.pbm",
+ DecFile, pageNum, pn);
+ dfp = fopen(buf,
+ imageCnt[pn] ? "a" : "w");
+ if (dfp)
+ {
+ if (imageCnt[pn] == 0)
+ fprintf(dfp, "P4\n%8d %8d\n", w, h);
+ imageCnt[pn] += incrY;
+ fwrite(image, 1, len, dfp);
+ fclose(dfp);
+ }
+ }
+ else
+ debug(0, "Missing image %dx%d!\n", h, w);
+ jbg_dec_free(&s[pn]);
+ }
+ }
+ }
+ }
+ else
+ {
+ while (size--)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+ if (rfp)
+ {
+ fclose(rfp);
+ rfp = NULL;
+ }
+ }
+ }
+
+ while (padding--)
+ {
+ fgetc(fp);
+ ++curOff;
+ }
+
+ if (hdr.type == SLT_END_DOC)
+ break;
+ }
+ if (rfp)
+ fclose(rfp);
+ printf("Total size: %d bytes\n", totSize);
+}
+
+int
+main(int argc, char *argv[])
+{
+ extern int optind;
+ extern char *optarg;
+ int c;
+
+ while ( (c = getopt(argc, argv, "d:hor:D:?h")) != EOF)
+ switch (c)
+ {
+ case 'd': DecFile = optarg; break;
+ case 'r': RawFile = optarg; break;
+ case 'o': PrintOffset = 1; break;
+ case 'h': PrintHexOffset = 1; break;
+ case 'D': Debug = atoi(optarg); break;
+ default: usage(); exit(1);
+ }
+
+ argc -= optind;
+ argv += optind;
+
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
+
+ exit(0);
+}
diff --git a/usb_printerid.1in b/usb_printerid.1in
new file mode 100644
index 0000000..e812e57
--- /dev/null
+++ b/usb_printerid.1in
@@ -0,0 +1,50 @@
+.TH usb_printerid 1 "${MODpage}" "usb_printerid ${MODver}"
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
+'\"==========================================================================
+'\" MANUAL PAGE SOURCE
+'\"==========================================================================
+.SH NAME
+usb_printerid \- prints the ID of the printer on a USB port
+.SH SYNOPSIS
+.B usb_printerid
+.RI [ options "] /dev/usb/lpNNN"
+.SH DESCRIPTION
+.B usb_printerid
+prints the identification of the printer on a USB port using
+the ioctl control
+\fBLPIOC_GET_DEVICE_ID\fP.
+
+.SH EXAMPLES
+Print the USB info before and after downloading the firmware.
+
+.nf
+.ft CW
+# usb_printerid /dev/usb/lp0
+GET_DEVICE_ID string:
+MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS:PRINTER;\e
+DES:HP LaserJet 1020;
+
+# cp /usr/share/foo2zjs/firmware/sihp1020.dl /dev/usb/lp0
+
+# usb_printerid /dev/usb/lp0
+GET_DEVICE_ID string:
+MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS:PRINTER;\e
+DES:HP LaserJet 1020;FWVER:20050309;
+.ft P
+.fi
+
+.SH FILES
+.BR /usr/bin/usb_printerid,
+.BR /usr/share/foo2*/firmware/*
+.SH SEE ALSO
+.BR arm2hpdl (1)
+.SH "AUTHOR"
+Rick Richardson <rick.richardson@comcast.net>
+.br
+${URLZJS}/
+'/"
+'/"
+'/"
+.em pdf_outline
diff --git a/usb_printerid.c b/usb_printerid.c
index 7d111af..8207d67 100644
--- a/usb_printerid.c
+++ b/usb_printerid.c
@@ -48,7 +48,7 @@ main (int argc, char *argv[])
++argv;
if (argc != 1)
- error(1, "usage: usb_id_test /dev/usb/lp0\n");
+ error(1, "usage: usb_printerid /dev/usb/lp0\n");
fd = open(argv[0], O_RDWR);
if (fd < 0)
diff --git a/xqxdecode.1in b/xqxdecode.1in
index 0f3a73a..7ca51db 100644
--- a/xqxdecode.1in
+++ b/xqxdecode.1in
@@ -1,176 +1,7 @@
.TH xqxdecode 1 "${MODpage}" "xqxdecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (zjsdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
diff --git a/xqxdecode.c b/xqxdecode.c
index 2d306c1..cd8549c 100644
--- a/xqxdecode.c
+++ b/xqxdecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: xqxdecode.c,v 1.12 2006/12/07 13:33:50 rick Exp $
+ * $Id: xqxdecode.c,v 1.16 2008/09/05 15:05:55 rick Exp $
*/
/*b
@@ -152,7 +152,7 @@ decode(FILE *fp)
int i;
char *codestr;
FILE *dfp = NULL;
- int planeNum = 1;
+ int planeNum = 4;
int pageNum = 0;
int len;
int curOff = 0;
@@ -202,6 +202,17 @@ decode(FILE *fp)
curOff += 9;
break;
}
+ else if (strncmp(buf, "@PJL SET JOBATTR=", 17) == 0)
+ {
+ rc = fread(buf, 9, 1, fp);
+ if (rc != 1) return;
+ buf[9] = 0;
+ curOff += 9;
+ proff(curOff);
+ printf("\\033%s\n", buf+1);
+ curOff += 9;
+ break;
+ }
}
if (feof(fp))
return;
@@ -278,7 +289,7 @@ decode(FILE *fp)
int h, w, len;
unsigned char *image;
- // debug(0, "JBG_OK: %d\n", pn);
+ // debug(0, "JBG_EOK: %d\n", pn);
h = jbg_dec_getheight(&s[pn]);
w = jbg_dec_getwidth(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
@@ -287,7 +298,7 @@ decode(FILE *fp)
{
char buf[512];
sprintf(buf, "%s-%02d-%d.pbm",
- DecFile, pageNum, planeNum-1);
+ DecFile, pageNum, planeNum);
dfp = fopen(buf,
imageCnt[planeNum] ? "a" : "w");
if (dfp)
@@ -411,12 +422,31 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- for(;;)
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ for (;;)
+ {
+ decode(fp);
+ c = getc(fp); ungetc(c, fp);
+ if (feof(fp))
+ break;
+ }
+ fclose(fp);
+ }
+ else
{
- decode(stdin);
- c = getc(stdin); ungetc(c, stdin);
- if (feof(stdin))
- break;
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
}
printf("\n");
diff --git a/zjs.h b/zjs.h
index aeb889a..9c47592 100644
--- a/zjs.h
+++ b/zjs.h
@@ -112,6 +112,14 @@ typedef enum {
/*
* 0x8200-0x82FF : Item tags for the next OEM specific features.
*/
+ ZJI_HP_CDOTS = 0x8200, // Cyan Dots?
+ ZJI_HP_MDOTS = 0x8201, // Magenta Dots?
+ ZJI_HP_YDOTS = 0x8202, // Yellow Dots?
+ ZJI_HP_KDOTS = 0x8203, // Black Dots?
+ ZJI_HP_CWHITE = 0x8204, // Cyan White Dots?
+ ZJI_HP_MWHITE = 0x8205, // Magenta White Dots?
+ ZJI_HP_YWHITE = 0x8206, // Yellow White Dots?
+ ZJI_HP_KWHITE = 0x8207, // Black White Dots?
ZJI_LAST
} ZJ_ITEM;
diff --git a/zjsdecode.1in b/zjsdecode.1in
index 141ab5e..88fe65b 100644
--- a/zjsdecode.1in
+++ b/zjsdecode.1in
@@ -1,176 +1,7 @@
.TH zjsdecode 1 "${MODpage}" "zjsdecode ${MODver}"
-'\"==========================================================================
-'\" STRINGS and MACROS
-'\"==========================================================================
-'\"
-'\" Define strings for special characters that nroff doesn't have
-'\"
-'\" N.B. using .if cua to test for special characters did not work.
-'\"
-.if !'\*[.T]'ps' .ds ua up
-.if '\*[.T]'ps' .ds ua \(ua
-.if !'\*[.T]'ps' .ds da down
-.if '\*[.T]'ps' .ds da \(da
-.if !'\*[.T]'ps' .ds <- left
-.if '\*[.T]'ps' .ds <- \(<-
-.if !'\*[.T]'ps' .ds -> right
-.if '\*[.T]'ps' .ds -> \(->
-'\"
-'\" bx - box a Courier string for making keycaps
-'\"
-'\" N.B. this mess is to make the line drawing come out only
-'\" if we are really generating postscript
-'\"
-.de bx
-.ie !'\*[.T]'ps' \{\
-. RB [ \\$1 ]\\$2
-.\}
-.el \{\
-. ie !r ps4html \{\
-'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul'
-. ft CW
-. nr par*bxw \w'\\$1'+.4m
-\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\
-\Z'\h'.2m'\s-1\\$1\s+1'\
-\h'\\n[par*bxw]u'\\$2
-. ft P
-. \}
-. el \{\
-. RB [ \\$1 ]\\$2
-. \}
-.\}
-..
-'\"
-'\" strings to set current color (null with old groff)
-'\"
-.if mred .ds red \m[red]
-.if mgreen .ds green \m[green]
-.if mblue .ds blue \m[blue]
-.if mblack .ds black \m[black]
-.if mblack .ds mP \mP
-'\"
-'\" fix for grotty + xterm. We call for orange, grotty outputs yellow,
-'\" but xterm displays yellow as orange. The cycle is complete.
-'\"
-.if n .defcolor orange rgb #ffff00
-'\"
-'\" color <color> - set the current color (ignores request with old groff)
-'\"
-.de color
-.if mred \m[\\$1]\c
-..
-'\"
-'\" colorword <color> <word> - colorize a word (ignored by old groff)
-'\"
-.de colorword
-.ie m\\$1 \m[\\$1]\\$2\mP\c
-.el \\$2\c
-..
-'\"
-'\" colbox <fg> <bg> <word> - colorize a word in a filled box
-'\"
-.de colbox
-.ie mred \M[\\$2]\
-\v'+.167v'\
-\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\
-\v'-.167v'\
-\m[\\$1]\\$3\mP\MP
-.el \\$3\c
-..
-'\"
-'\" Macros for doing pdfmarks
-'\"
-.de specialps
-\\k_\X'ps: \\$*'\h'|\\n_u'\c
-..
-'\"
-'\" pdfmark PDFMARKCODE
-'\"
-.ds pdfmarks
-.if d pdfmarks \{\
-.de pdfmark
-. specialps exec [\\$1 pdfmark
-..
-'\"
-'\" pdfdest LINKNAME
-'\"
-.de pdfdest
-.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST"
-..
-'\"
-'\" pdfbookmark COUNT LINKNAME STRING
-'\"
-.de pdfbookmark
-. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT"
-..
-'\"
-'\" Define the SH and SS macros to save pdfmark information
-'\" in "arrays" of numbers and strings.
-'\"
-.if !r rr_n \{\
-.nr rr_n 0 1
-.am SH
-. nr rr_levels!\\n+[rr_n] 2
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.am SS
-. nr rr_levels!\\n+[rr_n] 3
-. ds rr_labels!\\n[rr_n] \\$*
-. pdfdest Link\\n[rr_n]
-..
-.\}
-'\"
-'\" Called at the end of the document to generate the pdfmark outline
-'\"
-.de pdf_outline
-.nr rr_levels!\\n+[rr_n] 1
-.nr rr_i 0 1
-.while \\n+[rr_i]<\\n[rr_n] \{\
-. nr rr_ip1 \\n[rr_i]+1
-. nr rr_count 0
-. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\
-. nr rr_j \\n[rr_i] 1
-. while \\n+[rr_j]<\\n[rr_n] \{\
-. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\
-. break
-. \}
-. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\
-. nr rr_count \\n[rr_count]+1
-. \}
-. \}
-. \}
-. ds hhh \\*[rr_labels!\\n[rr_i]]
-. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]"
-.\}
-..
-'\"
-'\" Some postscript to make pdfmarks harmless on old interpreters...
-'\"
-.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse"
-'\"
-'\" Force display of Bookmarks in Acrobat when document is viewed.
-'\"
-.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW"
-'\"
-'\" Output the document info in pdfmarks
-'\"
-.pdfmark "\
- /Title (\*[an-title](\*[an-section])) \
- /Subject (zjsdecode Manual Page) \
- /Author (Rick Richardson) \
- /Keywords (printing, ZjStream) \
- /Creator (groff \n(.x.\n(.y.\n(.Y -man) \
- /CreationDate (\*[an-extra1]) \
- /ModDate (\*[an-extra1]) \
- /DOCINFO"
-\}
-'\"
-'\" The manual page name is only 1st level mark
-'\"
-.nr rr_levels!\n+[rr_n] 1
-.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section])
-.pdfdest Link\n[rr_n]
+#ifndef OLDGROFF
+#include "macros.man"
+#endif
'\"==========================================================================
'\" MANUAL PAGE SOURCE
'\"==========================================================================
@@ -207,6 +38,9 @@ Print hex file offsets.
.BI \-o
Print file offsets.
.TP
+.BI \-p
+Don't do 4 byte padding
+.TP
.BI \-D\0 level
Set Debug level [0].
diff --git a/zjsdecode.c b/zjsdecode.c
index 772eb4c..d2b0383 100644
--- a/zjsdecode.c
+++ b/zjsdecode.c
@@ -1,5 +1,5 @@
/*
- * $Id: zjsdecode.c,v 1.54 2007/05/08 00:23:49 rick Exp $
+ * $Id: zjsdecode.c,v 1.63 2009/01/22 16:43:17 rick Exp $
*/
/*b
@@ -40,6 +40,7 @@ char *RawFile;
char *DecFile;
int PrintOffset = 0;
int PrintHexOffset = 0;
+int DoPad = 1;
void
debug(int level, char *fmt, ...)
@@ -93,8 +94,9 @@ usage(void)
"Options:\n"
" -d basename Basename of .pbm file for saving decompressed planes\n"
" -r basename Basename of .jbg file for saving raw planes\n"
-" -o Print file offsets\n"
" -h Print hex file offsets\n"
+" -o Print file offsets\n"
+" -p Don't do 4 byte padding\n"
" -D lvl Set Debug level [%d]\n"
, Debug
);
@@ -183,7 +185,13 @@ decode(FILE *fp)
printf("%d: ", curOff);
else if (PrintHexOffset)
printf("%6x: ", curOff);
- fputs(buf, stdout);
+ if (buf[0] == '\033')
+ {
+ printf("\\033");
+ fputs(buf+1, stdout);
+ }
+ else
+ fputs(buf, stdout);
curOff += strlen(buf);
if (strcmp(buf, "@PJL ENTER LANGUAGE = ZJS\r\n") == 0)
break;
@@ -194,7 +202,10 @@ decode(FILE *fp)
}
}
if (feof(fp))
+ {
+ printf("\n");
return;
+ }
}
/*
@@ -268,7 +279,9 @@ decode(FILE *fp)
printf("%s, %ld items", codestr, (long) hdr.items);
else
printf("ZJT_0x%lx, %ld items", (long) hdr.type, (long) hdr.items);
- if (hdr.size & 3)
+ if (DoPad == 0)
+ padding = 0;
+ else if (hdr.size & 3)
{
printf(" (unaligned size)");
padding = 4 - (hdr.size & 3);
@@ -378,6 +391,14 @@ decode(FILE *fp)
CODESTR(ZJI_INCRY) break;
CODESTR(ZJI_JBIG_BIH) break;
CODESTR(ZJI_ECONOMODE) break;
+ CODESTR(ZJI_HP_CDOTS) break;
+ CODESTR(ZJI_HP_MDOTS) break;
+ CODESTR(ZJI_HP_YDOTS) break;
+ CODESTR(ZJI_HP_KDOTS) break;
+ CODESTR(ZJI_HP_CWHITE) break;
+ CODESTR(ZJI_HP_MWHITE) break;
+ CODESTR(ZJI_HP_YWHITE) break;
+ CODESTR(ZJI_HP_KWHITE) break;
// Zenographics ZJ format
CODESTR(ZJI_ZX_0x6c) break;
@@ -450,7 +471,7 @@ decode(FILE *fp)
printf(" ZJI_0x%x, BYTELUT (len=%d)", ihdr.item, val);
if (ihdr.item == ZJI_JBIG_BIH && val == 20)
{
- bihlen = fread(bih, 1, len = sizeof(bih), stdin);
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
if (bihlen <= 0)
isize = 0;
else
@@ -497,7 +518,7 @@ decode(FILE *fp)
if (hdr.type == ZJT_JBIG_BIH)
{
- bihlen = fread(bih, 1, len = sizeof(bih), stdin);
+ bihlen = fread(bih, 1, len = sizeof(bih), fp);
if (bihlen <= 0)
size = 0;
else
@@ -563,7 +584,7 @@ decode(FILE *fp)
int h, w, len;
unsigned char *image;
- // debug(0, "JBG_OK: %d\n", pn);
+ // debug(0, "JBG_EOK: %d\n", pn);
h = jbg_dec_getheight(&s[pn]);
w = jbg_dec_getwidth(&s[pn]);
image = jbg_dec_getimage(&s[pn], 0);
@@ -574,12 +595,12 @@ decode(FILE *fp)
sprintf(buf, "%s-%02d-%d.pbm",
DecFile, pageNum, planeNum-1);
dfp = fopen(buf,
- imageCnt[planeNum] ? "a" : "w");
+ imageCnt[planeNum-1] ? "a" : "w");
if (dfp)
{
- if (imageCnt[planeNum] == 0)
+ if (imageCnt[planeNum-1] == 0)
fprintf(dfp, "P4\n%8d %8d\n", w, h);
- imageCnt[planeNum] += incrY;
+ imageCnt[planeNum-1] += incrY;
fwrite(image, 1, len, dfp);
fclose(dfp);
}
@@ -597,7 +618,7 @@ decode(FILE *fp)
DecFile, pageNum, planeNum-1);
dfp = fopen(buf, "r+");
fseek(dfp, 12, 0);
- fprintf(dfp, "%8d\n", imageCnt[planeNum]);
+ fprintf(dfp, "%8d\n", imageCnt[planeNum-1]);
fclose(dfp);
}
}
@@ -637,13 +658,14 @@ main(int argc, char *argv[])
extern char *optarg;
int c;
- while ( (c = getopt(argc, argv, "d:hor:D:?h")) != EOF)
+ while ( (c = getopt(argc, argv, "d:hopr:D:?h")) != EOF)
switch (c)
{
case 'd': DecFile = optarg; break;
case 'r': RawFile = optarg; break;
- case 'o': PrintOffset = 1; break;
case 'h': PrintHexOffset = 1; break;
+ case 'o': PrintOffset = 1; break;
+ case 'p': DoPad = 0; break;
case 'D': Debug = atoi(optarg); break;
default: usage(); exit(1);
}
@@ -651,12 +673,31 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- for(;;)
- {
- decode(stdin);
- c = getc(stdin); ungetc(c, stdin);
- if (feof(stdin))
- break;
+ if (argc > 0)
+ {
+ FILE *fp;
+
+ fp = fopen(argv[0], "r");
+ if (!fp)
+ error(1, "file '%s' doesn't exist\n", argv[0]);
+ for (;;)
+ {
+ decode(fp);
+ c = getc(fp); ungetc(c, fp);
+ if (feof(fp))
+ break;
+ }
+ fclose(fp);
+ }
+ else
+ {
+ for(;;)
+ {
+ decode(stdin);
+ c = getc(stdin); ungetc(c, stdin);
+ if (feof(stdin))
+ break;
+ }
}
exit(0);