[cups] doubts about cutter option

Osvaldo Parra bady.sir at gmail.com
Mon Jan 23 10:51:52 PST 2017


thx for your reply michael,

commandtokc.c, textokc.c and rastertokc.c has a line like this;

void
EndPage(int argc, char *argv[])
{
  char cmd_cutmedia[] = { 0x1d, 0x56, 0x42, 0x00};
  const char *noCutMedia = "noCutMedia";
  const char *CutMedia = "CutMedia";

  if ( (strstr(argv[5], CutMedia) != NULL) &&
       (strstr(argv[5], noCutMedia) == NULL) )
  {
    debug("CutMedia Support!\n");
    pwrite(cmd_cutmedia, 4);
  }

  if (Canceled)
    fprintf(stderr, "INFO: Printing Canceled!\n");
}


ppd file contains (in other thinks):
-----------------------------------
*cupsFilter: "application/vnd.cups-raster 100 rastertokc"
*cupsFilter: "application/vnd.cups-banner 100 texttokc"
-------------

how i use "endpage" function ?



2017-01-23 15:44 GMT-03:00 Michael Sweet <msweet at apple.com>:

> Osvaldo,
>
> > On Jan 23, 2017, at 1:36 PM, Osvaldo Parra <bady.sir at gmail.com> wrote:
> >
> > hi guys, I bought a chinese 58mm kiosk thermal printer on aliexpress, 0
> > support and 0 documentation, after a few days of google I found some
> > generic(or not?) drivers what worked with printer, the printer has auto
> > cutter but it never triggers, only on self test page it does.
> >
> > drivers contain a ppd file with out "cutter" parameter, I read in here
> > <https://www.cups.org/doc/ref-ppdcfile.html#Cutter>about that parameter
> so
> > I add in ppd file the line:
> >
> > *Cutter Yes/True (both tested)
> >
> >
> > but the printer doesnt cut
> >
> > any clue?, this "cutter" parameter sends some kind of esc/pos code?,
> where
> > can i see the "source code" of this parameter?
>
>
> The driver needs to support the option and send the appropriate command to
> the printer.
>
> (some printers have an out-of-band setting to enable the cutter at the end
> of each page/job, without the ability to actually control it from the
> driver...)
>
> _________________________________________________________
> Michael Sweet, Senior Printing System Engineer
>
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://lists.cups.org/mailman/listinfo/cups
>



More information about the cups mailing list