0

I have been trying to print USPS label in ZPLII format using Google Cloud and CakePHP. I have registered my ZP500(ZPL) Thermal printer with the cloud. I am getting base64 encoded ZPLII data from USPS which I am storing in a .txt file after base64 decoding. I am sending Content-Type in cloud as text/plain(as I do t know what type exactly to send). When I send a request to cloud print, I see a request in the printer queue and it says printing. Then after few seconds it disappers from queue without printing anything. In Google cloud it says the page printed successfully. Below is the post fields that i am sending to google print:

    $post_fields = array(               
        'printerid' => $printerid,
        'title' => $printjobtitle,
        'content' => ($contents), 
        'contentType' => $contenttype,
        'ticket' => '{"version":"1.0","print":{"dpi":{"horizontal_dpi":600,"vertical_dpi":600}, "margins": {"top_microns":1, "right_microns":1, "bottom_microns": 1, "left_microns": 1}, "vendor_ticket_item":[]}}'
    );

Can anyone tell what is that I am doing wrong here ?

Anoop Lath
  • 137
  • 1
  • 7

1 Answers1

0

try with this ticket by giving nothing in the print object this is the default option because in customizing ticket, anything goes wrong it won't print.

{
"version":"1.0",
"print":{}
}

and next, in the content type try using any one of these options, in Cloud Print API doc I see only these when I go through it.

image/pwg-raster (or)
*/* (or) 
application/pdf (or)
image/jpeg

any other content type if anybody knows, appreciatable to post in comments. Also, I tried with combo of content type like "image/pwg-raster,application/pdf" it got printed for me.

SaravanaRaja
  • 3,228
  • 2
  • 21
  • 29