Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,7 @@ zjsdecode.o: jbig.h zjs.h
#
# foo2* Regression tests
#
test: testzjs testhp
test: testzjs testhp testddst
@ls -l *.z* #*.oak
#
# All regression tests passed.
Expand Down Expand Up @@ -1360,6 +1360,20 @@ lj2600.zc1: testpage.ps foo2hp2600-wrapper foo2hp Makefile FRC
@got=`md5sum $@`; grep -q "$$got" regress.txt || \
{ echo "*** Test failure, got $$got"; ls -l $@; exit 1; }

#
# foo2ddst Regression tests
#
testddst: testpage.ps foo2ddst-wrapper foo2ddst foo2zjs-pstops FRC
@set -e; nohold=`mktemp`; hold=`mktemp`; \
trap 'rm -f "$$nohold" "$$hold"' EXIT HUP INT TERM; \
PATH=.:$$PATH foo2ddst-wrapper testpage.ps > "$$nohold"; \
PATH=.:$$PATH foo2ddst-wrapper -H testpage.ps > "$$hold"; \
if grep -a -q '@PJL SET HOLD=OFF' "$$nohold"; then \
echo "*** Test failure, HOLD=OFF present without -H"; exit 1; \
fi; \
grep -a -q '@PJL SET HOLD=OFF' "$$hold" || \
{ echo "*** Test failure, HOLD=OFF missing with -H"; exit 1; }

#
# foo2oak Regression tests
#
Expand Down
11 changes: 8 additions & 3 deletions PPD/Ricoh-SP_112.ppd
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*LanguageEncoding: ISOLatin1
*PCFileName: "FOO2DDST.PPD"
*Manufacturer: "Ricoh"
*Product: "(SP 112)"
*Product: "(SP 112 DDST)"
*cupsVersion: 1.0
*cupsManualCopies: True
*cupsModelNumber: 2
Expand Down Expand Up @@ -61,7 +61,7 @@
*Throughput: "1"
*LandscapeOrientation: Plus90
*TTRasterizer: Type42
*1284DeviceID: "MFG:Ricoh;MDL:SP 112;DRV:Dfoo2ddst,R1,M0,TF;"
*1284DeviceID: "MFG:RICOH ;MDL:SP 112 DDST;CMD:GDI;DRV:Dfoo2ddst,R1,M0,TF;"

*driverName foo2ddst: ""
*driverType F/Filter: ""
Expand Down Expand Up @@ -89,6 +89,9 @@
*FoomaticIDs: Ricoh-SP_112 foo2ddst
*FoomaticRIPCommandLine: "foo2ddst-wrapper %A"

*FoomaticRIPOption PrinterType: enum CmdLine A 110
*FoomaticRIPOptionSetting PrinterType=Ricoh: "-H "

*OpenGroup: General/General

*OpenUI *Resolution/Resolution: PickOne
Expand Down Expand Up @@ -174,9 +177,11 @@
*OpenUI *InputSlot/Media Source: PickOne
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Tray1
*DefaultInputSlot: Auto
*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
*InputSlot Auto/Auto selection: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s3 "
*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
*CloseUI: *InputSlot
Expand Down
7 changes: 6 additions & 1 deletion PPD/Ricoh-SP_201Nw.ppd
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
*FoomaticIDs: Ricoh-SP_201Nw foo2ddst
*FoomaticRIPCommandLine: "foo2ddst-wrapper %A"

*FoomaticRIPOption PrinterType: enum CmdLine A 110
*FoomaticRIPOptionSetting PrinterType=Ricoh: "-H "

*OpenGroup: General/General

*OpenUI *Resolution/Resolution: PickOne
Expand Down Expand Up @@ -174,9 +177,11 @@
*OpenUI *InputSlot/Media Source: PickOne
*FoomaticRIPOption InputSlot: enum CmdLine A
*OrderDependency: 150 AnySetup *InputSlot
*DefaultInputSlot: Tray1
*DefaultInputSlot: Auto
*InputSlot Tray1/Tray 1: "%% FoomaticRIPOptionSetting: InputSlot=Tray1"
*FoomaticRIPOptionSetting InputSlot=Tray1: "-s1 "
*InputSlot Auto/Auto selection: "%% FoomaticRIPOptionSetting: InputSlot=Auto"
*FoomaticRIPOptionSetting InputSlot=Auto: "-s3 "
*InputSlot Manual/Manual Feed: "%% FoomaticRIPOptionSetting: InputSlot=Manual"
*FoomaticRIPOptionSetting InputSlot=Manual: "-s2 "
*CloseUI: *InputSlot
Expand Down
4 changes: 4 additions & 0 deletions foo2ddst-wrapper.1in
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ Seascape -os (rotated 90 degrees clockwise)
These are the options used to customize the operation of \fBfoo2ddst\fP
for a particular printer.
.TP
.BI \-H
Send a PJL command disabling job holding. This is required by some Ricoh
printers.
.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].
Expand Down
9 changes: 6 additions & 3 deletions foo2ddst-wrapper.in
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ Normal Options:
-o orient For N-up: -op is portrait, -ol is landscape, -os is seascape.

