1 QrCode

Class Ax.barcode.QrCode


A QR Code symbol, which is a type of two-dimension barcode. Invented by Denso Wave and described in the ISO/IEC 18004 standard.

Constructor Summary

Method
Description
JSQrCode(Ax.text.String text)
Returns a QR Code representing the specified Unicode text string at MEDIUM error correction level.
JSQrCode(Ax.text.String text, Ax.text.String level)
Returns a QR Code representing the specified Unicode text string at the specified error correction level.

Method Summary

Modifier and Type
Method
Description
byte[] 
toPNG()
Returns a raster image depicting this QR Code, with module scale 10 and 4 border modules.
byte[] 
toPNG(int scale,int border)
Returns a raster image depicting this QR Code, with the specified module scale and border modules.
Ax.text.String 
toSVG()
Returns a string of SVG code for an image depicting this QR Code, with 4 border modules.
Ax.text.String 
toSVG(int border)
Returns a string of SVG code for an image depicting this QR Code, with the specified number of border modules.

Constructor Detail

Ax.barcode.QrCode.JSQrCode

Ax.barcode.QrCode.JSQrCode(
	string text
						)
Info:
Returns a QR Code representing the specified Unicode text string at MEDIUM error correction level. As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible QR Code version is automatically chosen for the output. The error level of the result may be higher than MEDIUM if it can be done without increasing the version.
Parameters:
text - the text to be encoded (not null), which can be any Unicode string

Example
Copy
new Ax.barcode.QrCode("Hello, world!");

Ax.barcode.QrCode.JSQrCode

Ax.barcode.QrCode.JSQrCode(
	string text,
	string level
						)
Info:
Returns a QR Code representing the specified Unicode text string at the specified error correction level. As a conservative upper bound, this function is guaranteed to succeed for strings that have 738 or fewer Unicode code points (not UTF-16 code units) if the low error correction level is used. The smallest possible QR Code version is automatically chosen for the output. The error level of the result may be higher than the level argument if it can be done without increasing the version.
Parameters:
text - the text to be encoded (not null), which can be any Unicode string
level - the error correction level to use (not null) (boostable)

Example
Copy
new Ax.barcode.QrCode("Hello, world!");

Method Detail

Ax.barcode.QrCode.toPNG

byte[] Ax.barcode.QrCode.toPNG()
Info:
Returns a raster image depicting this QR Code, with module scale 10 and 4 border modules.
Returns:
byte[]

Ax.barcode.QrCode.toPNG

byte[] Ax.barcode.QrCode.toPNG(
	smallint scale,
	smallint border
)
Info:
Returns a raster image depicting this QR Code, with the specified module scale and border modules.
Parameters:
scale - the side length (measured in pixels, must be positive) of each module
border - the number of border modules to add, which must be non-negative
Returns:
byte[]

Ax.barcode.QrCode.toSVG

string Ax.barcode.QrCode.toSVG()
Info:
Returns a string of SVG code for an image depicting this QR Code, with 4 border modules. The string always uses Unix newlines (\n), regardless of the platform.
Returns:
string

Ax.barcode.QrCode.toSVG

string Ax.barcode.QrCode.toSVG(
	smallint border
)
Info:
Returns a string of SVG code for an image depicting this QR Code, with the specified number of border modules. The string always uses Unix newlines (\n), regardless of the platform.
Parameters:
border - the number of border modules to add, which must be non-negative
Returns:
string

2 PDF417

Class Ax.barcode.PDF417


Generates the 2D barcode PDF417. Supports dimensioning auto-sizing, fixed and variable sizes, automatic and manual error levels, raw codeword input, codeword size optimization and bitmap inversion. The output can bean image as a byte array.

Constructor Summary

Method
Description
JSPDF417(Ax.text.String text)
Creates a new JSPDF417 with the default settings.

Method Summary

Modifier and Type
Method
Description
com.itextpdf.text.Rectangle 
Gets the size of the barcode grid.
void 
setCodeCols(int cols)
Sets the number of barcode data columns.
void 
setCodeRows(int rows)
Sets the number of barcode rows.
void 
setErrorLevel(int level)
Sets the error level correction for the barcode.
void 
setOptions(int options)
Sets the options to generate the barcode.
void 
setYHeight(int height)
Sets the Y pixel height relative to X.
byte[] 
toPNG()
Generates the PDF417 barcode as image bytes.

Constructor Detail

Ax.barcode.PDF417.JSPDF417

Ax.barcode.PDF417.JSPDF417(
	string text
						)
Info:
Creates a new JSPDF417 with the default settings.
Parameters:
text - text to encode

Example
Copy
new Ax.barcode.PDF417("ABCabc123");

Method Detail

Ax.barcode.PDF417.getBarCodeSize

