0

我正在使用 FedEx 运输网络服务。SOAP 响应包含一个用于生成运输标签的打印机缓冲区文件。是否可以将其直接发送到打印机,以便文件永远不会存储在本地?换句话说,“打印运输标签”按钮将发出 SOAP 请求,成功响应的结果将是打印机根据 SOAP 响应中的数据打印标签。

我正在使用 PHP,如果有帮助的话。

4

2 回答 2

0

Rather than returning a HTML response to the ship button, return the thermal data with a MIME type of application/epl2 and if you have the ActiveX control from UPS installed, the data will be spooled to your printer.

If you need to update the UI after shipping then you'll need to store the data somehow (disk, session variable, etc.) and perhaps update the UI but then do a http redirect to the binary data so it prints.

于 2011-06-22T22:35:11.170 回答
0

Is it possible to send this directly to the printer so that the file is never stored locally?

I'm not sure this is possible with PHP. Printing works in very different ways based on the operating system of the server.

Your best bet is writing the data you need to a file and instructing the system's printing service to print that file, then clean up the file a few minutes later.

If your printer speaks IPP, then this class might be some help, though the instructions seem to indicate that it also needs a file on disk to actually perform printing.

于 2011-03-26T18:14:41.317 回答