Date: Fri, 17 Oct 2008 22:12:14 +0000
Subject: [PATCH] Merge changes from CUPS 1.4svn-r8067 (tentative CUPS 1.4b1)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@1021 a1ca3aef-8c08-0410-bb20-df032aa958be
---
CHANGES-1.3.txt | 7 +
Makefile | 2 +-
backend/usb-darwin.c | 2 +-
cups/conflicts.c | 316 +++++-----
data/utf-8 | 22 +-
doc/Makefile | 11 +-
doc/cups-printable.css | 96 ++-
doc/cups.css | 9 +-
doc/help/postscript-driver.html | 255 ++++++++
doc/help/ppd-compiler.html | 839 +++++++++++++++++++++++++++
doc/help/ref-ppdcfile.html | 2 +-
doc/images/cups-command-chain.png | Bin 0 -> 14902 bytes
doc/images/cups-command-chain.svg | 439 ++++++++++++++
doc/images/cups-postscript-chain.png | Bin 0 -> 17498 bytes
doc/images/cups-postscript-chain.svg | 531 +++++++++++++++++
doc/images/cups-raster-chain.png | Bin 0 -> 16916 bytes
doc/images/cups-raster-chain.svg | 534 +++++++++++++++++
examples/Makefile | 128 ++++
examples/color.drv | 44 ++
examples/constraint.drv | 48 ++
examples/custom.drv | 41 ++
examples/grouping.drv | 36 ++
examples/laserjet-basic.drv | 88 +++
examples/laserjet-pjl.drv | 101 ++++
examples/minimum.drv | 26 +
examples/postscript.drv | 46 ++
examples/r300-basic.drv | 75 +++
examples/r300-colorman.drv | 85 +++
examples/r300-remote.drv | 85 +++
filter/bannertops.c | 2 +-
filter/image-png.c | 4 +-
filter/pstext.c | 3 +
man/drv.man.in | 2 +-
packaging/cups.list.in | 9 +-
34 files changed, 3690 insertions(+), 198 deletions(-)
create mode 100644 doc/help/postscript-driver.html
create mode 100644 doc/help/ppd-compiler.html
create mode 100644 doc/images/cups-command-chain.png
create mode 100644 doc/images/cups-command-chain.svg
create mode 100644 doc/images/cups-postscript-chain.png
create mode 100644 doc/images/cups-postscript-chain.svg
create mode 100644 doc/images/cups-raster-chain.png
create mode 100644 doc/images/cups-raster-chain.svg
create mode 100644 examples/Makefile
create mode 100644 examples/color.drv
create mode 100644 examples/constraint.drv
create mode 100644 examples/custom.drv
create mode 100644 examples/grouping.drv
create mode 100644 examples/laserjet-basic.drv
create mode 100644 examples/laserjet-pjl.drv
create mode 100644 examples/minimum.drv
create mode 100644 examples/postscript.drv
create mode 100644 examples/r300-basic.drv
create mode 100644 examples/r300-colorman.drv
create mode 100644 examples/r300-remote.drv
diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt
index 173fbfe2a..c97869573 100644
--- a/CHANGES-1.3.txt
+++ b/CHANGES-1.3.txt
@@ -1,6 +1,13 @@
CHANGES-1.3.txt
---------------
+CHANGES IN CUPS V1.3.10
+
+ - SECURITY: The PNG image reading code did not validate the
+ image size properly, leading to a potential buffer overflow
+ (STR #2974)
+
+
CHANGES IN CUPS V1.3.9
- SECURITY: The HP-GL/2 filter did not range check pen numbers
diff --git a/Makefile b/Makefile
index cd19f8358..44beff0a3 100644
--- a/Makefile
+++ b/Makefile
@@ -30,7 +30,7 @@ include Makedefs
DIRS = cups filter backend berkeley cgi-bin driver locale man monitor \
notifier ppdc scheduler systemv test \
$(PHPDIR) \
- conf data doc $(FONTS) templates
+ conf data doc examples $(FONTS) templates
#
diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c
index 3f12405f8..f25fbe017 100644
--- a/backend/usb-darwin.c
+++ b/backend/usb-darwin.c
@@ -1712,7 +1712,7 @@ static void setup_cfLanguage(void)
lang[0] = CFStringCreateWithCString(kCFAllocatorDefault, requestedLang, kCFStringEncodingUTF8);
langArray = CFArrayCreate(kCFAllocatorDefault, (const void **)lang, sizeof(lang) / sizeof(lang[0]), &kCFTypeArrayCallBacks);
- CFPreferencesSetAppValue(CFSTR("AppleLanguages"), langArray, kCFPreferencesCurrentApplication);
+ CFPreferencesSetValue(CFSTR("AppleLanguages"), langArray, kCFPreferencesCurrentApplication, kCFPreferencesAnyUser, kCFPreferencesAnyHost);
fprintf(stderr, "DEBUG: usb: AppleLanguages=\"%s\"\n", requestedLang);
CFRelease(lang[0]);
diff --git a/cups/conflicts.c b/cups/conflicts.c
index aab26d1e7..b05ecd57d 100644
--- a/cups/conflicts.c
+++ b/cups/conflicts.c
@@ -544,213 +544,205 @@ ppd_load_constraints(ppd_file_t *ppd) /* I - PPD file */
installable = NULL;
/*
- * See what kind of constraint data we have in the PPD...
+ * Load old-style [Non]UIConstraints data...
*/
- if ((constattr = ppdFindAttr(ppd, "cupsUIConstraints", NULL)) != NULL)
+ for (i = ppd->num_consts, oldconst = ppd->consts; i > 0; i --, oldconst ++)
{
/*
- * Load new-style cupsUIConstraints data...
+ * Weed out nearby duplicates, since the PPD spec requires that you
+ * define both "*Foo foo *Bar bar" and "*Bar bar *Foo foo"...
*/
- for (; constattr;
- constattr = ppdFindNextAttr(ppd, "cupsUIConstraints", NULL))
- {
- if (!constattr->value)
- {
- DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
- continue;
- }
+ if (i > 1 &&
+ !strcasecmp(oldconst[0].option1, oldconst[1].option2) &&
+ !strcasecmp(oldconst[0].choice1, oldconst[1].choice2) &&
+ !strcasecmp(oldconst[0].option2, oldconst[1].option1) &&
+ !strcasecmp(oldconst[0].choice2, oldconst[1].choice1))
+ continue;
- for (i = 0, vptr = strchr(constattr->value, '*');
- vptr;
- i ++, vptr = strchr(vptr + 1, '*'));
+ /*
+ * Allocate memory...
+ */
- if (i == 0)
- {
- DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
- continue;
- }
+ if ((consts = calloc(1, sizeof(_ppd_cups_uiconsts_t))) == NULL)
+ {
+ DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
+ "UIConstraints!");
+ return;
+ }
- if ((consts = calloc(1, sizeof(_ppd_cups_uiconsts_t))) == NULL)
- {
- DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
- "cupsUIConstraints!");
- return;
- }
+ if ((constptr = calloc(2, sizeof(_ppd_cups_uiconst_t))) == NULL)
+ {
+ free(consts);
+ DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
+ "UIConstraints!");
+ return;
+ }
- if ((constptr = calloc(i, sizeof(_ppd_cups_uiconst_t))) == NULL)
- {
- free(consts);
- DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
- "cupsUIConstraints!");
- return;
- }
+ /*
+ * Fill in the information...
+ */
- consts->num_constraints = i;
- consts->constraints = constptr;
+ consts->num_constraints = 2;
+ consts->constraints = constptr;
- strlcpy(consts->resolver, constattr->spec, sizeof(consts->resolver));
+ if (!strncasecmp(oldconst->option1, "Custom", 6) &&
+ !strcasecmp(oldconst->choice1, "True"))
+ {
+ constptr[0].option = ppdFindOption(ppd, oldconst->option1 + 6);
+ constptr[0].choice = ppdFindChoice(constptr[0].option, "Custom");
+ constptr[0].installable = 0;
+ }
+ else
+ {
+ constptr[0].option = ppdFindOption(ppd, oldconst->option1);
+ constptr[0].choice = ppdFindChoice(constptr[0].option,
+ oldconst->choice1);
+ constptr[0].installable = ppd_is_installable(installable,
+ oldconst->option1);
+ }
- for (i = 0, vptr = strchr(constattr->value, '*');
- vptr;
- i ++, vptr = strchr(vptr, '*'), constptr ++)
- {
- /*
- * Extract "*Option Choice" or just "*Option"...
- */
+ if (!constptr[0].option || (!constptr[0].choice && oldconst->choice1[0]))
+ {
+ DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
+ oldconst->option1, oldconst->choice1));
+ free(consts->constraints);
+ free(consts);
+ continue;
+ }
- for (vptr ++, ptr = option; *vptr && !isspace(*vptr & 255); vptr ++)
- if (ptr < (option + sizeof(option) - 1))
- *ptr++ = *vptr;
+ if (!strncasecmp(oldconst->option2, "Custom", 6) &&
+ !strcasecmp(oldconst->choice2, "True"))
+ {
+ constptr[1].option = ppdFindOption(ppd, oldconst->option2 + 6);
+ constptr[1].choice = ppdFindChoice(constptr[1].option, "Custom");
+ constptr[1].installable = 0;
+ }
+ else
+ {
+ constptr[1].option = ppdFindOption(ppd, oldconst->option2);
+ constptr[1].choice = ppdFindChoice(constptr[1].option,
+ oldconst->choice2);
+ constptr[1].installable = ppd_is_installable(installable,
+ oldconst->option2);
+ }
- *ptr = '\0';
+ if (!constptr[1].option || (!constptr[1].choice && oldconst->choice2[0]))
+ {
+ DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
+ oldconst->option2, oldconst->choice2));
+ free(consts->constraints);
+ free(consts);
+ continue;
+ }
- while (isspace(*vptr & 255))
- vptr ++;
+ consts->installable = constptr[0].installable || constptr[1].installable;
- if (*vptr == '*')
- choice[0] = '\0';
- else
- {
- for (ptr = choice; *vptr && !isspace(*vptr & 255); vptr ++)
- if (ptr < (choice + sizeof(choice) - 1))
- *ptr++ = *vptr;
+ /*
+ * Add it to the constraints array...
+ */
- *ptr = '\0';
- }
+ cupsArrayAdd(ppd->cups_uiconstraints, consts);
+ }
- if (!strncasecmp(option, "Custom", 6) && !strcasecmp(choice, "True"))
- {
- _cups_strcpy(option, option + 6);
- strcpy(choice, "Custom");
- }
+ /*
+ * Then load new-style constraints...
+ */
- constptr->option = ppdFindOption(ppd, option);
- constptr->choice = ppdFindChoice(constptr->option, choice);
- constptr->installable = ppd_is_installable(installable, option);
- consts->installable |= constptr->installable;
+ for (constattr = ppdFindAttr(ppd, "cupsUIConstraints", NULL);
+ constattr;
+ constattr = ppdFindNextAttr(ppd, "cupsUIConstraints", NULL))
+ {
+ if (!constattr->value)
+ {
+ DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
+ continue;
+ }
- if (!constptr->option || (!constptr->choice && choice[0]))
- {
- DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
- option, choice));
- break;
- }
- }
+ for (i = 0, vptr = strchr(constattr->value, '*');
+ vptr;
+ i ++, vptr = strchr(vptr + 1, '*'));
- if (!vptr)
- cupsArrayAdd(ppd->cups_uiconstraints, consts);
- else
- {
- free(consts->constraints);
- free(consts);
- }
+ if (i == 0)
+ {
+ DEBUG_puts("ppd_load_constraints: Bad cupsUIConstraints value!");
+ continue;
}
- }
- else
- {
- /*
- * Load old-style [Non]UIConstraints data...
- */
- for (i = ppd->num_consts, oldconst = ppd->consts; i > 0; i --, oldconst ++)
+ if ((consts = calloc(1, sizeof(_ppd_cups_uiconsts_t))) == NULL)
{
- /*
- * Weed out nearby duplicates, since the PPD spec requires that you
- * define both "*Foo foo *Bar bar" and "*Bar bar *Foo foo"...
- */
-
- if (i > 1 &&
- !strcasecmp(oldconst[0].option1, oldconst[1].option2) &&
- !strcasecmp(oldconst[0].choice1, oldconst[1].choice2) &&
- !strcasecmp(oldconst[0].option2, oldconst[1].option1) &&
- !strcasecmp(oldconst[0].choice2, oldconst[1].choice1))
- continue;
+ DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
+ "cupsUIConstraints!");
+ return;
+ }
- /*
- * Allocate memory...
- */
+ if ((constptr = calloc(i, sizeof(_ppd_cups_uiconst_t))) == NULL)
+ {
+ free(consts);
+ DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
+ "cupsUIConstraints!");
+ return;
+ }
- if ((consts = calloc(1, sizeof(_ppd_cups_uiconsts_t))) == NULL)
- {
- DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
- "UIConstraints!");
- return;
- }
+ consts->num_constraints = i;
+ consts->constraints = constptr;
- if ((constptr = calloc(2, sizeof(_ppd_cups_uiconst_t))) == NULL)
- {
- free(consts);
- DEBUG_puts("ppd_load_constraints: Unable to allocate memory for "
- "UIConstraints!");
- return;
- }
+ strlcpy(consts->resolver, constattr->spec, sizeof(consts->resolver));
+ for (i = 0, vptr = strchr(constattr->value, '*');
+ vptr;
+ i ++, vptr = strchr(vptr, '*'), constptr ++)
+ {
/*
- * Fill in the information...
+ * Extract "*Option Choice" or just "*Option"...
*/
- consts->num_constraints = 2;
- consts->constraints = constptr;
+ for (vptr ++, ptr = option; *vptr && !isspace(*vptr & 255); vptr ++)
+ if (ptr < (option + sizeof(option) - 1))
+ *ptr++ = *vptr;
- if (!strncasecmp(oldconst->option1, "Custom", 6) &&
- !strcasecmp(oldconst->choice1, "True"))
- {
- constptr[0].option = ppdFindOption(ppd, oldconst->option1 + 6);
- constptr[0].choice = ppdFindChoice(constptr[0].option, "Custom");
- constptr[0].installable = 0;
- }
- else
- {
- constptr[0].option = ppdFindOption(ppd, oldconst->option1);
- constptr[0].choice = ppdFindChoice(constptr[0].option,
- oldconst->choice1);
- constptr[0].installable = ppd_is_installable(installable,
- oldconst->option1);
- }
+ *ptr = '\0';
- if (!constptr[0].option || (!constptr[0].choice && oldconst->choice1[0]))
- {
- DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
- oldconst->option1, oldconst->choice1));
- free(consts->constraints);
- free(consts);
- continue;
- }
+ while (isspace(*vptr & 255))
+ vptr ++;
- if (!strncasecmp(oldconst->option2, "Custom", 6) &&
- !strcasecmp(oldconst->choice2, "True"))
- {
- constptr[1].option = ppdFindOption(ppd, oldconst->option2 + 6);
- constptr[1].choice = ppdFindChoice(constptr[1].option, "Custom");
- constptr[1].installable = 0;
- }
+ if (*vptr == '*')
+ choice[0] = '\0';
else
{
- constptr[1].option = ppdFindOption(ppd, oldconst->option2);
- constptr[1].choice = ppdFindChoice(constptr[1].option,
- oldconst->choice2);
- constptr[1].installable = ppd_is_installable(installable,
- oldconst->option2);
+ for (ptr = choice; *vptr && !isspace(*vptr & 255); vptr ++)
+ if (ptr < (choice + sizeof(choice) - 1))
+ *ptr++ = *vptr;
+
+ *ptr = '\0';
}
- if (!constptr[1].option || (!constptr[1].choice && oldconst->choice2[0]))
+ if (!strncasecmp(option, "Custom", 6) && !strcasecmp(choice, "True"))
{
- DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
- oldconst->option2, oldconst->choice2));
- free(consts->constraints);
- free(consts);
- continue;
+ _cups_strcpy(option, option + 6);
+ strcpy(choice, "Custom");
}
- consts->installable = constptr[0].installable || constptr[1].installable;
+ constptr->option = ppdFindOption(ppd, option);
+ constptr->choice = ppdFindChoice(constptr->option, choice);
+ constptr->installable = ppd_is_installable(installable, option);
+ consts->installable |= constptr->installable;
- /*
- * Add it to the constraints array...
- */
+ if (!constptr->option || (!constptr->choice && choice[0]))
+ {
+ DEBUG_printf(("ppd_load_constraints: Unknown option *%s %s!\n",
+ option, choice));
+ break;
+ }
+ }
+ if (!vptr)
cupsArrayAdd(ppd->cups_uiconstraints, consts);
+ else
+ {
+ free(consts->constraints);
+ free(consts);
}
}
}
diff --git a/data/utf-8 b/data/utf-8
index 6a1667a9d..044691b46 100644
--- a/data/utf-8
+++ b/data/utf-8
@@ -27,14 +27,14 @@ charset utf8
# Each font that is listed will be downloaded to the printer when used.
#
-0000 00FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-0100 01FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-0200 02FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-0300 03FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-0400 04FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-1E00 1EFF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-2000 20FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-2300 23FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-2400 24FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-2500 25FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
-2600 26FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-Bold-Oblique
+0000 00FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+0100 01FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+0200 02FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+0300 03FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+0400 04FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+1E00 1EFF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+2000 20FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+2300 23FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+2400 24FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+2500 25FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
+2600 26FF ltor single Monospace Monospace-Bold Monospace-Oblique Monospace-BoldOblique
diff --git a/doc/Makefile b/doc/Makefile
index 92a397f93..016b1d201 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -54,13 +54,10 @@ HELPFILES = \
help/man-cupsaccept.html \
help/man-backend.html \
help/man-cancel.html \
- help/man-classes.conf.html \
- help/man-client.conf.html \
help/man-cups-config.html \
help/man-cups-lpd.html \
help/man-cups-polld.html \
help/man-cupsaddsmb.html \
- help/man-cupsd.conf.html \
help/man-cupsd.html \
help/man-cupsenable.html \
help/man-cupstestdsc.html \
@@ -80,11 +77,17 @@ HELPFILES = \
help/man-lpstat.html \
help/man-mime.convs.html \
help/man-mime.types.html \
- help/man-printers.conf.html \
+ help/man-ppdc.html \
+ help/man-ppdhtml.html \
+ help/man-ppdi.html \
+ help/man-ppdmerge.html \
+ help/man-ppdpo.html \
help/network.html \
help/options.html \
help/overview.html \
help/policies.html \
+ help/postscript-driver.html \
+ help/ppd-compiler.html \
help/ref-access_log.html \
help/ref-classes-conf.html \
help/ref-client-conf.html \
diff --git a/doc/cups-printable.css b/doc/cups-printable.css
index 5256cae38..e4ad1fbff 100644
--- a/doc/cups-printable.css
+++ b/doc/cups-printable.css
@@ -19,6 +19,11 @@ PRE.command {
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: #eeeeee;
border: dotted thin #999999;
@@ -46,6 +51,16 @@ BLOCKQUOTE {
padding: 10pt;
}
+A IMG {
+ border: none;
+}
+
+A:link:hover IMG {
+ background: #f0f0f0;
+ border-radius: 10px;
+ -moz-border-radius: 10px;
+}
+
A:link, A:visited {
font-weight: normal;
text-decoration: none;
@@ -59,6 +74,19 @@ SUB, SUP {
font-size: 50%;
}
+TR.data, TD.data, TR.data TD {
+ margin-top: 10pt;
+ padding: 5pt;
+ border-bottom: solid 1pt #999999;
+}
+
+TR.data TH {
+ border-bottom: solid 1pt #999999;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+}
+
DIV.table TABLE {
border: solid thin #999999;
border-collapse: collapse;
@@ -102,19 +130,23 @@ DIV.figure CAPTION {
}
TH.label {
- padding-top: 5pt;
text-align: right;
vertical-align: top;
}
+TH.sublabel {
+ text-align: right;
+ font-weight: normal;
+}
+
HR {
border: solid thin;
}
SPAN.info {
- background: #000000;
- border: thin solid #000000;
- color: #ffffff;
+ background: black;
+ border: thin solid black;
+ color: white;
font-size: 80%;
font-style: italic;
font-weight: bold;
@@ -130,6 +162,57 @@ H2.title, H3.title {
border-bottom: solid 2pt #000000;
}
+DIV.indent, TABLE.indent {
+ margin-top: 2em;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.indent {
+ border-collapse: collapse;
+}
+
+TABLE.indent TD, TABLE.indent TH {
+ padding: 0;
+}
+
+TABLE.list {
+ border-collapse: collapse;
+ margin-left: auto;
+ margin-right: auto;
+ width: 90%;
+}
+
+TABLE.list TH {
+ background: white;
+ border-bottom: solid thin #cccccc;
+ color: #444444;
+ padding-top: 10pt;
+ padding-left: 5pt;
+ text-align: left;
+ vertical-align: bottom;
+ white-space: nowrap;
+}
+
+TABLE.list TH A {
+ color: #4444cc;
+}
+
+TABLE.list TD {
+ border-bottom: solid thin #eeeeee;
+ padding-top: 5pt;
+ padding-left: 5pt;
+}
+
+TABLE.list TR:nth-child(even) {
+ background: #f8f8f8;
+}
+
+TABLE.list TR:nth-child(odd) {
+ background: #f4f4f4;
+}
+
DT {
margin-left: 36pt;
margin-top: 12pt;
@@ -148,11 +231,6 @@ P.summary {
font-family: monaco, courier, monospace;
}
-SPAN.message {
- font-style: italic;
- font-size: smaller;
-}
-
DIV.summary TABLE {
border: solid thin #999999;
border-collapse: collapse;
diff --git a/doc/cups.css b/doc/cups.css
index 44f8f7c65..a12db9ca8 100644
--- a/doc/cups.css
+++ b/doc/cups.css
@@ -23,6 +23,11 @@ PRE.command {
margin-left: 36pt;
}
+P.example {
+ font-style: italic;
+ margin-left: 36pt;
+}
+
PRE.example {
background: white;
border: dotted thin #999999;
@@ -322,11 +327,9 @@ DIV.sidebar P.l2 {
TABLE.inset {
background: #f0f0f0;
border: thin solid #e0e0e0;
- margin-left: auto;
- margin-right: auto;
margin-top: 1em;
padding: 0;
- width: 90%;
+ width: 100%;
/* These are not implemented by all browsers, but that's OK */
border-radius: 5px;
-moz-border-radius: 5px;
diff --git a/doc/help/postscript-driver.html b/doc/help/postscript-driver.html
new file mode 100644
index 000000000..89f2df99b
--- /dev/null
+++ b/doc/help/postscript-driver.html
@@ -0,0 +1,255 @@
+
+
+
+ Developing PostScript Printer Drivers
+
+
+
+This document describes how to develop printer drivers for PostScript printers. Topics include: printer driver basics, creating new PPD files, importing existing PPD files, using custom filters, implementing color management, adding Mac OS X features, and deploying your driver.
+
+
+
+
+
+
+A CUPS PostScript printer driver consists of a PostScript Printer Description (PPD) file that describes the features and capabilities of the device, zero or more filter programs that prepare print data for the device, and zero or more support files for color management, online help, and so forth. The PPD file includes references to all of the filters and support files used by the driver.
+
+Every time a user prints something the scheduler program, cupsd(8), determines the format of the print job and the programs required to convert that job into something the printer understands. CUPS includes filter programs for many common formats, for example to convert Portable Document Format (PDF) files into device-independent PostScript, and then from device-independent PostScript to device-dependent PostScript. Figure 1 shows the data flow of a typical print job.
+
+
+
+The optional PostScript filter can be provided to add printer-specific commands to the PostScript output that cannot be represented in the PPD file or to reorganize the output for special printer features. Typically this is used to support advanced job management or finishing functions on the printer. CUPS includes a generic PostScript filter that handles all PPD-defined commands.
+
+The optional port monitor handles interface-specific protocol or encoding issues. For example, many PostScript printers support the Binary Communications Protocol (BCP) and Tagged Binary Communications Protocol (TBCP) to allow applications to print 8-bit ("binary") PostScript jobs. CUPS includes port monitors for BCP and TBCP, and you can supply your own port monitors as needed.
+
+The backend handles communications with the printer, sending print data from the last filter to the printer and relaying back-channel data from the printer to the upstream filters. CUPS includes backend programs for common direct-connect interfaces and network protocols, and you can provide your own backend to support custom interfaces and protocols.
+
+The scheduler also supports a special "command" file format for sending maintenance commands and status queries to a printer or printer driver. Command print jobs typically use a single command filter program defined in the PPD file to generate the appropriate printer commands and handle any responses from the printer. Figure 2 shows the data flow of a typical command job.
+
+
+
+PostScript printer drivers typically do not require their own command filter since CUPS includes a generic PostScript command filter that supports all of the standard functions using PPD-defined commands.
+
+
+
+
+We recommend using the CUPS PPD compiler, ppdc(1), to create new PPD files since it manages many of the tedious (and error-prone!) details of paper sizes and localization for you. It also allows you to easily support multiple devices from a single source file. For more information see the "Introduction to the PPD Compiler" document. Listing 1 shows a driver information file for a black-and-white PostScript printer.
+
+Listing 1: "examples/postscript.drv"
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// Specify this is a PostScript printer driver
+DriverType ps
+
+// List the fonts that are supported, in this case all standard fonts
+Font *
+
+// Manufacturer, model name, and version
+Manufacturer "Foo"
+ModelName "Foo LaserProofer 2000"
+Version 1.0
+
+// PostScript printer attributes
+Attribute DefaultColorSpace "" Gray
+Attribute LandscapeOrientation "" Minus90
+Attribute LanguageLevel "" "3"
+Attribute Product "" "(Foo LaserProofer 2000)"
+Attribute PSVersion "" "(3010) 0"
+Attribute TTRasterizer "" Type42
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize Legal
+MediaSize A4
+
+// Query command for page size
+Attribute "?PageSize" "" "
+ save
+ currentpagedevice /PageSize get aload pop
+ 2 copy gt {exch} if (Unknown)
+ 23 dict
+ dup [612 792] (Letter) put
+ dup [612 1008] (Legal) put
+ dup [595 842] (A4) put
+ {exch aload pop 4 index sub abs 5 le exch
+ 5 index sub abs 5 le and
+ {exch pop exit} {pop} ifelse
+ } bind forall = flush pop pop
+ restore"
+
+// Specify the name of the PPD file we want to generate
+PCFileName "fooproof.ppd"
+
+
+Required Attributes
+
+PostScript drivers require the attributes listed in Table 1. If not specified, the defaults for CUPS drivers are used. A typical PostScript driver information file would include the following attributes:
+
+
+Attribute DefaultColorSpace "" Gray
+Attribute LandscapeOrientation "" Minus90
+Attribute LanguageLevel "" "3"
+Attribute Product "" "(Foo LaserProofer 2000)"
+Attribute PSVersion "" "(3010) 0"
+Attribute TTRasterizer "" Type42
+
+
+
+Table 1: Required PostScript Printer Driver Attributes
+
+
+ Attribute |
+ Description |
+
+
+
+
+ DefaultColorSpace |
+ The default colorspace:
+ Gray, RGB, CMY, or
+ CMYK. If not specified, then RGB is
+ assumed. |
+
+
+ LandscapeOrientation |
+ The preferred landscape
+ orientation: Plus90, Minus90, or
+ Any. If not specified, Plus90 is
+ assumed. |
+
+
+ LanguageLevel |
+ The PostScript language
+ level supported by the device: 1, 2, or 3. If not
+ specified, 2 is assumed. |
+
+
+ Product |
+ The string returned by
+ the PostScript product operator, which
+ must include parenthesis to conform with
+ PostScript syntax rules for strings. Multiple
+ Product attributes may be specified to support
+ multiple products with the same PPD file. If not
+ specified, "(ESP Ghostscript)" and "(GNU Ghostscript)"
+ are assumed. |
+
+
+ PSVersion |
+ The PostScript
+ interpreter version numbers as returned by the
+ version and revision operators. The
+ required format is "(version) revision". Multiple
+ PSVersion attributes may be specified to
+ support multiple interpreter version numbers. If not
+ specified, "(3010) 705" and "(3010) 707" are
+ assumed. |
+
+
+ TTRasterizer |
+ The type of TrueType
+ font rasterizer supported by the device, if any. The
+ supported values are None, Accept68k,
+ Type42, and TrueImage. If not
+ specified, None is assumed. |
+
+
+
+Query Commands
+
+Most PostScript printer PPD files include query commands (?PageSize, etc.) that allow applications to query the printer for its current settings and configuration. Query commands are included in driver information files as attributes. For example, the example in Listing 1 uses the following definition for the PageSize query command:
+
+
+Attribute "?PageSize" "" "
+ save
+ currentpagedevice /PageSize get aload pop
+ 2 copy gt {exch} if (Unknown)
+ 23 dict
+ dup [612 792] (Letter) put
+ dup [612 1008] (Legal) put
+ dup [595 842] (A4) put
+ {exch aload pop 4 index sub abs 5 le exch
+ 5 index sub abs 5 le and
+ {exch pop exit} {pop} ifelse
+ } bind forall = flush pop pop
+ restore"
+
+
+Query commands can span multiple lines, however no single line may contain more than 255 characters.
+
+
+
+CUPS includes a utility called ppdi(1)
+which allows you to import existing PPD files into the driver information file
+format used by the PPD compiler ppdc(1). Once
+imported, you can modify, localize, and regenerate the PPD files easily. Type
+the following command to import the PPD file mydevice.ppd into the
+driver information file mydevice.drv:
+
+
+ppdi -o mydevice.drv mydevice.ppd
+
+
+If you have a whole directory of PPD files that you would like to import,
+you can list multiple filenames or use shell wildcards to import more than one
+PPD file on the command-line:
+
+
+ppdi -o mydevice.drv mydevice1.ppd mydevice2.ppd
+ppdi -o mydevice.drv *.ppd
+
+
+If the driver information file already exists, the new PPD
+file entries are appended to the end of the file. Each PPD file
+is placed in its own group of curly braces within the driver
+information file.
+
+
+
+
+Normally a PostScript printer driver will not utilize any additional print filters. For drivers that provide additional filters such as a CUPS command file filter for doing printer maintenance, you must also list the following Filter directive to handle printing PostScript files:
+
+
+Filter application/vnd.cups-postscript 0 -
+
+
+
+
+
+Talk about ICC color profiles and sRGB as two best options.
+
+
+
+
+Talk about help books, icons, and PDEs.
+
+
+
+
+Talk about install locations, etc.
+
+
+
+
diff --git a/doc/help/ppd-compiler.html b/doc/help/ppd-compiler.html
new file mode 100644
index 000000000..aa52b8821
--- /dev/null
+++ b/doc/help/ppd-compiler.html
@@ -0,0 +1,839 @@
+
+
+
+ Introduction to the PPD Compiler
+
+
+
+This document describes how to use the CUPS PostScript Printer Description
+(PPD) file compiler. The PPD compiler generates PPD files from simple text files
+that describe the features and capabilities of one or more printers.
+
+
+
+
+
+
+The PPD compiler, ppdc(1)
, is a
+simple command-line tool that takes a single driver information file,
+which by convention uses the extension .drv, and produces one or more
+PPD files that may be distributed with your printer drivers for use with CUPS.
+For example, you would run the following command to create the English language
+PPD files defined by the driver information file mydrivers.drv:
+
+
+ppdc mydrivers.drv
+
+
+The PPD files are placed in a subdirectory called
+ppd. The -d option is used to put the PPD
+files in a different location, for example:
+
+
+ppdc -d myppds mydrivers.drv
+
+
+places the PPD files in a subdirectory named
+myppds. Finally, use the -l option to
+specify the language localization for the PPD files that are
+created, for example:
+
+
+ppdc -d myppds/de -l de mydrivers.drv
+ppdc -d myppds/en -l en mydrivers.drv
+ppdc -d myppds/es -l es mydrivers.drv
+ppdc -d myppds/fr -l fr mydrivers.drv
+ppdc -d myppds/it -l it mydrivers.drv
+
+
+creates PPD files in German (de), English (en), Spanish (es),
+French (fr), and Italian (it) in the corresponding
+subdirectories. Specify multiple languages (separated by commas) to produce
+"globalized" PPD files:
+
+
+ppdc -d myppds -l de,en,es,fr,it mydrivers.drv
+
+
+
+
+
+The driver information files accepted by the PPD compiler are
+plain text files that define the various attributes and options
+that are included in the PPD files that are generated. A driver
+information file can define the information for one or more printers and
+their corresponding PPD files.
+
+Listing 1: "examples/minimum.drv"
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer, model name, and version
+Manufacturer "Foo"
+ModelName "FooJet 2000"
+Version 1.0
+
+// Each filter provided by the driver...
+Filter application/vnd.cups-raster 100 rastertofoo
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize A4
+
+// Supported resolutions
+*Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+// Specify the name of the PPD file we want to generate...
+PCFileName "foojet2k.ppd"
+
+
+
+
+
+The example in Listing 1 shows a driver information
+file which defines the minimum required attributes to provide a valid PPD file.
+The first part of the file includes standard definition files for fonts and
+media sizes:
+
+
+#include <font.defs>
+#include <media.defs>
+
+
+The #include directive works just like the C/C++ include directive;
+files included using the angle brackets (<filename>) are found
+in any of the standard include directories and files included using quotes
+("filename") are found in the same directory as the source or include
+file. The <font.defs> include file defines the standard fonts
+which are included with GPL Ghostscript and the Apple PDF RIP, while the
+<media.defs> include file defines the standard media sizes
+listed in Appendix B of the Adobe PostScript Printer Description File Format
+Specification.
+
+CUPS provides several other standard include files:
+
+
+
+ - <epson.h> - Defines all of the rastertoepson driver
+ constants.
+
+ - <escp.h> - Defines all of the rastertoescpx driver
+ constants.
+
+ - <hp.h> - Defines all of the rastertohp driver
+ constants.
+
+ - <label.h> - Defines all of the rastertolabel driver
+ constants.
+
+ - <pcl.h> - Defines all of the rastertopclx driver
+ constants.
+
+ - <raster.defs> - Defines all of the CUPS raster format
+ constants.
+
+
+
+Next we list all of the fonts that are available in the driver; for CUPS
+raster drivers, the following line is all that is usually supplied:
+
+
+Font *
+
+
+The Font directive specifies the name of a single font or the
+asterisk to specify all fonts. For example, you would use the following line to
+define an additional bar code font that you are supplying with your printer
+driver:
+
+
+// name encoding version charset status
+Font Barcode-Foo Special "(1.0)" Special ROM
+
+
+The name of the font is Barcode-Foo. Since it is not a standard
+text font, the encoding and charset name Special is used. The version
+number is 1.0 and the status (where the font is located) is
+ROM to indicate that the font does not need to be embedded in
+documents that use the font for this printer.
+
+Third comes the manufacturer, model name, and version number information
+strings:
+
+
+Manufacturer "Foo"
+ModelName "FooJet 2000"
+Version 1.0
+
+
+These strings are used when the user (or auto-configuration program) selects
+the printer driver for a newly connected device.
+
+The list of filters comes after the information strings; for the example in
+Listing 1, we have a single filter that takes CUPS
+raster data:
+
+
+Filter application/vnd.cups-raster 100 rastertofoo
+
+
+Each filter specified in the driver information file is the equivalent of a
+printer driver for that format; if a user submits a print job in a different
+format, CUPS figures out the sequence of commands that will produce a supported
+format for the least relative cost.
+
+Once we have defined the driver information we specify the supported options.
+For the example driver we support a single resolution of 600 dots per inch and
+two media sizes, A4 and Letter:
+
+
+*MediaSize Letter
+MediaSize A4
+
+*Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+
+The asterisk in front of the MediaSize and Resolution
+directives specify that those option choices are the default. The
+MediaSize directive is followed by a media size name which is normally
+defined in the <media.defs> file and corresponds to a standard
+Adobe media size name. If the default media size is Letter, the PPD
+compiler will override it to be A4 for non-English localizations for
+you automatically.
+
+The Resolution directive accepts several values after it as
+follows:
+
+
+
+ - Colorspace for this resolution, if any. In the example file, the
+ colorspace k is used which corresponds to black. For printer
+ drivers that support color printing, this field is usually specified as
+ "-" for "no change".
+
+ - Bits per color. In the example file, we define 8 bits per color, for
+ a continuous-tone grayscale output. All versions of CUPS support 1 and
+ 8 bits per color. CUPS 1.2 and higher (Mac OS X 10.5 and higher) also
+ supports 16 bits per color.
+
+ - Rows per band. In the example file, we define 0 rows per band to
+ indicate that our printer driver does not process the page in
+ bands.
+
+ - Row feed. In the example, we define the feed value to be 0 to
+ indicate that our printer driver does not interleave the output.
+
+ - Row step. In the example, we define the step value to be 0 to
+ indicate that our printer driver does not interleave the output. This
+ value normally indicates the spacing between the nozzles of an inkjet
+ printer - when combined with the previous two values, it informs the
+ driver how to stagger the output on the page to produce interleaved
+ lines on the page for higher-resolution output.
+
+ - Choice name and text. In the example, we define the choice name and
+ text to be "600dpi/600 DPI". The name and text are separated by
+ slash (/) character; if no text is specified, then the name is
+ used as the text. The PPD compiler parses the name to determine the
+ actual resolution; the name can be of the form
+ RESOLUTIONdpi for resolutions that are equal
+ horizontally and vertically or HRESxVRESdpi for
+ isometric resolutions. Only integer resolution values are supported, so
+ a resolution name of 300dpi is valid while 300.1dpi is
+ not.
+
+
+
+Finally, the PCFileName directive specifies that the named PPD file
+should be written for the current driver definitions:
+
+
+PCFileName "foojet2k.ppd"
+
+
+The filename follows the directive and must conform to the Adobe
+filename requirements in the Adobe Postscript Printer Description File Format
+Specification. Specifically, the filename may not exceed 8 characters followed
+by the extension .ppd. The FileName directive can be used to
+specify longer filenames:
+
+
+FileName "FooJet 2000"
+
+
+
+
+
+The previous example created a single PPD file. Driver information files can
+also define multiple printers by using the PPD compiler grouping functionality.
+Directives are grouped using the curly braces ({ and }) and
+every group that uses the PCFileName or FileName directives
+produces a PPD file with that name. Listing 2 shows a
+variation of the original example that uses two groups to define two printers
+that share the same printer driver filter but provide two different resolution
+options.
+
+Listing 2: "examples/grouping.drv"
+
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer and version
+Manufacturer "Foo"
+Version 1.0
+
+// Each filter provided by the driver...
+Filter application/vnd.cups-raster 100 rastertofoo
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize A4
+
+{
+ // Supported resolutions
+ *Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+ // Specify the model name and filename...
+ ModelName "FooJet 2000"
+ PCFileName "foojet2k.ppd"
+}
+
+{
+ // Supported resolutions
+ *Resolution k 8 0 0 0 "1200dpi/1200 DPI"
+
+ // Specify the model name and filename...
+ ModelName "FooJet 2001"
+ PCFileName "foojt2k1.ppd"
+}
+
+
+The second example is essentially the same as the first, except that each
+printer model is defined inside of a pair of curly braces. For example, the
+first printer is defined using:
+
+
+{
+ // Supported resolutions
+ *Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+ // Specify the model name and filename...
+ ModelName "FooJet 2000"
+ PCFileName "foojet2k.ppd"
+}
+
+
+The printer inherits all of the definitions from the parent group (the
+top part of the file) and adds the additional definitions inside the curly
+braces for that printer driver. When we define the second group, it also
+inherits the same definitions from the parent group but none of the
+definitions from the first driver. Groups can be nested to any number of levels
+to support variations of similar models without duplication of information.
+
+
+
+
+For printer drivers that support color printing, the
+ColorDevice and ColorModel directives should be
+used to tell the printing system that color output is desired
+and in what formats. Listing 3 shows a
+variation of the previous example which includes a color printer
+that supports printing at 300 and 600 DPI.
+
+The key changes are the addition of the ColorDevice
+directive:
+
+
+ColorDevice true
+
+
+which tells the printing system that the printer supports
+color printing, and the ColorModel directives:
+
+
+ColorModel Gray/Grayscale w chunky 0
+*ColorModel RGB/Color rgb chunky 0
+
+
+which tell the printing system which colorspaces are supported by the printer
+driver for color printing. Each of the ColorModel directives is
+followed by the option name and text (Gray/Grayscale and
+RGB/Color), the colorspace name (w and rgb), the
+color organization (chunky), and the compression mode number
+(0) to be passed to the driver. The option name can be any of the
+standard Adobe ColorModel names:
+
+
+
+ - Gray - Grayscale output.
+
+
- RGB - Color output, typically using the RGB
+ colorspace, but without a separate black channel.
+
+
- CMYK - Color output with a separate black
+ channel.
+
+
+
+Custom names can be used, however it is recommended that you use your vendor
+prefix for any custom names, for example "fooName".
+
+The colorspace name can be any of the following universally supported
+colorspaces:
+
+
+ - w - Luminance
+
+ - rgb - Red, green, blue
+
+ - k - Black
+
+ - cmy - Cyan, magenta, yellow
+
+ - cmyk - Cyan, magenta, yellow, black
+
+
+
+The color organization can be any of the following values:
+
+
+
+ - chunky - Color values are passed together on a line
+ as RGB RGB RGB RGB
+
+ - banded - Color values are passed separately
+ on a line as RRRR GGGG BBBB; not supported by the Apple
+ RIP filters
+
+ - planar - Color values are passed separately
+ on a page as RRRR RRRR RRRR ... GGGG GGGG GGGG ... BBBB
+ BBBB BBBB; not supported by the Apple RIP filters
+
+
+
+The compression mode value is passed to the driver in the
+cupsCompression attribute. It is traditionally used to select an
+appropriate compression mode for the color model but can be used for any
+purpose, such as specifying a photo mode vs. standard mode.
+
+Listing 3: "examples/color.drv"
+
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer and version
+Manufacturer "Foo"
+Version 1.0
+
+// Each filter provided by the driver...
+Filter application/vnd.cups-raster 100 rastertofoo
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize A4
+
+{
+ // Supported resolutions
+ *Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+ // Specify the model name and filename...
+ ModelName "FooJet 2000"
+ PCFileName "foojet2k.ppd"
+}
+
+{
+ // Supports color printing
+ ColorDevice true
+
+ // Supported colorspaces
+ ColorModel Gray/Grayscale w chunky 0
+ *ColorModel RGB/Color rgb chunky 0
+
+ // Supported resolutions
+ *Resolution - 8 0 0 0 "300dpi/300 DPI"
+ Resolution - 8 0 0 0 "600dpi/600 DPI"
+
+ // Specify the model name and filename...
+ ModelName "FooJet Color"
+ PCFileName "foojetco.ppd"
+}
+
+
+
+
+
+The Group, Option, and Choice
+directives are used to define or select a group, option, or
+choice. Listing 4 shows a variation of
+the first example that provides two custom options in a group
+named "Footasm".
+
+Listing 4: "examples/custom.drv"
+
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer, model name, and version
+Manufacturer "Foo"
+ModelName "FooJet 2000"
+Version 1.0
+
+// Each filter provided by the driver...
+Filter application/vnd.cups-raster 100 rastertofoo
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize A4
+
+// Supported resolutions
+*Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+// Option Group
+Group "Footasm"
+
+ // Boolean option
+ Option "fooEnhance/Resolution Enhancement" Boolean AnySetup 10
+ *Choice True/Yes "<</cupsCompression 1>>setpagedevice"
+ Choice False/No "<</cupsCompression 0>>setpagedevice"
+
+ // Multiple choice option
+ Option "fooOutputType/Output Quality" PickOne AnySetup 10
+ *Choice "Auto/Automatic Selection"
+ "<</OutputType(Auto)>>setpagedevice""
+ Choice "Text/Optimize for Text"
+ "<</OutputType(Text)>>setpagedevice""
+ Choice "Graph/Optimize for Graphics"
+ "<</OutputType(Graph)>>setpagedevice""
+ Choice "Photo/Optimize for Photos"
+ "<</OutputType(Photo)>>setpagedevice""
+
+// Specify the name of the PPD file we want to generate...
+PCFileName "foojet2k.ppd"
+
+
+The custom group is introduced by the Group
+directive which is followed by the name and optionally text for
+the user:
+
+
+Group "Footasm/Footastic Options"
+
+
+The group name must conform to the PPD specification and
+cannot exceed 40 characters in length. If you specify user text,
+it cannot exceed 80 characters in length. The groups
+General, Extra, and
+InstallableOptions are predefined by CUPS; the general
+and extra groups are filled by the UI options defined by the PPD
+specification. The InstallableOptions group is reserved
+for options that define whether accessories for the printer
+(duplexer unit, finisher, stapler, etc.) are installed.
+
+Once the group is specified, the Option directive is
+used to introduce a new option:
+
+
+Option "fooEnhance/Resolution Enhancement" Boolean AnySetup 10
+
+
+The directive is followed by the name of the option and any
+optional user text, the option type, the PostScript document group, and
+the sort order number. The option name must conform to the PPD specification
+and cannot exceed 40 characters in length. If you specify user text, it
+cannot exceed 80 characters in length.
+
+The option type can be Boolean for true/false
+selections, PickOne for picking one of many choices, or
+PickMany for picking zero or more choices. Boolean
+options can have at most two choices with the names
+False and True. Pick options can have any
+number of choices, although for Windows compatibility reasons
+the number of choices should not exceed 255.
+
+The PostScript document group is typically AnySetup,
+meaning that the option can be introduced at any point in the
+PostScript document. Other values include PageSetup to
+include the option before each page and DocumentSetup
+to include the option once at the beginning of the document.
+
+The sort order number is used to sort the printer commands
+associated with each option choice within the PostScript
+document. This allows you to setup certain options before others
+as required by the printer. For most CUPS raster printer
+drivers, the value 10 can be used for all options.
+
+Once the option is specified, each option choice can be
+listed using the Choice directive:
+
+
+*Choice True/Yes "<</cupsCompression 1>>setpagedevice"
+Choice False/No "<</cupsCompression 0>>setpagedevice"
+
+
+The directive is followed by the choice name and optionally
+user text, and the PostScript commands that should be inserted
+when printing a file to this printer. The option name must
+conform to the PPD specification and cannot exceed 40 characters
+in length. If you specify user text, it cannot exceed 80
+characters in length.
+
+The PostScript commands are also interpreted by any RIP
+filters, so these commands typically must be present for all
+option choices. Most commands take the form:
+
+
+<</name value>>setpagedevice
+
+
+where name is the name of the PostScript page device
+attribute and value is the numeric or string value for
+that attribute.
+
+
+
+
+Sometimes you will want to define constants for your drivers
+so that you can share values in different groups within the same
+driver information file, or to share values between different
+driver information files using the #include directive.
+The #define directive is used to define constants for
+use in your printer definitions:
+
+
+#define NAME value
+
+
+The NAME is any sequence of letters, numbers, and
+the underscore. The value is a number or string; if the
+value contains spaces you must put double quotes around it, for
+example:
+
+
+#define FOO "My String Value"
+
+
+Constants can also be defined on the command-line using the -D
+option:
+
+
+ppdc -DNAME="value" filename.drv
+
+
+Once defined, you use the notation $NAME to substitute the value of
+the constant in the file, for example:
+
+
+#define MANUFACTURER "Foo"
+#define FOO_600 0
+#define FOO_1200 1
+
+{
+ Manufacturer "$MANUFACTURER"
+ ModelNumber $FOO_600
+ ModelName "FooJet 2000"
+ ...
+}
+
+{
+ Manufacturer "$MANUFACTURER"
+ ModelNumber $FOO_1200
+ ModelName "FooJet 2001"
+ ...
+}
+
+
+Numeric constants can be bitwise OR'd together by placing the constants
+inside parenthesis, for example:
+
+
+// ModelNumber capability bits
+#define DUPLEX 1
+#define COLOR 2
+
+...
+
+{
+ // Define a model number specifying the capabilities of the printer...
+ ModelNumber ($DUPLEX $COLOR)
+ ...
+}
+
+
+
+
+
+The PPD compiler supports conditional compilation using the #if,
+#elif, #else, and #endif directives. The #if
+and #elif directives are followed by a constant name or an expression.
+For example, to include a group of options when "ADVANCED" is defined:
+
+
+#if ADVANCED
+Group "Advanced/Advanced Options"
+ Option "fooCyanAdjust/Cyan Adjustment"
+ Choice "plus10/+10%" ""
+ Choice "plus5/+5%" ""
+ *Choice "none/No Adjustment" ""
+ Choice "minus5/-5%" ""
+ Choice "minus10/-10%" ""
+ Option "fooMagentaAdjust/Magenta Adjustment"
+ Choice "plus10/+10%" ""
+ Choice "plus5/+5%" ""
+ *Choice "none/No Adjustment" ""
+ Choice "minus5/-5%" ""
+ Choice "minus10/-10%" ""
+ Option "fooYellowAdjust/Yellow Adjustment"
+ Choice "plus10/+10%" ""
+ Choice "plus5/+5%" ""
+ *Choice "none/No Adjustment" ""
+ Choice "minus5/-5%" ""
+ Choice "minus10/-10%" ""
+ Option "fooBlackAdjust/Black Adjustment"
+ Choice "plus10/+10%" ""
+ Choice "plus5/+5%" ""
+ *Choice "none/No Adjustment" ""
+ Choice "minus5/-5%" ""
+ Choice "minus10/-10%" ""
+#endif
+
+
+
+
+
+Constraints are strings that are used to specify that one or more option
+choices are incompatible, for example two-sided printing on transparency media.
+Constraints are also used to prevent the use of uninstalled features such as the
+duplexer unit, additional media trays, and so forth.
+
+The UIConstraints directive is used to specify a constraint that is
+placed in the PPD file. The directive is followed by a string using one of the
+following formats:
+
+
+UIConstraints "*Option1 *Option2"
+UIConstraints "*Option1 Choice1 *Option2"
+UIConstraints "*Option1 *Option2 Choice2"
+UIConstraints "*Option1 Choice1 *Option2 Choice2"
+
+
+Each option name is preceded by the asterisk (*). If no choice is
+given for an option, then all choices except False and
+None will conflict with the other option and choice(s). Since the PPD
+compiler automatically adds reciprocal constraints (option A conflicts with
+option B, so therefore option B conflicts with option A), you need only specify
+the constraint once.
+
+Listing 5: "examples/constraint.drv"
+
+
+
+// Include standard font and media definitions
+#include <font.defs>
+#include <media.defs>
+
+// List the fonts that are supported, in this case all standard fonts...
+Font *
+
+// Manufacturer, model name, and version
+Manufacturer "Foo"
+ModelName "FooJet 2000"
+Version 1.0
+
+// Each filter provided by the driver...
+Filter application/vnd.cups-raster 100 rastertofoo
+
+// Supported page sizes
+*MediaSize Letter
+MediaSize A4
+
+// Supported resolutions
+*Resolution k 8 0 0 0 "600dpi/600 DPI"
+
+// Installable Option Group
+Group "InstallableOptions/Options Installed"
+
+ // Duplexing unit option
+ Option "OptionDuplexer/Duplexing Unit" Boolean AnySetup 10
+ Choice True/Installed ""
+ *Choice "False/Not Installed" ""
+
+// General Option Group
+Group General
+
+ // Duplexing option
+ Option "Duplex/Two-Sided Printing" PickOne AnySetup 10
+ *Choice "None/No" "<</Duplex false>>setpagedevice""
+ Choice "DuplexNoTumble/Long Edge Binding"
+ "<</Duplex true/Tumble false>>setpagedevice""
+ Choice "DuplexTumble/Short Edge Binding"
+ "<</Duplex true/Tumble true>>setpagedevice""
+
+// Only allow duplexing if the duplexer is installed
+UIConstraints "*Duplex *OptionDuplexer False"
+
+// Specify the name of the PPD file we want to generate...
+PCFileName "foojet2k.ppd"
+
+
+Listing 5 shows a variation of the first example with
+an added Duplex option and installable option for the duplexer,
+OptionDuplex. A constraint is added at the end to specify that any
+choice of the Duplex option that is not None is incompatible
+with the "Duplexer Installed" option set to "Not Installed"
+(False):
+
+
+UIConstraints "*Duplex *OptionDuplexer False"
+
+
+Enhanced Constraints
+
+CUPS 1.4 supports constraints between 2 or more options using the
+Attribute directive. cupsUIConstraints attributes define
+the constraints, while cupsUIResolver attributes define option changes
+to resolve constraints. For example, we can specify the previous duplex
+constraint with a resolver that turns off duplexing with the following two
+lines:
+
+
+Attribute cupsUIConstraints DuplexOff "*Duplex *OptionDuplexer False"
+Attribute cupsUIResolver DuplexOff "*Duplex None"
+
+
+
+
diff --git a/doc/help/ref-ppdcfile.html b/doc/help/ref-ppdcfile.html
index 86619e3ef..4549586b6 100644
--- a/doc/help/ref-ppdcfile.html
+++ b/doc/help/ref-ppdcfile.html
@@ -2404,7 +2404,7 @@ supported keywords for each type.