Java Onecode - Introduction
This Symbology is also known as OneCode
4CB, USPS 4CB, 4-CB, 4-State Customer Barcode, USPS OneCode Solution Barcode
gs1 barcode parsing c#,
generate barcode java code,
how to read barcode in java,
read data from barcode scanner in .net c# windows application,
c# barcode reader source code,
how to print barcode in crystal report using c#
OneCode 4-State Customer Barcode
(4-CB) is the next generation in the evolution of USPS barcode technology. It
does not replace existing barcodes - it offers a more effective alternative.
Partnering with the Mailing Industry, the Postal Service developed the 4-CB
which increases the amount of information carried on letter and flats mail
pieces and allows for expanded tracking capability, creating greater visibility
into the mailstream.
Java Barcode Intelligent Mail (Onecode) Generator - How to generate Intelligent Mail barcodes in Java class?
-
Draw barcodes to image files
BarCode barcode = new BarCode();
barcode.setType(BarCode.CODE39);
barcode.setData("0123456789");
barcode.draw("C://code39.gif");
-
Draw barcodes to java.io.OutputStream object
BarCode barcode = new BarCode();
barcode.setType(BarCode.CODE39);
barcode.setData("0123456789");
barcode.draw(outputStreamObject);
-
Draw barcodes to java.awt.Graphics2D object
BarCode barcode = new BarCode();
barcode.setType(BarCode.CODE39);
barcode.setData("0123456789");
barcode.draw(graphicsObject);
Java Barcode Intelligent Mail (Onecode) Generator - How to create Intelligent Mail barcodes in Java web applications?
-
How to generate barcode image in html or jsp pages?
- Download trial package, unzip it, copy barcode folder and its contents to your Java Servlet container like Tomcat, or Jboss.
- Start Tomcat, navigate to http://url:port/barcode/barcode?data=0123456789&type=4
- To generate barcodes in html page or jsp page, insert the following html code.
<img src="http://url:port/barcode/barcode?data=0123456789&type=4" />
-
How to generate barcode image in Java Servlet?
public void doPost(HttpServletRequest request, HttpServletResponse response) throws
ServletException
{
try {
BarCode barcode = new BarCode();
barcode.setType(BarCode.CODE39);
barcode.setData("0123456789");
ServletOutputStream sout = response.getOutputStream();
response.setContentType("image/jpeg");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
barcode.drawBarcode(sout);
} catch (Exception e) {
throw new ServletException(e);
}
}
Java Barcode Intelligent Mail (Onecode) Generator - How to draw & print Intelligent Mail barcodes in Java Reporting projects?
Java Onecode - Property Settings
Class Attribute |
HTTP Parameter |
Default Value |
Comments |
Basic |
type |
type |
-1 |
Barcode symbology type |
data |
data |
"" |
Barcode value to encode |
supData |
sup-data |
"" |
Barcode supplementary value to encode. Apply for EAN-8, EAN-13, UPC-A, UPC-E, ISBN, ISSN |
applyChecksum |
apply-checksum |
true |
Checksum for barcode data |
|
Barcode Size |
uom |
uom |
IBarCode.UOM_PIXEL |
Unit of meature for all size related settings. UOM_PIXEL (0); UOM_CM (1); UOM_INCH (2). Default is UOM_PIXEL |
X |
x |
2 |
Width of barcode module (narrow bar), default is 2 pixel |
Y |
y |
75 |
Barcode module height, default is 75 pixel |
leftMargin |
left-margin |
0 |
Barcode image left margin |
rightMargin |
right-margin |
0 |
Barcode image right margin |
topMargin |
top-margin |
0 |
Barcode image top margin |
bottomMargin |
bottom-margin |
0 |
Barcode image bottom margin |
resolution |
resolution |
72 |
Barcode image resolution in dpi |
rotate |
rotate |
IBarCode.ROTATE_0 |
Barcode rotate angle, valid values: IBarCode.ROTATE_0 (0), IBarCode.ROTATE_90 (1), IBarCode.ROTATE_180 (2), IBarCode.ROTATE_270 (3) |
|
Text Style |
displayText |
display-text |
true |
If true, display barcode value text, otherwise do not display. |
textFont |
text-font |
"Arial", Font.PLAIN, 11 |
Barcode text font style |
|
Code 39 |
displayStartStopChar |
display-start-stop-char |
true |
If true, display the start and stop char (*) in the begining and end of barcode value. |
wideNarrowRatio |
wide-narrow-ratio |
2.0f |
wide vs narrow bar width ratio. for Code39, Code 2 of 5, Interleaved 2 of 5, Identcode, Leitcode, ITF14. |
|
ITF14 |
bearerBar |
bearer-bar |
IBarCode.BEARERBAR_NONE |
Bearer bars for ITF14. BEARERBAR_NONE (0), BEARERBAR_FRAME (1), BEARERBAR_TOPBOTTOM (2) |
|
Code 128 & UCC/EAN/GS1 128 |
processTilde |
process-tilde |
false |
Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false.
~NNN: is used to represent the ASCII character with the value of NNN. NNN is from 000 - 255. |
eci |
eci |
3 |
|
fnc1Mode |
fnc1-mode |
0 (none) |
|
applicationIndicator |
ai |
0 |
|