从UPS收到奇怪的ZPL代码(如何解码此ZPL代码?)

时间:2018-10-31 17:12:06

标签: api label zpl ups zebra

我使用UPS API发送“ ShipRequest”,并且我知道我们可以接收标签图像作为UPS的响应。

但是当我要求图像格式为'ZPL'时,它不是ZPL语言,而是未知语言,如下所示:

Cl5YQV5MUk5eTU5ZXk1GTixOXkxIMTAsMTJeTUNZXlBPSV5QVzgxMl5DSTI3CgpeRk82MjAsMTE0MApeR0ZBLDAwOTY5LDAwOTY5LDAxOSxGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjAwMDAwMDAwMApGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjAwMDAwMDAwMApGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjAwMDAwMDAwMApGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRjAwMDAwMDAwMApGMDAwMDAwMDAwMDAwMUY4MDAwMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwMDAwMUY4MDAwMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwM0Y4MUY4M0ZDMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwM0Y4MUY4M0ZDMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRkZGOUY5RkZGMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRkZGOUY5RkZGMDAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRkZGRkZGRkZGQzAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRkZGRkZGRkZGQzAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRjA3RkZGRjBGQzAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRjA3RkZGRjBGQzAwMDAwMDAwRjAwMDAwMDAwMApGMDAwMDAwMDAwRkMxRkZGQzNGMDAwMDAwMDAwRjAwMDAwMDAwMAp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Glvbl5GUwpeRlQxNSwxNTNeQTBOLDI4LDMyXkZWU0hJUCBUTzogXkZTCl5GTzAsNjM3XkdCNzk4LDE0LDE0XkZTCgpeRk8wLDk5N15HQjgwMCwxNCwxNF5GUwoKXkZPMCw0MTZeR0I4MDAsNCw0XkZTCgpeRk8yNDAsNDE2XkdCMywyMjEsM15GUwoKXkZUMTkwLDExODheQTBOLDE0LDIwXkZWWE9MIDE4LjA5LjA5ICAgICAgICAgIE5WNDUgMDYuMEEgMTAvMjAxOF5GUwpeRlQxMDUsOTgyXkJZM15CQ04sMjAyLE4sTiwsQV5GVjFaUlcwMTc1MDM5OTkwNTMyOV5GUwoKXkZUMjczLDg5Nl5BME4sOTUsNzReRlZTQU1QTEVeRlMKXlhaXlhaCg ==

ZPL语言应如下所示: ^ XA ^ FO40,40 ^ GB300,203,8 ^ FS ... ...

那么,UPS的语言响应是什么?如何将这种未知语言解码为ZPL语言?

谢谢大家!

2 个答案:

答案 0 :(得分:0)

在大多数情况下,运营商网络服务会返回以base 64编码的ZPL代码。只需对其进行解码,您将获得UPS生成的实际ZPL代码。 (尝试使用https://www.base64decode.org/

它看起来像这样:https://imgur.com/a/Ev5cTgE

答案 1 :(得分:0)

将上述代码复制并粘贴到“base64decode”网址中。您将获得 ZPL 格式的标签字符串。

从 Base64 格式解码 https://www.base64decode.org/

然后复制字符串并粘贴到“labelary”网址中。重新绘制图像,您将看到示例标签打印。

http://labelary.com/viewer.html

上面提到的是手工作业。您可以使用 API 执行此操作。只需解码代码中的字符串并将 ZPL 字符串发送到以下 API。您将获得标签图像并将其发送到热敏打印机。先在邮递员那里查一下。

http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/

以下是执行以下操作后收到的示例图像:

  1. 解码字符串
  2. 将 zpl 字符串粘贴到“labelary”网址上。

enter image description here