object Ax.barcode.PDF417.getBarCodeSize()
Info:
Gets the size of the barcode grid.
Returns:
object

Ax.barcode.PDF417.setCodeCols

null Ax.barcode.PDF417.setCodeCols(
	smallint cols
)
Info:
Sets the number of barcode data columns. This number may be changed to keep the barcode valid.
Parameters:
cols - the number of barcode data columns
Returns:
null

Ax.barcode.PDF417.setCodeRows

null Ax.barcode.PDF417.setCodeRows(
	smallint rows
)
Info:
Sets the number of barcode rows. This number may be changed to keep the barcode valid.
Parameters:
rows - the number of barcode rows
Returns:
null

Ax.barcode.PDF417.setErrorLevel

null Ax.barcode.PDF417.setErrorLevel(
	smallint level
)
Info:
Sets the error level correction for the barcode.
Parameters:
level - the error level correction for the barcode
Returns:
null

Ax.barcode.PDF417.setOptions

null Ax.barcode.PDF417.setOptions(
	smallint options
)
Info:
Sets the options to generate the barcode. This can be all the PDF417_* constants.
Parameters:
options - the options to generate the barcode
Returns:
null

Ax.barcode.PDF417.setYHeight

null Ax.barcode.PDF417.setYHeight(
	smallint height
)
Info:
Sets the Y pixel height relative to X. It is usually 3.
Parameters:
height - the Y pixel height relative to X
Returns:
null

Ax.barcode.PDF417.toPNG

byte[] Ax.barcode.PDF417.toPNG()
Info:
Generates the PDF417 barcode as image bytes.
Returns:
byte[]

3 Scanner

Class Ax.barcode.Scanner


Constructor Summary

Method
Description
Creates a new scanner instance.

Method Summary