Printer Tweaking Options:
-H Send PJL HOLD=OFF. Required by some Ricoh printers.
-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]
Expand Down Expand Up @@ -179,6 +180,7 @@ GAMMAFILE=
INTENT=0
GSOPTS=
EXTRAPAD=
HOLD=
SAVETONER=
DENSITY=3 #Medium
NUP_ORIENT=
Expand All @@ -189,7 +191,7 @@ case `$GSBIN --version` in
QUALITY=1
;;
esac
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tT:ABS:D:G:I:PX:Vh?" opt
while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tT:ABHS:D:G:I:PX:Vh?" opt
do
case $opt in
b) GSBIN="$OPTARG";;
Expand All @@ -209,6 +211,7 @@ do
L) CLIP_LOG="-L $OPTARG";;
A) AIB=-A;;
B) BC=-B;;
H) HOLD=-H;;
C) COLORMODE="$OPTARG";;
S) COLOR2MONO="-S$OPTARG";;
D) DEBUG="$OPTARG";;
Expand Down Expand Up @@ -662,7 +665,7 @@ $PREFILTER \
| foo2ddst -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \
$COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER -T$DENSITY \
-J "$LPJOB" -U "$USER" \
$BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG
$BC $AIB $HOLD $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG

#
# Log the command line, for debugging and problem reports
Expand All @@ -673,7 +676,7 @@ if [ -x /usr/bin/logger ]; then
logger -t "$BASENAME" -p lpr.info -- \
"foo2ddst -r$RES -g$DIM -p$PAPER -m$MEDIA \
-n$COPIES -d$DUPLEX -s$SOURCE $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
$SAVETONER -T$DENSITY $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"
$SAVETONER -T$DENSITY $BC $AIB $HOLD $COLOR2MONO $NOPLANES $EXTRAPAD"
fi

#
Expand Down
4 changes: 4 additions & 0 deletions foo2ddst.1in
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ 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 \-H
Send a PJL command disabling job holding. This is required by some Ricoh
printers.
.SS Debugging Options
These options are used for debugging \fBfoo2ddst\fP.
.TP
Expand Down
7 changes: 6 additions & 1 deletion foo2ddst.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ int PageNum = 0;
int RealWidth;
int EconoMode = 0;
int PrintDensity = 3;
int PjlHoldOff = 0;

int IsCUPS = 0;

Expand Down Expand Up @@ -187,6 +188,7 @@ usage(void)
"-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"
"-H Send PJL HOLD=OFF. Required by some Ricoh printers.\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"
Expand Down Expand Up @@ -691,6 +693,8 @@ start_doc(FILE *fp)
fprintf(fp, "@PJL SET COMPRESS=JBIG\r\n");
fprintf(fp, "@PJL SET USERNAME=%s\r\n", Username ? Username : "root");
fprintf(fp, "@PJL SET COVER=OFF\r\n");
if (PjlHoldOff)
fprintf(fp, "@PJL SET HOLD=OFF\r\n");

#if 0
fwrite(header, 1, sizeof(header), fp);
Expand Down Expand Up @@ -1422,7 +1426,7 @@ main(int argc, char *argv[])
int i, j;

while ( (c = getopt(argc, argv,
"cd:g:n:m:p:r:s:tT:u:l:L:ABPJ:S:U:X:D:V?h")) != EOF)
"cd:g:n:m:p:r:s:tT:u:l:L:ABHPJ:S:U:X:D:V?h")) != EOF)
switch (c)
{
case 'c': Mode = MODE_COLOR; break;
Expand Down Expand Up @@ -1473,6 +1477,7 @@ main(int argc, char *argv[])
break;
case 'A': AllIsBlack = !AllIsBlack; break;
case 'B': BlackClears = !BlackClears; break;
case 'H': PjlHoldOff = 1; break;
case 'P': OutputStartPlane = !OutputStartPlane; break;
case 'J': if (optarg[0]) Filename = optarg; break;
case 'U': if (optarg[0]) Username = optarg; break;
Expand Down
51 changes: 51 additions & 0 deletions foomatic-db/opt/foo2ddst-PrinterType.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<option type="enum" id="opt/foo2ddst-PrinterType">
<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="false">
<driver>foo2ddst</driver>
</constraint>
<constraint sense="true">
<make>Ricoh</make>
<model>SP 112</model>
<driver>foo2ddst</driver>
<arg_defval>ev/foo2ddst-PrinterType-Ricoh</arg_defval>
</constraint>
<constraint sense="true">
<make>Ricoh</make>
<model>SP 201Nw</model>
<driver>foo2ddst</driver>
<arg_defval>ev/foo2ddst-PrinterType-Ricoh</arg_defval>
</constraint>
</constraints>
<enum_vals>
<enum_val id="ev/foo2ddst-PrinterType-Ricoh">
<ev_longname> <en>Ricoh DDST printer</en> </ev_longname>
<ev_shortname> <en>Ricoh</en> </ev_shortname>
<ev_driverval>-H</ev_driverval>
<constraints>
<constraint sense="false">
<driver>foo2ddst</driver>
</constraint>
<constraint sense="true">
<driver>foo2ddst</driver>
<make>Ricoh</make>
<model>SP 112</model>
</constraint>
<constraint sense="true">
<driver>foo2ddst</driver>
<make>Ricoh</make>
<model>SP 201Nw</model>
</constraint>
</constraints>
</enum_val>
</enum_vals>
</option>
9 changes: 9 additions & 0 deletions foomatic-db/printer/Ricoh-SP_112.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@
</parallel>
</autodetect>
-->
<autodetect>
<usb>
<ieee1284>MFG:RICOH ;CMD:GDI;MDL:SP 112 DDST;CLS:PRINTER;</ieee1284>
<manufacturer>RICOH</manufacturer>
<model>SP 112 DDST</model>
<commandset>GDI</commandset>
<description>Ricoh SP 112 DDST</description>
</usb>
</autodetect>
<functionality>B</functionality>
<driver>foo2ddst</driver>
<!--no "contrib_url"-->
Expand Down