我一直在尝试使用 Google Cloud 和 CakePHP 以 ZPLII 格式打印 USPS 标签。我已经在云端注册了我的 ZP500(ZPL) 热敏打印机。我从 USPS 获取 base64 编码的 ZPLII 数据,我在 base64 解码后将其存储在 .txt 文件中。我将云中的 Content-Type 作为文本/纯文本发送(因为我不知道要发送什么类型)。当我向云打印发送请求时,我在打印机队列中看到一个请求,上面写着正在打印。然后几秒钟后它从队列中消失而不打印任何东西。在谷歌云中,它说页面打印成功。以下是我发送到谷歌打印的帖子字段:
$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":[]}}'
);
谁能告诉我在这里做错了什么?