/*
- * "$Id: rastertohp.c 7834 2008-08-04 21:02:09Z mike $"
+ * "$Id: rastertohp.c 10996 2013-05-29 11:51:34Z msweet $"
*
* Hewlett-Packard Page Control Language filter for CUPS.
*
- * Copyright 2007-2010 by Apple Inc.
+ * Copyright 2007-2012 by Apple Inc.
* Copyright 1993-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
* and return.
*/
- _cupsLangPrintf(stderr,
- _("Usage: %s job-id user title copies options [file]\n"),
- "rastertohp");
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("%s job-id user title copies options [file]"),
+ "rastertohp");
return (1);
}
{
if ((fd = open(argv[6], O_RDONLY)) == -1)
{
- _cupsLangPrintf(stderr, _("ERROR: Unable to open raster file - %s\n"),
- strerror(errno));
+ _cupsLangPrintError("ERROR", _("Unable to open raster file"));
sleep(1);
return (1);
}
ppd_status_t status; /* PPD error */
int linenum; /* Line number */
- _cupsLangPrintf(stderr, _("ERROR: The PPD file could not be opened.\n"));
+ _cupsLangPrintFilter(stderr, "ERROR",
+ _("The PPD file could not be opened."));
status = ppdLastError(&linenum);
Page ++;
fprintf(stderr, "PAGE: %d %d\n", Page, header.NumCopies);
+ _cupsLangPrintFilter(stderr, "INFO", _("Starting page %d."), Page);
/*
* Start the page...
break;
if ((y & 127) == 0)
- _cupsLangPrintf(stderr, _("INFO: Printing page %d, %d%% complete...\n"),
- Page, 100 * y / header.cupsHeight);
+ {
+ _cupsLangPrintFilter(stderr, "INFO",
+ _("Printing page %d, %d%% complete."),
+ Page, 100 * y / header.cupsHeight);
+ fprintf(stderr, "ATTR: job-media-progress=%d\n",
+ 100 * y / header.cupsHeight);
+ }
/*
* Read a line of graphics...
* Eject the page...
*/
+ _cupsLangPrintFilter(stderr, "INFO", _("Finished page %d."), Page);
+
EndPage();
if (Canceled)
if (Page == 0)
{
- _cupsLangPuts(stderr, _("ERROR: No pages were found.\n"));
+ _cupsLangPrintFilter(stderr, "ERROR", _("No pages were found."));
return (1);
}
else
- {
- _cupsLangPuts(stderr, _("INFO: Ready to print.\n"));
return (0);
- }
}
/*
- * End of "$Id: rastertohp.c 7834 2008-08-04 21:02:09Z mike $".
+ * End of "$Id: rastertohp.c 10996 2013-05-29 11:51:34Z msweet $".
*/