smalot / cups-ipp

CUPS Implementation of IPP - PHP Client API
GNU General Public License v2.0
107 stars 56 forks source link

Cannot send as raw #8

Open cbichis opened 6 years ago

cbichis commented 6 years ago

Hi,

For some printers is needed to send the file as raw. By example from terminal I send using this:

lpr -P Zebra-Technologies-ZTC-TLP-2824-Plus -o raw path/to/label.zpl

Which works perfectly, printing the label.

However, trying to send using raw doesnt seems to work with smalot/cups-ipp.

I have created a custom version of config yaml files adding to job.yaml this line:

raw:
    tag: 'no-value'

This is needed to get over this: PHP Fatal error: Uncaught Smalot\Cups\CupsException: Property not found: "raw" .....

After this the Builder was created with the new option set:

$builder = new Builder('./config/cups-ipp/');
$builder->buildProperty('raw', 'no-value');//not sure if actually needed

and the job attribute was set: $job->addAttribute('raw', null);

However, even after fixing this the (print) output of this is text, the ZPL commands from the submitted file.

olibar commented 5 years ago

@cbichis
Hello did you manage to solve this ? I need to do the same as you

cbichis commented 5 years ago

Sending the ZPL using sockets will work, no need of command line and cups.

olibar commented 5 years ago

thanks so you are not using this code in the end

fireatwill commented 4 years ago

Setting the mime type to application/vnd.cups-raw seems to work for me.

e.g.:

$job = new Job();
$job->addText('^XA...^XZ', '', 'application/vnd.cups-raw');