EPLPrinter Web API for Docker allows you to Convert, Preview and Render raw EPL (Zebra/Eltron Programming Language) commands to well known image and document formats like PNG, JPG, PDF, PCX, Zebra GRF ASCII hex, Zebra EPL Binary Graphic, Honeywell-Intermec FingerPrint Binary Graphic, HP PCL Binary Graphic & EPSON ESC/POS NV Binary Graphic from Any Development Platform and Programming Languages (.NET, Java, PHP, Javascript, Python, Ruby, and more!)
Designed by following some of the REST principles, EPLPrinter Web API for Docker responds to a simple HTTP POST by specifying the EPL commands and printer settings through a JSON object in the request body, returning the output rendering in the image or document format specified through the Accept header.
EPLPrinter Web API for Docker is available at Docker Hub registry.
To pull/download the Docker image, please type the following from a Terminal:
AMDTo run the Docker image, please type the following from a Terminal:
AMDBy default, our Docker image exposes ports 80
and 443
only. If you want to expose and use another different port, then do the following.
12345
. Create a new Dockerfile and edit it by pasting the following content:
FROM neodynamic/eplprinterwebapi:3.0.3
EXPOSE 12345
The following source code invokes the EPLPrinter Web API for Docker to generate a PNG image for the specified EPL Commands. For more advanced settings please refer to the EPLPrintJob JSON Object
curl -X POST "http://localhost:8080/EPLPrinter" \
-H "Accept: image/png" \
-H "Content-Type: application/json" \
-d "{\"eplCommands\":\"N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1\"}" \
--output label.png
$data = array(
'eplCommands' => 'N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1'
);
$options = array(
'http' => array(
'method' => 'POST',
'content' => json_encode( $data ),
'header' => "Content-Type: application/json\r\n" .
"Accept: image/png\r\n"
)
);
$context = stream_context_create( $options );
$url = 'http://localhost:8080/EPLPrinter';
$response = file_get_contents( $url, false, $context );
file_put_contents('label.png', $response);
require 'net/http'
require 'uri'
require 'json'
uri = URI.parse("http://localhost:8080/EPLPrinter")
header = {'Accept':'image/png', 'Content-Type': 'application/json'}
data = {eplCommands: 'N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1'}
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri, header)
request.body = data.to_json
response = http.request(request)
open('/tmp/label.png', 'wb' ) { |file|
file.write(response.body)
}
import requests
import json
url = "http://localhost:8080/EPLPrinter"
jsondata = json.dumps( {"eplCommands": "N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1"} )
headers = {
'content-type': "application/json",
'accept': "image/png"
}
response = requests.request("POST", url, data=jsondata, headers=headers)
if response.status_code == 200:
with open("label.png", 'wb') as f:
f.write(response.content)
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
my $server_endpoint = "http://localhost:8080/EPLPrinter";
my $req = HTTP::Request->new(POST => $server_endpoint);
$req->header('content-type' => 'application/json');
$req->header('accept' => 'image/png');
my $post_data = '{ "eplCommands" : "' + 'N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1' + '" }';
$req->content($post_data);
my $resp = $ua->request($req);
open FILEHANDLE, ">label.png";
print FILEHANDLE $resp->{_content};
close FILEHANDLE;
CloseableHttpClient client = HttpClients.createDefault();
HttpPost httpPost = new HttpPost("http://localhost:8080/EPLPrinter");
String json = "{\"eplCommands\" : \"" + "N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1" + "\"}";
StringEntity entity = new StringEntity(json);
httpPost.setEntity(entity);
httpPost.setHeader("Accept", "image/png");
httpPost.setHeader("Content-type", "application/json");
CloseableHttpResponse response = client.execute(httpPost);
HttpEntity entity = response.getEntity();
if (entity != null) {
try (FileOutputStream outstream = new FileOutputStream(new File("label.png"))) {
entity.writeTo(outstream);
}
}
client.close();
string DATA = "{\"eplCommands\" : \"" + "N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1" + "\"}";
var request = (HttpWebRequest)WebRequest.Create("http://localhost:8080/EPLPrinter");
request.Method = "POST";
request.ContentType = "application/json";
request.ContentLength = DATA.Length;
request.Accept = "image/png";
using (var requestWriter = new StreamWriter(request.GetRequestStream(), System.Text.Encoding.ASCII)){
requestWriter.Write(DATA);
}
var webResponse = request.GetResponse();
using (var stream = webResponse.GetResponseStream())
using (var fileStream = File.OpenWrite("label.png"))
{
var bytes = new byte[4096];
var read=0;
do
{
if (stream == null) {continue;}
read = stream.Read(bytes, 0, bytes.Length);
fileStream.Write(bytes, 0, read);
} while (read != 0);
}
var data = JSON.stringify({
"eplCommands": "N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1"
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "http://localhost:8080/EPLPrinter");
xhr.setRequestHeader("content-type", "application/json");
xhr.setRequestHeader("accept", "image/png");
xhr.send(data);
var request = require('request');
var headers = {
'Accept': 'image/png',
'Content-Type': 'application/json'
}
var options = {
url: 'http://localhost:8080/EPLPrinter',
method: 'POST',
headers: headers,
json: {"eplCommands": "N\r\nq609\r\nQ203,26\r\nB26,26,0,UA0,2,2,152,B,\"603679025109\"\r\nA253,26,0,3,1,1,N,\"SKU 6205518 MFG 6354\"\r\nA253,56,0,3,1,1,N,\"2XIST TROPICAL BEACH\"\r\nA253,86,0,3,1,1,N,\"STRIPE SQUARE CUT TRUNK\"\r\nA253,116,0,3,1,1,N,\"BRICK\"\r\nA253,146,0,3,1,1,N,\"X-LARGE\"\r\nP1"}
}
request(options, function (error, response, body) {
if (!error && response.statusCode == 200) {
console.log(body);
}
})
The desired output rendering format must be specified through the Accept header. The supported formats are the following:
Accept | Description |
---|---|
image/png |
Returns the first rendered label in PNG format. If the specified commands generate more than one label, then you should specify image/png+json or image/png+zip values instead. |
image/jpeg |
Returns the first rendered label in JPEG/JPG format. If the specified commands generate more than one label, then you should specify image/jpeg+json or image/jpeg+zip values instead. |
application/pdf |
Returns all the rendered labels as a single PDF document. The PDF file will contain as many pages as rendered labels. |
image/vnd.zbrush.pcx |
Returns the first rendered label in PCX format. If the specified commands generate more than one label, then you should specify image/vnd.zbrush.pcx+json or image/vnd.zbrush.pcx+zip values instead. |
application/vnd.zpl |
Returns the first rendered label in Zebra GRF ASCII Hex format. If the specified commands generate more than one label, then you should specify application/vnd.zpl+json or application/vnd.zpl+zip values instead. |
application/vnd.epl |
Returns the first rendered label in Zebra EPL Binary Graphic format. If the specified commands generate more than one label, then you should specify application/vnd.zpl+json or application/vnd.zpl+zip values instead. |
application/vnd.fingerprint |
Returns the first rendered label in Honeywell-Intermec FingerPrint Binary format. If the specified commands generate more than one label, then you should specify application/vnd.fingerprint+json or application/vnd.fingerprint+zip values instead. |
application/vnd.escpos |
Returns the first rendered label in EPSON ESC/POS NV Binary format. If the specified commands generate more than one label, then you should specify application/vnd.escpos+json or application/vnd.escpos+zip values instead. |
application/vnd.hp-pcl |
Returns the first rendered label in HP PCL Binary format. If the specified commands generate more than one label, then you should specify application/vnd.hp-pcl+json or application/vnd.hp-pcl+zip values instead. |
image/png+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 PNG Data URI scheme. The returned JSON Object will have this structure: {labels:["data:image/png;base64,<BASE64-STRING>", "data:image/png;base64,<BASE64-STRING>", ... ]} |
image/jpeg+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 JPEG Data URI scheme. The returned JSON Object will have this structure: {labels:["data:image/jpeg;base64,<BASE64-STRING>", "data:image/jpeg;base64,<BASE64-STRING>", ... ]} |
application/pdf+json |
Returns all the rendered labels as a JSON Array containing a single PDF in Base64 Data URI scheme. The PDF file will contain as many pages as rendered labels. The returned JSON Object will have this structure: {labels:["data:application/pdf;base64,<BASE64-STRING>"]} |
image/vnd.zbrush.pcx+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 PCX Data URI scheme. {labels:["data:image/vnd.zbrush.pcx;base64,<BASE64-STRING>", "data:image/vnd.zbrush.pcx;base64,<BASE64-STRING>", ... ]} |
application/vnd.zpl+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 Zebra GRF ASCII Hex Data URI scheme. The returned JSON Object will have this structure: {labels:["data:application/vnd.zpl;base64,<BASE64-STRING>", "data:application/vnd.zpl;base64,<BASE64-STRING>", ... ]} |
application/vnd.epl+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 Zebra EPL Binary Graphic Data URI scheme. The returned JSON Object will have this structure: {labels:["data:application/vnd.epl;base64,<BASE64-STRING>", "data:application/vnd.epl;base64,<BASE64-STRING>", ... ]} |
application/vnd.fingerprint+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 Honeywell-Intermec FingerPrint Binary Data URI scheme. The returned JSON Object will have this structure: {labels:["data:application/vnd.fingerprint;base64,<BASE64-STRING>", "data:application/vnd.fingerprint;base64,<BASE64-STRING>", ... ]} |
application/vnd.escpos+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 EPSON ESC/POS NV Binary Data URI scheme. The returned JSON Object will have this structure: {labels:["data:application/vnd.escpos;base64,<BASE64-STRING>", "data:application/vnd.escpos;base64,<BASE64-STRING>", ... ]} |
application/vnd.hp-pcl+json |
Returns all the rendered labels as a JSON Array containing each label in Base64 HP PCL Binary Data URI scheme. The returned JSON Object will have this structure: {labels:["data:application/vnd.hp-pcl;base64,<BASE64-STRING>", "data:application/vnd.hp-pcl;base64,<BASE64-STRING>", ... ]} |
image/png+zip |
Returns all the rendered labels as a ZIP file containing each label in PNG format. Each file name is named to Label_01.png, Label_02.png, etc. |
image/jpeg+zip |
Returns all the rendered labels as a ZIP file containing each label in JPEG/JPG format. Each file name is named to Label_01.jpg, Label_02.jpg, etc. |
application/pdf+zip |
Returns all the rendered labels as a ZIP file containing a single PDF. The PDF file will contain as many pages as rendered labels. Label_01.pdf |
image/vnd.zbrush.pcx+zip |
Returns all the rendered labels as a ZIP file containing each label in PCX format. Each file name is named to Label_01.pcx, Label_02.pcx, etc. |
application/vnd.zpl+zip |
Returns all the rendered labels as a ZIP file containing each label in Zebra GRF ASCII Hex format. Each file name is named to Label_01.grf, Label_02.grf, etc. |
application/vnd.epl+zip |
Returns all the rendered labels as a ZIP file containing each label in Zebra EPL Binary Graphic format. Each file name is named to Label_01.epl, Label_02.epl, etc. |
application/vnd.fingerprint+zip |
Returns all the rendered labels as a ZIP file containing each label in Honeywell-Intermec FingerPrint Binary format. Each file name is named to Label_01.fp, Label_02.fp, etc. |
application/vnd.escpos+zip |
Returns all the rendered labels as a ZIP file containing each label in EPSON ESC/POS NV Binary format. Each file name is named to Label_01.nv, Label_02.nv, etc. |
application/vnd.hp-pcl+zip |
Returns all the rendered labels as a ZIP file containing each label in HP PCL Binary format. Each file name is named to Label_01.pcl, Label_02.pcl, etc. |
EPLPrinter Web API rendering engine supports most of the EPL formatting and control commands. The following table lists the supported commands. Not listed or unsupported commands will be skipped in the parsing stage.
Status | EPL Command | Notes |
---|---|---|
A - ASCII Text | Latin resident fonts 1, 2, 3, 4, 5, 6, and 7 | |
B - Linear Bar Code | Code 39, Code 93, Code 128, UCC Serial Shipping Container, Codabar, EAN 8-13, German Post Code, Interleaved 2 of 5, Postnet, Planet, UCC/EAN 128, UPC A-E, Plessey, MSI | |
b - 2D Bar Code | Aztec, Data Matrix, MaxiCode, PDF417, and QR Code | |
C - Counter | ||
FE - End Form Store | ||
FK - Delete Form | ||
FR - Retrieve Form | ||
FS - Store Form | ||
GG - Print Graphics | ||
GK - Delete Graphics | ||
GM - Store Graphics | ||
GW - Direct Graphic Write | ||
LE - Line Draw Exclusive OR | ||
LO - Line Draw Black | ||
LS - Line Draw Diagonal | ||
LW - Line Draw White | ||
N - Clear Image Buffer | ||
P - Print | ||
q - Set Label Width | ||
Q - Set Form Length | ||
R - Set Reference Point | ||
TD - Date Recall & Format Layout | ||
TS - Set Real Time Clock | ||
TT - Time Recall & Format Layout | ||
V - Define Variable | ||
X - Box Draw | ||
Z - Print Direction | ||
^@ - Reset Printer | ||
? - Download Variables |
EPLPrinter Web API is licensed for Private On-Premise environments giving you full control on the infrastructure where our product will run on. Please refer to Licensing model and prices...
When you buy a commercial license of EPLPrinter Web API for Docker, you are provided with license information (LicenseOwner & LicenseKey) to register the product. The license information must be specified to the Docker image as environment variables as folows:
AMDThe Trial Version of EPLPrinter Web API for Docker is fully functional and has no expiry date. However, while in TRIAL mode, the output rendering has the following limitations:
2024-10-10
2024-06-03
2024-04-24
2023-12-06
2023-03-16
2022-06-30
2022-06-24
2022-06-11
2022-05-04
2022-03-16