CHANGES IN CUPS V1.1.13
+ - Classification and page labels were not rotated to
+ match the page orientation.
- Now set the TCP "no delay" option on network
connections to improve performance/response time.
- Improved the IRIX printing tools support with patches
#
-# "$Id: mime.convs,v 1.14 2002/01/02 17:58:38 mike Exp $"
+# "$Id: mime.convs,v 1.15 2002/01/23 22:30:41 mike Exp $"
#
# MIME converts file for the Common UNIX Printing System (CUPS).
#
# option.
#
-#*/* application/vnd.cups-raw 0 -
+#application/octet-stream application/vnd.cups-raw 0 -
#
-# End of "$Id: mime.convs,v 1.14 2002/01/02 17:58:38 mike Exp $".
+# End of "$Id: mime.convs,v 1.15 2002/01/23 22:30:41 mike Exp $".
#
#
-# "$Id: Makefile,v 1.56 2002/01/23 17:25:38 mike Exp $"
+# "$Id: Makefile,v 1.57 2002/01/23 22:30:42 mike Exp $"
#
# Filter makefile for the Common UNIX Printing System (CUPS).
#
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ imagetops.o common.o $(LINKCUPSIMAGE) \
$(IMGLIBS) $(LIBS)
-imagetops: common.h image.h
+imagetops.o: common.h image.h
#
echo Linking $@...
$(CC) $(LDFLAGS) -o $@ imagetoraster.o common.o $(LINKCUPSIMAGE) \
$(IMGLIBS) $(LIBS)
-imagetoraster: common.h image.h raster.h
+imagetoraster.o: common.h image.h raster.h
#
#
-# End of "$Id: Makefile,v 1.56 2002/01/23 17:25:38 mike Exp $".
+# End of "$Id: Makefile,v 1.57 2002/01/23 22:30:42 mike Exp $".
#
/*
- * "$Id: common.c,v 1.17 2002/01/02 17:58:56 mike Exp $"
+ * "$Id: common.c,v 1.18 2002/01/23 22:30:42 mike Exp $"
*
* Common filter routines for the Common UNIX Printing System (CUPS).
*
*
* Contents:
*
- * SetCommonOptions() - Set common filter options for media size,
- * etc.
- * UpdatePageVars() - Update the page variables for the
- * orientation.
- * WriteClassificationProlog() - Write the prolog with the classification
- * and page label.
+ * SetCommonOptions() - Set common filter options for media size,
+ * etc.
+ * UpdatePageVars() - Update the page variables for the orientation.
+ * WriteLabelProlog() - Write the prolog with the classification
+ * and page label.
+ * WriteLabels() - Write the actual page labels.
*/
/*
if ((val = cupsGetOption("page-left", num_options, options)) != NULL)
{
- switch (Orientation)
+ switch (Orientation & 3)
{
case 0 :
PageLeft = (float)atof(val);
if ((val = cupsGetOption("page-right", num_options, options)) != NULL)
{
- switch (Orientation)
+ switch (Orientation & 3)
{
case 0 :
PageRight = PageWidth - (float)atof(val);
if ((val = cupsGetOption("page-bottom", num_options, options)) != NULL)
{
- switch (Orientation)
+ switch (Orientation & 3)
{
case 0 :
PageBottom = (float)atof(val);
if ((val = cupsGetOption("page-top", num_options, options)) != NULL)
{
- switch (Orientation)
+ switch (Orientation & 3)
{
case 0 :
PageTop = PageLength - (float)atof(val);
float temp; /* Swapping variable */
- switch (Orientation)
+ switch (Orientation & 3)
{
case 0 : /* Portait */
break;
/*
- * 'WriteClassificationProlog()' - Write the prolog with the classification
- * and page label.
+ * 'WriteLabelProlog()' - Write the prolog with the classification
+ * and page label.
*/
void
-WriteLabelProlog(const char *label) /* I - Page label */
+WriteLabelProlog(const char *label, /* I - Page label */
+ float bottom, /* I - Bottom position in points */
+ float top, /* I - Top position in points */
+ float width) /* I - Width in points */
{
const char *classification; /* CLASSIFICATION environment variable */
puts("/espWL{");
puts(" espPF setfont");
printf(" espPL stringwidth pop dup 12 add exch -0.5 mul %.0f add\n",
- PageWidth * 0.5f);
+ width * 0.5f);
puts(" 1 setgray");
- printf(" dup 6 sub %.0f 3 index 20 rectfill\n", PageBottom - 2.0);
- printf(" dup 6 sub %.0f 3 index 20 rectfill\n", PageTop - 18.0);
+ printf(" dup 6 sub %.0f 3 index 20 rectfill\n", bottom - 2.0);
+ printf(" dup 6 sub %.0f 3 index 20 rectfill\n", top - 18.0);
puts(" 0 setgray");
- printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", PageBottom - 2.0);
- printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", PageTop - 18.0);
- printf(" dup %.0f moveto espPL show\n", PageBottom + 2.0);
- printf(" %.0f moveto espPL show\n", PageTop - 14.0);
+ printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", bottom - 2.0);
+ printf(" dup 6 sub %.0f 3 index 20 rectstroke\n", top - 18.0);
+ printf(" dup %.0f moveto espPL show\n", bottom + 2.0);
+ printf(" %.0f moveto espPL show\n", top - 14.0);
puts("pop");
puts("}bind def");
}
/*
- * End of "$Id: common.c,v 1.17 2002/01/02 17:58:56 mike Exp $".
+ * 'WriteLabels()' - Write the actual page labels.
+ */
+
+void
+WriteLabels(int orient) /* I - Orientation of the page */
+{
+ float width, /* Width of page */
+ length; /* Length of page */
+
+
+ puts("gsave");
+
+ if ((orient ^ Orientation) & 1)
+ {
+ width = PageLength;
+ length = PageWidth;
+ }
+ else
+ {
+ width = PageWidth;
+ length = PageLength;
+ }
+
+ switch (orient & 3)
+ {
+ case 1 : /* Landscape */
+ printf("%.1f 0.0 translate 90 rotate\n", length);
+ break;
+ case 2 : /* Reverse Portrait */
+ printf("%.1f %.1f translate 180 rotate\n", width, length);
+ break;
+ case 3 : /* Reverse Landscape */
+ printf("0.0 %.1f translate -90 rotate\n", width);
+ break;
+ }
+
+ puts("espWL");
+ puts("grestore");
+}
+
+
+/*
+ * End of "$Id: common.c,v 1.18 2002/01/23 22:30:42 mike Exp $".
*/
/*
- * "$Id: common.h,v 1.8 2002/01/02 17:58:56 mike Exp $"
+ * "$Id: common.h,v 1.9 2002/01/23 22:30:42 mike Exp $"
*
* Common filter definitions for the Common UNIX Printing System (CUPS).
*
extern ppd_file_t *SetCommonOptions(int num_options, cups_option_t *options,
int change_size);
extern void UpdatePageVars(void);
-extern void WriteLabelProlog(const char *label);
-#define WriteLabels() puts("espWL");
+extern void WriteLabelProlog(const char *label, float bottom,
+ float top, float width);
+extern void WriteLabels(int orient);
/*
- * End of "$Id: common.h,v 1.8 2002/01/02 17:58:56 mike Exp $".
+ * End of "$Id: common.h,v 1.9 2002/01/23 22:30:42 mike Exp $".
*/
/*
- * "$Id: imagetops.c,v 1.41 2002/01/02 17:59:00 mike Exp $"
+ * "$Id: imagetops.c,v 1.42 2002/01/23 22:30:42 mike Exp $"
*
* Image file to PostScript filter for the Common UNIX Printing System (CUPS).
*
printf("{ neg 1 add dup 0 lt { pop 1 } { %.3f exp neg 1 add } "
"ifelse %.3f mul } bind settransfer\n", g, b);
- WriteLabelProlog(cupsGetOption("page-label", num_options, options));
+ WriteLabelProlog(cupsGetOption("page-label", num_options, options),
+ PageBottom, PageTop, PageWidth);
if (realcopies > 1)
{
}
puts("grestore");
- WriteLabels();
+ WriteLabels(Orientation);
puts("showpage");
}
/*
- * End of "$Id: imagetops.c,v 1.41 2002/01/02 17:59:00 mike Exp $".
+ * End of "$Id: imagetops.c,v 1.42 2002/01/23 22:30:42 mike Exp $".
*/
/*
- * "$Id: pstops.c,v 1.71 2002/01/23 17:25:38 mike Exp $"
+ * "$Id: pstops.c,v 1.72 2002/01/23 22:30:42 mike Exp $"
*
* PostScript filter for the Common UNIX Printing System (CUPS).
*
UseESPsp = 1;
}
- WriteLabelProlog(val);
+ if (NUp == 2)
+ {
+ /*
+ * For 2-up output, rotate the labels to match the orientation
+ * of the pages...
+ */
+
+ if (Orientation & 1)
+ WriteLabelProlog(val, PageBottom, PageWidth - PageLength + PageTop,
+ PageLength);
+ else
+ WriteLabelProlog(val, PageLeft, PageRight, PageLength);
+ }
+ else
+ WriteLabelProlog(val, PageBottom, PageTop, PageWidth);
if (UseESPsp)
puts("userdict begin\n"
case 1 :
if (UseESPsp)
{
- WriteLabels();
+ WriteLabels(Orientation);
puts("ESPshowpage");
}
break;
case 2 :
if ((number & 1) == 1 && UseESPsp)
{
- WriteLabels();
+ if (Orientation & 1)
+ {
+ /*
+ * Rotate the labels back to portrait...
+ */
+
+ WriteLabels(Orientation - 1);
+ }
+ else
+ {
+ /*
+ * Rotate the labels to landscape...
+ */
+
+ WriteLabels(Orientation + 1);
+ }
+
puts("ESPshowpage");
}
break;
case 4 :
if ((number & 3) == 3 && UseESPsp)
{
- WriteLabels();
+ WriteLabels(Orientation);
puts("ESPshowpage");
}
break;
/*
- * End of "$Id: pstops.c,v 1.71 2002/01/23 17:25:38 mike Exp $".
+ * End of "$Id: pstops.c,v 1.72 2002/01/23 22:30:42 mike Exp $".
*/