UPC Barcode Generator
Here is a quick UPC (Universal Product Code) barcode generator.
There are already many free barcode generators available. This one is not touted to be superior in any way although it does generate the smallest SVG output of the free online tools found so far. See the comparison table below.
This side-project was used as a demonstration platform for developing an SVG generator library. The SVG generator will be incorporated in many of the existing projects to provide the capability of saving images as SVG files in addition to the several raster formats already provided.
The advantages of SVG over raster formats are:
- considerably smaller file size -- on the order of 1/50th the size of conventional raster files
- accurate, sharp image no matter the resizing applied afterwards. You can use any browser, its built-in print dialog window, or other viewing and printing utilities to view and scale the image as needed
- image can be changed using an SVG editor tool or by hand with any text editor. Alterations include for example: background colour, adding or removing items in the image, copying portions of the image to be incorporated elsewhere, etc.
- image file is in plain text format. It can be embedded / incorporated easily into web pages or included with other text such as emails (image may be rendered graphically or the SVG code may be sent as readable code)
NOTE: SVG is a predominantly vector oriented rendering code. It is not capable of efficient, direct representation of continuous-tone images such as photographs or computer generated continuous-tone data. With the exception of polygonal area fills with linear colour gradient.
As was mentioned earlier the SVG size is smaller than that generated by rival tools. Below is a table showing the file sizes made by the various free tools found.
All tools were tasked to produce the identical barcode number: "012459363636". All comments were removed for 'output' size. Headers and superfluous code were removed using an online SVG optimizer tool to obtain the 'minified' size.
|Corban Works Barcode Test||4302||4010|
|Free Barcode Generator||4024||1580|
|Free Online Barcode Generator: UPC-A||3153||1570|
|Free Online Barcode Generator||3752||1502|
|Free Barcode Generator - Create barcodes here||3442||1148|
|SVG Barcode Generator||6997||897|
|Generate high quality barcodes online for free||2753||718|
|scientific601 - UPC Barcode Generator||590||486|
Revised 1 Aug 2020