
[AtStart]
SetVar paper 1   // /PAPER A4
SetDpi 200       // /DPI 200
SetVar dpi 200
SetVar pxtypes 4 // /RGB

[AtEnd]
if %paper >= 0 then SetCap 4386 1 %paper
SetColor %pxtypes // must only be set once 


# some shortcuts

[A4]
SetVar paper 1 // (cap,type,value) ICAP_SUPPORTEDSIZES,TWTY_INT16,TWSS_A4LETTER

[LETTER]
SetVar paper 3

[LEGAL]
SetVar paper 4

[A3]
SetVar paper 11

[200]
SetUnits 0 // TWUN_INCHES, WARNING: dpi sets unit to inches
SetDpi 200 // ((float)dpi);
SetVar dpi 200

[300]
SetUnits 0 // TWUN_INCHES, WARNING: dpi sets unit to inches
SetDpi 300 // ((float)dpi);
SetVar dpi 300

[COLOR]
SetVar pxtypes 4 // SetColor 4


# the usual parameters

[DPI]
args 1
SetUnits 0 // TWUN_INCHES, WARNING: dpi sets unit to inches
SetDpi %1  // ((float)dpi);
SetVar dpi %1

[PAPER]
args 1
if %1 == A4     then SetVar paper  1
if %1 == LETTER then SetVar paper  3
if %1 == LEGAL  then SetVar paper  4
if %1 == A3     then SetVar paper 11
if %1 == A5     then SetVar paper  5
if %1 == A6     then SetVar paper 13
if %1 == B3     then SetVar paper 12
if %1 == B4     then SetVar paper  6
if %1 == B5     then SetVar paper  2
if %1 == B6     then SetVar paper  7
if %1 == C4     then SetVar paper 14
if %1 == C5     then SetVar paper 15
if %1 == C6     then SetVar paper 16

# can only set color once so remember the last choice in a variable

[RGB]
SetVar pxtypes 4 // TWPT_RGB

[GRAY]
SetVar pxtypes 2 //TWPT_GRAY

[BW]
SetVar pxtypes 1 //TWPT_BW

[IN]
SetUnits 0 // TWUN_INCHES

[CM]
SetUnits 1 // TWUN_CENTIMETERS

[PX]
SetUnits 5 // TWUN_PIXELS

[TW]
SetUnits 4 // TWUN_TWIPS

[WH]
args 2
SetWH %1 %2     // (double w, double h)
SetVar paper -1 // don't set paper size after this

[XYWH]
args 4
SetXYWH %1 %2 %3 %4 // (double x, double y, double w, double h)
SetVar paper -1     // don't set paper size after this


# Brightness & Contrast. Range -1000..1000, 0 is normal

[BR]
args 1
SetCap 4353 7 %1

[CO]
args 1
SetCap 4355 7 %1

# Doc Feeder, Duplex, Autofeed, Autoscan. Use 1 for on, 0 for off

[ADF]
args 1
SetCap 4098 6 %1

[DPX]
args 1
SetCap 4115 6 %1

[AF]
args 1
SetCap 4103 6 %1

[AS]
args 1
SetCap 4112 6 %1

# Others

[GAMMA]
args 1
SetCap 4360 7 %1

[AUTOBR]
args 1
SetCap 4352 6 %1

[BPP]
args 1
SetCap 4395 4 %1

[FILM]
args 1
SetCap 4382 4 %1

[NEG]
args 1
SetCap 4447 4 %1

