How to print EPL2 data recieved form Endicia Label Server and send it to ZP500 Thermal Printer via GCP ?

847 views
Skip to first unread message

Anoop Lath

unread,
Aug 20, 2015, 8:53:08 AM8/20/15
to Google Cloud Print Developers
Hi All,

I have been trying to print EPL2 data file via cloud but with no luck. I have the label string from USPS in EPL2 format saved in a .txt file. Same file is attached here with the name "173epl.txt". I am sending this data to printer with following parameters:
Content Type: text/plain
No encoding

When i hit the print request from my PHP application, a request is sent via Cloud and a request is added in the Printer queue. In the queue it shows printing 22 pages while I sent only one label data. Also the printer prints only squares in all those 22 pages. I have attached the screenshot of the printout.

Any idea about what could be wrong here ?

173epl.txt
^D57935A9D72CF9051E64F3613F4E2380C2E6E2A0C482398244^pimgpsh_fullsize_distr.jpg

KJS

unread,
Aug 20, 2015, 9:46:54 AM8/20/15
to gcp-dev...@googlegroups.com
Near the bottom of page 143 of this document it says:

Treat all data contained in the EPL2 or ZPLII label image as binary bytes
The label image contains text and binary data values. All data must be treated as binary. Therefore,
whether sending the label image data directly to the printer or saving it to intermediate storage for
later retrieval, there should be no conversion performed to ANSI, ASCII or any other format.

Anoop Lath

unread,
Aug 20, 2015, 9:56:48 AM8/20/15
to Google Cloud Print Developers
I have read it before. I have not changed the data except for base64 decoding it before saving it to txt file as Endicia sends the data after base64 encoding.
Message has been deleted

KJS

unread,
Aug 21, 2015, 3:06:32 AM8/21/15
to gcp-dev...@googlegroups.com
I'm still not sure why you think this is a Google Cloud Print issue, but for what it is worth (and since I am no expert it is probably not a lot) here a few of my thoughts:
Endicia sent you a base64 encoded EPL2 file and you decoded it.
According to Wikipedia,
Base64 encoding is used to represent binary data in an ASCII string format
so by applying simple logic, Base64 decoding should* retrieve the original binary data.
(*The wikipedia article warns that unless done properly, decoding may fail to retrieve the binary data to its original form)
My conclusions:
Base64 decoding the base64 EPL2 file should retrieve original EPL2 binary data not ASCII string format data
...and yet you say you base64 decoded it "before saving it to txt file"
...and you also say that you also
sent "this data to printer with following parameters: Content Type: text/plain".
Isn't text/plain the wrong data type? Wouldn't a binary data Content Type such as "application/octet-stream" be more appropriate?

Anoop Lath

unread,
Aug 21, 2015, 7:58:51 AM8/21/15
to Google Cloud Print Developers
 I tried using "application/octet-stream" but it results in error "Error code:403 Message:Could not convert to PDF." This is the error I receive after a submit request is sent to GCP

KJS

unread,
Aug 21, 2015, 10:05:37 AM8/21/15
to Google Cloud Print Developers
I guess I took the advice about treating EPL data as binary too far. Furthermore re-examination of your "173epl.txt" attachment iembarrassing because the content is clearly interpretable. Consequently it looks as if Content Types "plain/text" and "application/octet-stream" are both unsuitable. Unless someone better informed can help, I suggest that you contact Endicia for advice about the Content Type. I've certainly run out of ideas. 

Somasundaram Meiyappan

unread,
Aug 21, 2015, 12:50:00 PM8/21/15
to gcp-dev...@googlegroups.com
Hello Anoop,

Not sure if this would resolve your problem; but you may want to read through to see if it helps.

