BarcodeServlet |
Barcode generator servlet
A servlet that creates PNG image of a barcode
according to the parameters sent to a the servlet
Mandatory HTTP parameters:
barcodeType
barcodeValue
barcodeType
Parameter Values:
barcodeType: CODE128, CODE93 or INTERLEAVED2OF5
barcodeValue: Any text if code128 or code93, any integer number if interleaved2of5
sizeY: height in pixels of the image(default value: 50)
rotation: angle to rotate the image: 0,90,180 or 270
barColor:color of the bars: black,green, etc
textColor:color of the text: black,green, etc
showText: Show the text true/false
transparent: Use transparent background true/false
alignment: Text alignment: CENTER, LEFT or RIGHT
fontName: anme of the font, for example Helvetica
fontSize:Font size
fontStyle: Font style: BOLD, ITALIC or PLAIN
A very basic form to post data to generate a barcode
<form method="POST" action="/JBars/BarcodeServlet">
Barcode Type
<input type="text" name="barcodeType" >
<br>
Text to encode:
<input type="text" name="barcodeValue" >
<br>
Size Y(in pixels):
<input type="text" name="sizeY" >
<br>
Rotation:
<input type="text" name="rotation" >
<br>
Bar Color:
<input type="text" name="barColor" >
<br>
showText:
<input type="text" name="showText" >
<br>
fontName:
<input type="text" name="fontName" >
<br>
fontSize:
<input type="text" name="fontSize" >
<br>
fontStyle:
<input type="text" name="fontStyle" >
<br>
transparent:
<input type="text" name="transparent" >
<br>
alignment:
<input type="text" name="alignment" >
<br>
<input type="submit" value="Generator Barcode">
|