BarcodePro Web API for Docker

REST API to Generate High-Quality GS1-ISO-Compliance Barcodes


Key Features

  Linear, Postal & 2D Barcode Symbologies
  REST API running Linux Docker container
  High Quality PNG, JPEG, SVG, EPS, PDF & more!
  GS1, ISO/IEC & AIM Spec Compliance

  Download   Buy

Advanced Barcode Generator for Docker

BarcodePro Web API for Docker generates barcode images that can be used from Any Development Platform and Programming Languages (.NET, Java, PHP, Javascript, Python, Ruby, and more!). After specifying a Value to encode, choosing a Barcode Symbology, and setting some simple properties, BarcodePro Web API will generate the barcode symbol in the specified image or document format like JPEG/JPG, PNG, PCX, SVG, EPS, and PDF!

Postman Samples for MaxiCode, QR Code, Code-128 & PDF417

MaxiCode Barcode
QR Code Barcode
Code-128 Barcode
PDF417 Barcode

Features at a Glance

   Linear (1D), Postal, Stacked & 2D Barcodes

BarcodePro Web API for Docker supports most popular Linear (1D), Postal, Component Composite & 2D Barcode Symbologies all-in-one solution including Code 39, Code 128, GS1-128, GS1 DataBar (RSS-14), EAN 13 & UPC, Postal (USPS, British Royal Mail, Australia Post, DHL, FedEx, Japan), Data Matrix (DMRE), QR Code, PDF 417, Aztec Code, UPS MaxiCode, Chinese Han Xin Code, IFA PPN, all EAN/UPC Composite Barcodes (CC-A, CC-B & CC-C), Mailmark, DotCode, Swiss-QRCode, JAB-Code Multicolored 2D Matrix and many more barcode standards

GS1-AIM-ISO/IEC Compliance

Our barcode algorithms were written by following the official specifications of each barcode symbology. Our barcode engine provides you with exclusive features like auto-checksum, data validation, Bar Width Adjustment (BWA) for linear & 2D symbols, auto-encoding methods for shortest barcode symbol generation.

Best-in-class Imaging Support

BarcodePro Web API for Docker creates barcodes in raster formats like PNG, JPEG/JPG, PCX & PDF as well as in SVG & EPS vector formats! All barcode can be rotated at 90, 180 & 270 degrees. Rounded Border & Beader Bars are also supported. High Quality DPI Resolution is supported for PNG & JPEG outputs.

Create Artistic Barcodes

Create customized barcodes by stamping logos or pictures on symbols as well as specifying an image for filling the bars or dots!
Artistic Barcodes with logo & fill patterns

Overview

Designed by following some of the REST principles, BarcodePro Web API for Docker responds to a simple HTTP POST by specifying the Barcode settings through a JSON object in the request body, returning the output rendering in the image or document format specified through the Accept header.

Help Doc Topics


Download and run BarcodePro Web API for Docker

BarcodePro Web API for Docker is available at Docker Hub registry.

  • To pull/download the Docker image, please type the following from a Terminal:

    docker pull neodynamic/barcodeprowebapi:2.0.1
  • To run the Docker image, please type the following from a Terminal:

    docker run -it --rm -p 8080:80 neodynamic/barcodeprowebapi:2.0.1

How To Use It - Basic Sample

The following source code invokes the BarcodePro Web API for Docker to generate a PNG image for the specified Barcode JSON object (in this simple example we'll request a QRCode encoding 12345). For more advanced settings please refer to the Barcode JSON Object


                    
curl -X POST "http://localhost:8080/BarcodeGenerator" \
     -H  "Accept: image/png" \
     -H  "Content-Type: application/json" \
     -d "{\"symbology\":\"QRCode\", \"code\":\"12345\"}" \
     --output label.png
                        
                

                    
$data = array(
  'symbology' => 'QRCode',
  'code' => '12345'
);

$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/BarcodeGenerator';
$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/BarcodeGenerator")

header = {'Accept':'image/png', 'Content-Type': 'application/json'}

data = {symbology: 'QRCode', code: '12345'}

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/BarcodeGenerator"

jsondata = json.dumps( {"symbology": "QRCode", "code": "12345"} )

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/BarcodeGenerator";
my $req = HTTP::Request->new(POST => $server_endpoint);
$req->header('content-type' => 'application/json');
$req->header('accept' => 'image/png');

my $post_data = '{ "symbology" : "QRCode", "code" : "12345" }';

$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/BarcodeGenerator");
 
String json = "{\"symbology\" : \"QRCode\", \"code\": \"12345\"}";
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 = "{\"symbology\" : \"QRCode\", \"code\": \"12345\"}";

var request = (HttpWebRequest)WebRequest.Create("http://localhost:8080/BarcodeGenerator");
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({
    "symbology": "QRCode",
    "code": "12345"
});

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/BarcodeGenerator");
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/BarcodeGenerator',
    method: 'POST',
    headers: headers,
    json: {"symbology": "QRCode", "code": "12345"}
}
 
request(options, function (error, response, body) {
    if (!error && response.statusCode == 200) {
        console.log(body);
    }
})
                        
                

The Accept Header

The desired output rendering format must be specified through the Accept header. The supported formats are the following:

Accept Description
image/png Returns the generated barcode symbol in PNG format.
image/jpeg Returns the generated barcode symbol in JPEG/JPG format.
application/pdf Returns generated barcode symbol as a single PDF document.
application/postscript Returns generated barcode symbol in EPS format. Requires a license key...
image/svg+xml Returns generated barcode symbol in SVG format. Requires a license key...
image/vnd.zbrush.pcx Returns the generated barcode symbol in PCX format.

Web API Doc


Licensing

On-Premise - Full Deployment Control

BarcodePro 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...

 License Registration

When you buy a commercial license of BarcodePro 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:

docker run -it --rm -e "LICENSE_OWNER=YOUR-COMPANY-NAME" -e "LICENSE_KEY=YOUR_KEY" -p 8080:80 neodynamic/barcodeprowebapi:2.0.1

 Evaluation Mode

The Trial Version of BarcodePro Web API for Docker is fully functional and has no expiry date. However, while in TRIAL mode, the output rendering has the following limitations:


  • SVG & EPS barcode image formats require a license key, a blank image will be generated in TRIAL mode.
  • A TRIAL stamp will be rendered at the top of the rendering output.

 Want to try BarcodePro Web API for Docker without TRIAL watermark?

We offer you a 30-day Evaluation License Key which will allow you to test the BarcodePro Web API for Docker in fully-functional mode for 30 days! When the 30-day Evaluation License Key expires, the BarcodePro Web API for Docker behavior backs to Trial mode. Request your 30-day Evaluation License Key now...

 Change Log