You might have known some of these information on how GCP operates; but, just in case . . .
GCP as a service tries to convert the incoming job into a format that the printer (not the ZP500 printer; but the software that connects it to GCP - I’ll refer this agent [which may be embedded in the printer or just a software on the PC that the printer is connected to] as ‘printer') can understand. For example, if you send a TXT file (identified by the Content-Type when you submit the job) and the printer understands only a PDF file, GCP service will try to convert the TXT file into a PDF file and send it to the printer. Likewise, if you submit an EPL2 file (and mark it as TXT file (MIME type is ‘text/plain’) in the Content-Type), GCP service will convert that into a PDF and send it to the printer. Of course, if you convert the EPL2 file into a PDF file and send it to the GCP service, it would pass on the PDF file to your printer (i.e., the software 

If the mime type for EPL2 files is “application/epl2”, then you can try setting the Content-Type of the EPL2 job that you are submitting as “application/epl2”. If your printer supports only PDF, then GCP service will try to convert “application/epl2” file into a PDF file (but only if GCP Service knows how to read and convert the EPL2 file into PDF and I am not sure that it knows to read an EPL2 file). If GCP service does not know how to read an EPL2 file, it will report an error to the submitter. However, if the printer informs GCP service that it can accept a file of type “application/epl2”, then GCP service is supposed to forward that EPL2 file to the printer untouched.

But, which content-type the printer reports to GCP service as something that it supports depends upon how the Thermal Printer is connected to GCP - which software (or agent embedded within your printer), what it advertises to GCP service as a supported format, etc….?
Do you know how the ZP500 Thermal Printer connecting to GCP server? Through Chrome Connector or any other way?

Regards,
Somasundaram.



--
You received this message because you are subscribed to the Google Groups "Google Cloud Print Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gcp-developer...@googlegroups.com.
Visit this group at http://groups.google.com/group/gcp-developers.
To view this discussion on the web visit https://groups.google.com/d/msgid/gcp-developers/02f02348-26de-41bf-a68e-b1c24de427f9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<173epl.txt><^D57935A9D72CF9051E64F3613F4E2380C2E6E2A0C482398244^pimgpsh_fullsize_distr.jpg>

Paolo Ferraris

unread,
Aug 21, 2015, 7:57:49 PM8/21/15
to gcp-developers
Soma's comment is correct. Cloud print doesn't support epl2, but it can pass documents as they are if the printer (or whatever software/hardware acts as a proxy for it) says that it supports the format. 

Anoop Lath

unread,
Aug 22, 2015, 5:14:06 AM8/22/15
to Google Cloud Print Developers
Thank you Soma and Paolo. I am using Chrome Connector to interact with the printer. I have no idea about what content-type the Printer reports to the Chrome connector. Do you know any way about how could I know this ? How can I change the content-type advertised by the printer so that if i pass "application/epl2" to GCP then while sending request to printer no conversion is done, as you said should happen.

Richard

unread,
Aug 22, 2015, 12:12:09 PM8/22/15
to Google Cloud Print Developers
Anoop,
What type of system (OS) is the printer connected to? If that system is Windows, our product Cloud Print for Windows can handle octet-stream.

Anoop Lath

unread,
Aug 23, 2015, 3:31:46 AM8/23/15
to Google Cloud Print Developers
Richard,

It is connected to Windows

Richard Corn

unread,
Aug 24, 2015, 7:16:14 PM8/24/15
to gcp-dev...@googlegroups.com
Anoop,
You can install our product Cloud Print for Windows on the Windows system hosting the printer. You then register the printer with GCP through our product not Chrome browser. In fact, you should turn off Chrome's handling of Windows printers to prevent confusion on what agent is handling the Windows printers.
 
Once our connector has register the printer with GCP, if you submit a print job to that GCP printer with content-type=application/octet-stream, the data will not be converted by GCP but downloaded as octet-stream to our connector which will then print it on the printer in RAW format. This means the data will be sent to the printer unaltered.
 
This scheme works for Zebra label printers so I am hopeful it will work with your label printer.

Richard Corn
Software Devices LLC / RAC Consulting / PTP Security
P.O. Box 12299
Olympia, WA. 98508
360.357.9572   fax 360.352.8453
r...@swdevs.com     www.swdevs.com    www.ptpsecurity.com
--
You received this message because you are subscribed to a topic in the Google Groups "Google Cloud Print Developers" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gcp-developers/HR4y4nCSesQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gcp-developer...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages