]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - filter/rastertolabel.c
Merge changes from CUPS 1.3.1.
[thirdparty/cups.git] / filter / rastertolabel.c
index 0154472246a5932a2e1bcd153e4bf3d2fb494c94..dbddf812fed52659d8005c9add11f65b5b244f95 100644 (file)
@@ -1,25 +1,16 @@
 /*
- * "$Id: rastertolabel.c 6235 2007-02-05 21:03:49Z mike $"
+ * "$Id: rastertolabel.c 6820 2007-08-20 21:15:28Z mike $"
  *
  *   Label printer filter for the Common UNIX Printing System (CUPS).
  *
+ *   Copyright 2007 by Apple Inc.
  *   Copyright 2001-2007 by Easy Software Products.
  *
  *   These coded instructions, statements, and computer programs are the
- *   property of Easy Software Products and are protected by Federal
- *   copyright law.  Distribution and use rights are outlined in the file
- *   "LICENSE.txt" which should have been included with this file.  If this
- *   file is missing or damaged please contact Easy Software Products
- *   at:
- *
- *       Attn: CUPS Licensing Information
- *       Easy Software Products
- *       44141 Airport View Drive, Suite 204
- *       Hollywood, Maryland 20636 USA
- *
- *       Voice: (301) 373-9600
- *       EMail: cups-info@cups.org
- *         WWW: http://www.cups.org
+ *   property of Apple Inc. and are protected by Federal copyright
+ *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ *   which should have been included with this file.  If this file is
+ *   file is missing or damaged, see the license at "http://www.cups.org/".
  *
  *   This file is subject to the Apple OS-Developed Software exception.
  *
@@ -41,6 +32,7 @@
 
 #include <cups/cups.h>
 #include <cups/string.h>
+#include <cups/i18n.h>
 #include "raster.h"
 #include <stdlib.h>
 #include <unistd.h>
@@ -336,7 +328,7 @@ StartPage(ppd_file_t         *ppd,  /* I - PPD file */
         * Set label size...
        */
 
-        printf("q%d\n", header->cupsWidth);
+        printf("q%d\n", (header->cupsWidth + 7) & ~7);
         break;
 
     case ZEBRA_ZPL :
@@ -668,7 +660,8 @@ EndPage(ppd_file_t *ppd,            /* I - PPD file */
         * End the label and eject...
        */
 
-        puts("^XZ");
+        puts("^IDR:CUPS.GRF^FS");
+       puts("^XZ");
 
        /*
         * Free compression buffers...
@@ -1083,7 +1076,7 @@ PCLCompress(unsigned char *line,  /* I - Line to compress */
   * Set the length of the data and write it...
   */
 
-  printf("\033*b%dW", comp_ptr - CompBuffer);
+  printf("\033*b%dW", (int)(comp_ptr - CompBuffer));
   fwrite(CompBuffer, comp_ptr - CompBuffer, 1, stdout);
 
  /*
@@ -1176,7 +1169,8 @@ main(int  argc,                           /* I - Number of command-line arguments */
     * and return.
     */
 
-    fputs("ERROR: rastertolabel job-id user title copies options [file]\n", stderr);
+    fprintf(stderr, _("Usage: %s job-id user title copies options [file]\n"),
+            argv[0]);
     return (1);
   }
 
@@ -1250,7 +1244,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
       */
 
       if ((y & 15) == 0)
-        fprintf(stderr, "INFO: Printing page %d, %d%% complete...\n", Page,
+        fprintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"), Page,
                100 * y / header.cupsHeight);
 
      /*
@@ -1297,14 +1291,14 @@ main(int  argc,                         /* I - Number of command-line arguments */
   */
 
   if (Page == 0)
-    fputs("ERROR: No pages found!\n", stderr);
+    fputs(_("ERROR: No pages found!\n"), stderr);
   else
-    fputs("INFO: Ready to print.\n", stderr);
+    fputs(_("INFO: Ready to print.\n"), stderr);
 
   return (Page == 0);
 }
 
 
 /*
- * End of "$Id: rastertolabel.c 6235 2007-02-05 21:03:49Z mike $".
+ * End of "$Id: rastertolabel.c 6820 2007-08-20 21:15:28Z mike $".
  */