獲取標籤以正確的格式
聯邦快遞UPS & API提供的選項來獲得熱敏標籤特定類型。你會在鍵盤上打敗你的頭,試圖讓PDF在熱敏打印機上正確打印。
一些常見的散熱類型EPL/EPL2,ZPL/ZPLII。大多數熱敏打印機將接受符合這些類型之一的文檔。
對於聯邦快遞公司在您的ShipRequest中這樣的事情 - 這是使用FedEx WSDL進行裝運。
RequestedShipment.LabelSpecification.ImageType = FedExShipService.LabelSpecificationImageType.ZPLII
和UPS - 建立XML以發佈到UPS服務。
<LabelSpecification>
<LabelPrintMethod>
EPL2
</LabelPrintMethod>
</LabelSpecification>
打印標籤
您需要將基本發送「原始」數據到打印機。我從這篇文章開始,並將其採納到我的解決方案中。例如,FedEx返回一個包含標籤信息的字節數組 - 我將其轉換爲一個字符串,然後發送給打印機。
'Convert from Byte Array to String
Dim enc As System.Text.ASCIIEncoding = New System.Text.ASCIIEncoding()
Dim strConverter As String = enc.GetString(<ByteArrayFromFedEx>)
http://www.paulaspinall.com/post/2008/05/31/Sending-data-direct-to-a-printer.aspx
也有對SO另一個線程這個話題。
Sending raw data to FedEx Label printer
你想PHP打印到掛接到服務器的打印機,或者提供一個PDF給客戶打印? – Seth 2010-01-06 18:18:23
只要我可以通過熱敏打印機打印UPS或Fedex運輸標籤,*不使用UPS Worldship或ShipRush或某些其他第三方裝運應用程序,我並不十分關心這種或那種方式。 – 2010-01-06 18:25:52