Modifier and Type
Method
Description
com.google.zxing.Result 
Gets the the last scanner Result or null if was not successful.
Ax.text.String 
Scans an image (png, jpeg, .
Ax.text.String 
scanPDF(Object pdf)
Scans a PDF document and returns the scanned barcode or null if not found .
void 
Sets the filters of the scanner.
void 
Sets the scanner's handler.

Constructor Detail

Ax.barcode.Scanner.JSScanner

Ax.barcode.Scanner.JSScanner()
Info:
Creates a new scanner instance.

Method Detail

Ax.barcode.Scanner.getResult

object Ax.barcode.Scanner.getResult()
Info:
Gets the the last scanner Result or null if was not successful.
Returns:
object

Ax.barcode.Scanner.scanImage

string Ax.barcode.Scanner.scanImage(
	object img
)
Info:
Scans an image (png, jpeg, ...).
Parameters:
img - an image
Returns:
string

Ax.barcode.Scanner.scanPDF

string Ax.barcode.Scanner.scanPDF(
	object pdf
)
Info:
Scans a PDF document and returns the scanned barcode or null if not found .
Parameters:
pdf - a pdf document
Returns:
string

Ax.barcode.Scanner.setImageFilter

null Ax.barcode.Scanner.setImageFilter(
	object filter
)
Info:
Sets the filters of the scanner.
Parameters:
filter - the filter/s to use
Returns:
null

Ax.barcode.Scanner.setImageHandler

null Ax.barcode.Scanner.setImageHandler(
	object consumer
)
Info:
Sets the scanner's handler.
Parameters:
consumer - the handler function
Returns:
null

4 SVG

Class Ax.barcode.SVG


Scalable Vector Graphics (SVG) is an Extensible Markup Language (XML)-based vector image format for two-dimensional graphics with support for interactivity and animation. The SVG specification is an open standard developed by the World Wide Web Consortium (W3C) since 1999. You can generate SVG barcodes for: UPC A UPC E EAN 13 3of9 Code 128

Constructor Summary

Method
Description
JSSVGBarcode(Ax.text.String text)
Creates a SVG code representing the specified string.

Method Summary

Modifier and Type
Method
Description
Ax.barcode.SVG 
setHeight(double height)
Sets the pattern height (= bar length) in mm.
Ax.barcode.SVG 
setModule(double module)
Sets the width of the elementary unit bar/space.
Ax.barcode.SVG 
setPrintText(boolean print)
Sets print text, that is, the text under the SVGCode.
Ax.barcode.SVG 
setXMLHeader(boolean print)
Sets xml header.
Ax.text.String 
to3of9()
Generates SVG in 3of9 format.
Ax.text.String 
Generates SVG in Code128 format.
Ax.text.String 
Generates SVG in EAN13 format.
Ax.text.String 
Generates SVG in Int2of5 format.
Ax.text.String 
toUPCA()
Generates SVG String in UPCA format.
Ax.text.String 
toUPCE()
Generates SVG in UPCE format.

Constructor Detail

Ax.barcode.SVG.JSSVGBarcode

Ax.barcode.SVG.JSSVGBarcode(
	string text
						)
Info:
Creates a SVG code representing the specified string.
Parameters:
text - text to encode

Example
Copy
new Ax.barcode.SVG("042100005264");

Method Detail

Ax.barcode.SVG.setHeight

object Ax.barcode.SVG.setHeight(
	double height
)
Info:
Sets the pattern height (= bar length) in mm.
Parameters:
height - height of the barcode in mm
Returns:
object

Ax.barcode.SVG.setModule

object Ax.barcode.SVG.setModule(
	double module
)
Info:
Sets the width of the elementary unit bar/space.
Parameters:
module - width of the bars and spaces in mm
Returns:
object

Ax.barcode.SVG.setPrintText

object Ax.barcode.SVG.setPrintText(
	boolean print
)
Info:
Sets print text, that is, the text under the SVGCode. When set to true, the text will be printed under the SVG barcode. When set to false, the text will not be printed.
Parameters:
print - true to set print text, false otherwise
Returns:
object

Ax.barcode.SVG.setXMLHeader

object Ax.barcode.SVG.setXMLHeader(
	boolean print
)
Info:
Sets xml header. When set to true, the xml header will be added to the SVG. When set to false, the xml header will not be added.
Parameters:
print - true to set xml header, false otherwise
Returns:
object

Ax.barcode.SVG.to3of9

string Ax.barcode.SVG.to3of9()
Info:
Generates SVG in 3of9 format.
Returns:
string

Ax.barcode.SVG.toCode128

string Ax.barcode.SVG.toCode128()
Info:
Generates SVG in Code128 format.
Returns:
string

Ax.barcode.SVG.toEAN13

string Ax.barcode.SVG.toEAN13()
Info:
Generates SVG in EAN13 format.
Returns:
string

Ax.barcode.SVG.toInt2of5

string Ax.barcode.SVG.toInt2of5()
Info:
Generates SVG in Int2of5 format.
Returns:
string

Ax.barcode.SVG.toUPCA

string Ax.barcode.SVG.toUPCA()
Info:
Generates SVG String in UPCA format.
Returns:
string

Ax.barcode.SVG.toUPCE

string Ax.barcode.SVG.toUPCE()
Info:
Generates SVG in UPCE format.
Returns:
string

5 CropNorthEastFilter

Class Ax.barcode.filter.CropNorthEastFilter


Filter for JSScanner to crop the north-east quarter of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the north-east quarter of the image.

Constructor Detail

Ax.barcode.filter.CropNorthEastFilter.CropNorthEastFilter

Ax.barcode.filter.CropNorthEastFilter.CropNorthEastFilter()

Method Detail

Ax.barcode.filter.CropNorthEastFilter.crop

object Ax.barcode.filter.CropNorthEastFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropNorthEastFilter.filter

object Ax.barcode.filter.CropNorthEastFilter.filter(
	object original,
	object src
)
Info:
Returns the north-east quarter of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

6 CropNorthFilter

Class Ax.barcode.filter.CropNorthFilter


Filter for JSScanner to crop the north half of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the north half of the image.

Constructor Detail

Ax.barcode.filter.CropNorthFilter.CropNorthFilter

Ax.barcode.filter.CropNorthFilter.CropNorthFilter()

Method Detail

Ax.barcode.filter.CropNorthFilter.crop

object Ax.barcode.filter.CropNorthFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropNorthFilter.filter

object Ax.barcode.filter.CropNorthFilter.filter(
	object original,
	object src
)
Info:
Returns the north half of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

7 CropNorthWestFilter

Class Ax.barcode.filter.CropNorthWestFilter


Filter for JSScanner to crop the north-west quarter of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the north-west quarter of the image.

Constructor Detail

Ax.barcode.filter.CropNorthWestFilter.CropNorthWestFilter

Ax.barcode.filter.CropNorthWestFilter.CropNorthWestFilter()

Method Detail

Ax.barcode.filter.CropNorthWestFilter.crop

object Ax.barcode.filter.CropNorthWestFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropNorthWestFilter.filter

object Ax.barcode.filter.CropNorthWestFilter.filter(
	object original,
	object src
)
Info:
Returns the north-west quarter of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

8 CropSouthEastFilter

Class Ax.barcode.filter.CropSouthEastFilter


Filter for JSScanner to crop the south-east quarter of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the south-east quarter of the image.

Constructor Detail

Ax.barcode.filter.CropSouthEastFilter.CropSouthEastFilter

Ax.barcode.filter.CropSouthEastFilter.CropSouthEastFilter()

Method Detail

Ax.barcode.filter.CropSouthEastFilter.crop

object Ax.barcode.filter.CropSouthEastFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropSouthEastFilter.filter

object Ax.barcode.filter.CropSouthEastFilter.filter(
	object original,
	object src
)
Info:
Returns the south-east quarter of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

9 CropSouthFilter

Class Ax.barcode.filter.CropSouthFilter


Filter for JSScanner to crop the south half of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the south half of the image.

Constructor Detail

Ax.barcode.filter.CropSouthFilter.CropSouthFilter

Ax.barcode.filter.CropSouthFilter.CropSouthFilter()

Method Detail

Ax.barcode.filter.CropSouthFilter.crop

object Ax.barcode.filter.CropSouthFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropSouthFilter.filter

object Ax.barcode.filter.CropSouthFilter.filter(
	object original,
	object src
)
Info:
Returns the south half of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

10 CropSouthWestFilter

Class Ax.barcode.filter.CropSouthWestFilter


Filter for JSScanner to crop the south-west quarter of the image.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the south-west quarter of the image.

Constructor Detail

Ax.barcode.filter.CropSouthWestFilter.CropSouthWestFilter

Ax.barcode.filter.CropSouthWestFilter.CropSouthWestFilter()

Method Detail

Ax.barcode.filter.CropSouthWestFilter.crop

object Ax.barcode.filter.CropSouthWestFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.CropSouthWestFilter.filter

object Ax.barcode.filter.CropSouthWestFilter.filter(
	object original,
	object src
)
Info:
Returns the south-west quarter of the image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

11 RegionFilter

Class Ax.barcode.filter.RegionFilter


Filter for JSScanner to scan the image scanning the regions of the defined widh and height, and moving each time the region 'step' number of pixels.

Constructor Summary

Method
Description
RegionFilter(int width, int height, int step)

Method Summary

Modifier and Type
Method
Description
Returns the same image as the one given (src).
int 
Returns the region height.
int 
Returns the step.
int 
Returns the region width.

Constructor Detail

Ax.barcode.filter.RegionFilter.RegionFilter

Ax.barcode.filter.RegionFilter.RegionFilter(
	smallint width,
	smallint height,
	smallint step
						)
Parameters:
width - 
height - 
step - 

Method Detail

Ax.barcode.filter.RegionFilter.filter

object Ax.barcode.filter.RegionFilter.filter(
	object original,
	object src
)
Info:
Returns the same image as the one given (src).
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

Ax.barcode.filter.RegionFilter.getHeight

smallint Ax.barcode.filter.RegionFilter.getHeight()
Info:
Returns the region height.
Returns:
smallint

Ax.barcode.filter.RegionFilter.getStep

smallint Ax.barcode.filter.RegionFilter.getStep()
Info:
Returns the step.
Returns:
smallint

Ax.barcode.filter.RegionFilter.getWidth

smallint Ax.barcode.filter.RegionFilter.getWidth()
Info:
Returns the region width.
Returns:
smallint

12 ResetFilter

Class Ax.barcode.filter.ResetFilter


Filter for JSScanner to reset (undo) the previous applied images.

Constructor Summary

Method
Description

Method Summary

Modifier and Type
Method
Description
crop(BufferedImage src, int x, int y, int w, int h)
Returns the original image.

Constructor Detail

Ax.barcode.filter.ResetFilter.ResetFilter

Ax.barcode.filter.ResetFilter.ResetFilter()

Method Detail

Ax.barcode.filter.ResetFilter.crop

object Ax.barcode.filter.ResetFilter.crop(
	object src,
	smallint x,
	smallint y,
	smallint w,
	smallint h
)
Parameters:
src - 
x - 
y - 
w - 
h - 
Returns:
object

Ax.barcode.filter.ResetFilter.filter

object Ax.barcode.filter.ResetFilter.filter(
	object original,
	object src
)
Info:
Returns the original image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object

13 RotateFilter

Class Ax.barcode.filter.RotateFilter


Filter for JSScanner to rotate the image the desired amount of degrees.

Constructor Summary

Method
Description
RotateFilter(double angle)
Creates a new RotateFilter with the amount of degrees to rotate the image when the filter is applied.

Method Summary

Modifier and Type
Method
Description
Returns the rotated image.

Constructor Detail

Ax.barcode.filter.RotateFilter.RotateFilter

Ax.barcode.filter.RotateFilter.RotateFilter(
	double angle
						)
Info:
Creates a new RotateFilter with the amount of degrees to rotate the image when the filter is applied.
Parameters:
angle - angle to rotate in degrees, can be negative

Method Detail

Ax.barcode.filter.RotateFilter.filter

object Ax.barcode.filter.RotateFilter.filter(
	object original,
	object src
)
Info:
Returns the rotated image.
Parameters:
original - original image without filters applied
src - image returned from the previous filter
Returns:
object