Code 128 Barcode Width in Java
4 posts • Page 1 of 1
Code 128 Barcode Width in Java
Hi, all,
The width of Code 128 generated in Java application is much larger than the printing space I have on the label. Even setting the bar width to 1 pixel also cannot meet my requirement. I tried to scale the Code 128 barcode image but no result happened. Is there any way to further reduce the width of the Code 128 barcode image in my Java application?
The width of Code 128 generated in Java application is much larger than the printing space I have on the label. Even setting the bar width to 1 pixel also cannot meet my requirement. I tried to scale the Code 128 barcode image but no result happened. Is there any way to further reduce the width of the Code 128 barcode image in my Java application?
- candysmith
- Posts: 2
- Joined: Wed May 23, 2012 12:13 am
Re: Code 128 Barcode Width in Java
It comes down to the resolution of your printer. If you set the bar width to be 1 pixel and produce the barcode too large, then you scan try and scale. But the generated barcode image will be not clear. A printer needs at least 300 dpi barcode.
- David_3
- Posts: 1
- Joined: Fri May 25, 2012 6:00 am
Re: Code 128 Barcode Width in Java
How did you print the barcode image?
If you are printing a raster image, scaling will happen otherwise you should get a small barcode on a printer - because printer resolution is usually much higher than screen. If you print pixel-to-pixel, scaling 5 times (96 dpi -> 600 dpi) give you approximately the same size as laid out at screen.
For highest quality possible, consider using code128 fonts instead: http://www.morovia.com/fonts/code128/.
If you are printing a raster image, scaling will happen otherwise you should get a small barcode on a printer - because printer resolution is usually much higher than screen. If you print pixel-to-pixel, scaling 5 times (96 dpi -> 600 dpi) give you approximately the same size as laid out at screen.
For highest quality possible, consider using code128 fonts instead: http://www.morovia.com/fonts/code128/.
The information above is provided "AS IS", with no warranties, and confers no rights.
-
glitch - Support Engineer
- Posts: 198
- Joined: Wed May 14, 2008 2:42 pm
Re: Code 128 Barcode Width in Java
So you mean to call barcode.setResolution(300), that is ok? I just have a try and it really reduce the barcode width. The generated barcode image seems merging some bars on the screen, but is clearly separated on zooming. But I don’t know what the result on the printer and scanner is?David_3 wrote:It comes down to the resolution of your printer. If you set the bar width to be 1 pixel and produce the barcode too large, then you scan try and scale. But the generated barcode image will be not clear. A printer needs at least 300 dpi barcode.
- candysmith
- Posts: 2
- Joined: Wed May 23, 2012 12:13 am
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests