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

Create Artistic QR Codes with Custom Shape Patterns!

In addition to stamp images on barcode symbols, the ArtModuleShape and ArtFinderShape properties allow you to customize the QR Code modules and finders!

ArtFinderShape Patterns

ArtFinderShape-Rect ArtFinderShape-RoundRect ArtFinderShape-Circle

ArtModuleShape Patterns

ArtModuleShape-Rect ArtModuleShape-Circle ArtModuleShape-Dot ArtModuleShape-Diamond ArtModuleShape-ZebraVertical ArtModuleShape-ZebraHorizontal

QR Code Samples by combining the patterns...

QR-RoundRect-Dot QR-RoundRect-Circle QR-RoundRect-ZebraHorizontal QR-Rect-Diamond QR-Circle-ZebraVertical

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:

    AMD
    docker pull neodynamic/barcodeprowebapi:3.0.9
    ARM
    docker pull neodynamic/barcodeprowebapi:3.0.9-arm64
  • To run the Docker image, please type the following from a Terminal:

    AMD
    docker run -it --rm -p 8080:80 neodynamic/barcodeprowebapi:3.0.9
    ARM
    docker run -it --rm -p 8080:80 neodynamic/barcodeprowebapi:3.0.9-arm64

Run BarcodePro WebAPI on a Custom Port

By default, our Docker image exposes ports 80 and 443 only. If you want to expose and use another different port, then do the following.

  1. Let's suppose you want to use port 12345. Create a new Dockerfile and edit it by pasting the following content:

                                    
    FROM neodynamic/barcodeprowebapi:3.0.9
    EXPOSE 12345
                                    
                                
  2. Save that file and then build it...
    docker build -t neodynamic/my_custom_barcodeprowebapi:3.0.9 .
  3. Now run the new custom Docker image with the following params:
    docker run -it --rm -p 12345:12345 -e "ASPNETCORE_URLS=http://+:12345" neodynamic/my_custom_barcodeprowebapi:3.0.9

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:

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

 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

  • 3.0.9 2023-10-31
    • Fixed! QR Code throws System.ArgumentException: 'Shift_JIS' is not a supported encoding name.

  • 3.0.8 2023-10-26
    • Fixed! Rendering is not complete under some cases when AutoSize or FitProportional options are enabled.

  • 3.0.7 2023-07-26
    • Fixed! rMQR data encoding when using H ECC.
    • Fixed! barcode sizing in some special cases.

  • 3.0.6 2023-02-27
    • New! GS1-128 AI 715 - National Healthcare Reimbursement Number (NHRN): United States of America FDA.

  • 3.0.5 2023-02-22
    • Improved! Using Alpine as the image base.

  • 3.0.4 2023-02-07
    • Improved! Using latest Debian image as base.

  • 3.0.3 2023-01-11
    • Fixed! Error Text Encoding is not a supported encoding name.

  • 3.0.2 2022-08-09
    • Fixed! ISBT-128 Data Structure 023 - Compound Messages data validation and rendering.

  • 3.0.1 2022-07-13
    • Fixed! Quiet Zone settings.
    • Fixed! artFinderShape was not working if modules are rect shape.
    • Fixed! Error handling.

  • 3.0 2022-04-29
  • 2.0.5 2022-03-10
    • CRITICAL Fixed! QR Code Auto Encoding - Wrong Numeric Data Bits calculation introduced by previous update.
    • Fixed! Aztec Code runes encoding.

  • 2.0.4 2022-02-07
    • Improved! QR Code Auto-encoding to use the smallest symbol size.

  • 2.0.3 2021-11-25
    • New! Added QuietZone property that replaces QuietZoneWidth, TopMargin and BottomMargin properties now marked as obsolete.
    • Improved! EAN and UPC first and last digit or light margin indicator rendering based on the quiet zones.
    • Improved! UPC-A and UPC-E first and last digits font size reduction.
    • Improved! ISBT-128 human readable text rendering.
    • Fixed! UPC-A and UPC-E supplement bars height.

  • 2.0.2 2021-10-25
    • Improved! PDF417 Text compation encoding.
    • Fixed! Databar Expanded Stacked encoding.
    • New! Updated AIs support based on GS1 General Specification v21
      • AI (235) Third Party Controlled, Serialised Extension of GTIN (TPX)
      • AI (395n) Amount payable per unit of measure single monetary area (variable measure trade item)
      • AI (417) Party Global Location Number (GLN)
      • AI (4300) Ship-to / Deliver-to Company name
      • AI (4301) Ship-to / Deliver-to contact name
      • AI (4302) Ship-to / Deliver-to address line 1
      • AI (4303) Ship-to / Deliver-to address line 2
      • AI (4304) Ship-to / Deliver-to suburb
      • AI (4305) Ship-to / Deliver-to locality
      • AI (4306) Ship-to / Deliver-to region
      • AI (4307) Ship-to / Deliver-to country code
      • AI (4308) Ship-to / Deliver-to telephone number
      • AI (4310) Return-to company name
      • AI (4311) Return-to contact name
      • AI (4312) Return-to address line 1
      • AI (4313) Return-to address line 2
      • AI (4314) Return-to suburb
      • AI (4315) Return-to locality
      • AI (4316) Return-to region
      • AI (4317) Return-to country code
      • AI (4318) Return-to postal code
      • AI (4319) Return-to telephone number
      • AI (4320) Service code description
      • AI (4321) Dangerous goods flag
      • AI (4322) Authority to leave flag
      • AI (4323) Signature required flag
      • AI (4324) Not before delivery date/time
      • AI (4325) Not after delivery date/time
      • AI (4326) Release date
      • AI (7040) GS1 UIC with Extension 1 and Importer index

  • 2.0.1 2021-06-02
    • Fixed! Wrong bar height rendering for EAN/UPC symbologies when FitProportional is enabled.

  • 2.0 2021-05-03
  • 1.0.3 2021-03-04
    • New! Added Health Check endpoint /health

  • 1.0.2 2020-10-31
    • Fixed! Validation whether the data to encode can be rendered if both PDF417 Cols & Rows was specified.
    • Fixed! FitProportional for Code16K, Code49 and CodablockF symbologies.
    • Fixed! CodablockF row separator rendering.

  • 1.0.1 2020-04-24
  • 1.0 2020-04-20
    • New! Initial release.