Mahesh Rud

Greenhorn
+ Follow
since Sep 21, 2010
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mahesh Rud

Hi,

I use JBarcodeBean to display barcodes on JSP.

The barcode type rendered on screen is Code39. I was to display the asterisk (*) sentinel. That is both start and stop sentinel.

How to achieve this?

Please provide some pointers.

Thanks
Strive
Hi,

I have to display barcodes on screen.

I am able to display barcodes on screen. But when I take a print out of that and try to scan, the barcode scanners/readers are not recognizing the barcode.

Implementation details: I created barcode using iText and converted it into awt image and displayed it using Graphics2D.

Is my way of testing is right? Are there specific printers to print pages like this which contain barcode images?

Any pointers would be helpful.

Thanks
strive
13 years ago
Thanks for the responses

I am able to do that.
14 years ago
JSP
Hi,

I am able to display the barcode39 image in JSP. I need to display the text also below the image which i am not able to do. Please help me.

I am using iText to generate the barcode. iText has 2 options to create barcode39. createImageWithBarcode and createAwtImage.

createImageWithBarcode comes with text below the barcode by default. But i am unable to convert this iText Image type to any other image like java.awt.Image or BufferedImage. And also i am not able to write this image to JSP. If there is way to convert the image or display it as it is on JSP then it solves my problem. Please let me know is there any way.

I had to use createAwtImage method to get image. This atleast i am able to display image on JSP. But in this case i am not able to display text under barcode.

for the createAwtImage My servlet code is:

Barcode39 codeEAN = new Barcode39();
codeEAN.setBarHeight(100);
codeEAN.setSize(500);
codeEAN.setCode("123456789");
Image img = codeEAN.createAwtImage(Color.BLACK, Color.WHITE);

BufferedImage bi = new BufferedImage(img.getWidth(null), img
.getHeight(null), BufferedImage.TYPE_INT_RGB);
Graphics2D g2d = bi.createGraphics();
g2d.drawImage(img, 0, 0, null);

response.setContentType("image/png");
final OutputStream outputStream = response.getOutputStream();
ImageIO.write(bi, "png", outputStream);
outputStream.close();

If i get solution for any one i will be very happy. Please let me know if there are any pointers.

Thanks
Mahesh
14 years ago
JSP
Hi,

How to call a java class method from src attribute of <IMG> tag. The image is created in a method of utility class.

Regards
Strive

14 years ago
JSP
Hi,

i have to display a barcode image in JSP.

MY requirements are:

1. When page is loading barcode should be rendered based on some parameters passed.
2. JSP rendering is in diff module.
3. I have to write a utility method, which creates barcode image and returns image.

My questions are:

1. How to call a java class method from src attribute of <IMG> tag.
2. I have a class which uses iText to create barcodes for pdf document. I can reuse the same method which returns java.awt.Image.

Is my approach right? or there is a better way of acheiving this easily.

regards
strive
14 years ago
JSP