[cups] doubts about cutter option

hw hw at gc-24.de
Tue Jan 24 03:22:41 PST 2017


Osvaldo Parra schrieb:
> sorry, I dont understand for complet,  I understand CutMedia should be an
> option to choose for cut paper, but i dont understand how to add "CutMedia"
> in print options, you mean on cups manager page?, or directly on ppd file,
> like: *CutMedia 0x1d, 0x56, 0x42, 0x00 (1 of those 4)?

lpr -Pbar -o CutMedia=foo file.pdf

"foo" being what is understood in the ppd file, same for "CutMedia"
(like "SaCutMedia" for Sato label printers)

Set the default print options via the manager page and leave the ppd file
untouched other than to look up what options are available.

>
> cheers
>
> 2017-01-23 16:05 GMT-03:00 Michael Sweet <msweet at apple.com>:
>
>> Osvaldo,
>>
>> Well, it looks like the driver is doing things completely wrong...  From
>> its implementation, you need to include "CutMedia" in the print options, as
>> the default in the PPD will be ignored...
>>
>> (a proper driver should be setting the CutMedia field in the page device
>> dictionary and then looking at the value in the page header structure,
>> which is what the sample label driver does in CUPS...)
>>
>>
>>> On Jan 23, 2017, at 1:51 PM, Osvaldo Parra <bady.sir at gmail.com> wrote:
>>>
>>> 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
>>>>
>>> _______________________________________________
>>> cups mailing list
>>> cups at cups.org
>>> https://lists.cups.org/mailman/listinfo/cups
>>
>> _________________________________________________________
>> Michael Sweet, Senior Printing System Engineer
>>
>> _______________________________________________
>> cups mailing list
>> cups at cups.org
>> https://lists.cups.org/mailman/listinfo/cups
>>
> _______________________________________________
> cups mailing list
> cups at cups.org
> https://lists.cups.org/mailman/listinfo/cups
>




More information about the cups mailing list