Barcode creation and cracking

Source: Internet
Author: User
Barcode for Java

A leadingJava barcode GeneratorTo be used in J2EE, J2SE environment and Java Reporting (JasperReports and Eclipse BIRT ).

Barcode for JavaSupports generating high quality barcode images in

  • Java Server Side environment (JSP,Servlet,J2EE,Web Service)
  • Java Application (Swing,Applet,Java Bean)
  • Java Reporting (Jasper Reports,Eclipse BIRT)

The bar code types supported by Barcode (I will not talk about them one by one. Please visit the official website)

  • Codabar
  • Code 11
  • Code 2 of 5
  • Code 39
  • Code 39 Extension
  • Code 93
  • EAN 8
  • EAN 8 Supplement 2, 5
  • EAN 13
  • EAN 13 Supplement 2, 5
  • ISBN
  • ISBN Supplement 2, 5
  • ISSN
  • ISSN Supplement 2, 5
  • ITF14
  • Interleaved 2 of 5
  • Identcode
  • Leitcode
  • Code 128
  • EAN 128
  • MSI
  • Onecode
  • Planet
  • Postnet
  • RM4SCC (briish Royal Mail 4-State Customer Barcode)
  • UPC-A
  • UPC-A Supplement 2, 5
  • UPC-E
  • UPC-E Supplement 2, 5
  • Data Matrix (ECC200)
  • 2017417
  • QR Code

Because I use bar codes, not for machine reading, but for good-looking purposes, it seems that the reports are more professional.

Among the many bar code types, I personally think code11 is not only easy to use, but also looks good.

 

I will post some usage and introduction here (it's too simple and I am also lazy at translating)

1. barcode IntroductionIt is used primarily in labeling telecommunications equipment. the symbology is discrete and is able to encode the numbers 0 through 9, the dash symbol (-), and start/stop characters. code 11 is not terribly secure in that printing imperfections can quite easily convert one character into another valid character. data integrity is obtained by using one, or sometimes two, check characters.2. Encoding Data ScopeCode 11 Barcode for Java supports:

  • 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
  • -(Dash)
3. How to Generate Barcode Image in Standalone Java Applications?

The following code extends strates how to create a barcode in a Java class

 

1            Linear linear = new Linear(); 2            linear.setData("123456789"); 3            linear.setType(Linear.CODE11); 4            linear.renderBarcode("c:/code11.gif"); 

 

 

  • Create a Linear object (line 1)
  • Set Linear object properties (line 2-3)
  • Save into gif file (line 4)

 

4. How to Generate Barcode Image in Web Applications?

There are two ways to create barcode images in your Java Web applications.

  1. This is the simplest way to stream barcode image using our provided barcode servlet classes.

    And it willNot save barcode imagesIn your server side.

    • UnderDemoPackage, copyBarcodeFolder to your java servlet container like tomcat.
    • To test your installation, gotoHttp: // YourDomain: Port/barcode/linear? Data = 123456789 & Type = CODE11
    • To create barcode image in your JSP or html page, you can pass the url to IMG tag src value. For example,

  2. The second method is similar with the way to generate barcode in Java applications.
    • Create a barcode image in server side

       

      1            Linear linear = new Linear(); 2            linear.setData("123456789"); 3            linear.setType(Linear.CODE11); 4            linear.renderBarcode("C:/Tools/Tomcat 5.5/webapps/YourWebApp/bimages/barcode.gif"); 

       

    • In your JSP page, you can using IMG tag to display generated image, like

 

5. How to Generate Barcode Image in JasperReports?

The following Jasper XML content into strates how to insert a barcode into jasperreports

<import value="com.barcodelib.barcode.BarcodeJasperFactory"/> 

Import class barcodejasperfactory to report.

<image scaleImage="Clip" hAlign="Center">     <reportElement x="50" y="110" width="515" height="120"/>     <graphicElement/>     <imageExpression class="net.sf.jasperreports.engine.JRRenderable">
<![CDATA[new com.barcodelib.barcode.BarcodeJasperRenderer(BarcodeJasperFactory.createLinear(1, "47082163"))]]></imageExpression> </image>
You must get a barcode in 10 minutes for the next package.
A few more records are generated, and you will find that the barcode package is not free.
You can only use the trial version without paying the money. The trial version will randomly Add the red barcodelib.com in your barcode.
I used a white image to hide the upper half of the image. Although it was flat, the result was good.
In this way, you can use the trial version equivalent to the official version for free.
In the end, if you want to send me an official version, it saves me the trouble.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.