0 votes

Hi

We wanted to print 25 chars code128 barcode on 3 inch label.

Using default render ->makes the barcode cross the Label boundries.

We used b.savedpi(string,imagetype.png,150,150) ->Then image generated properly fits into the 3 inch label but it not readable when read on 203 DPI Thermal Printer.

When same label file ->Crystal Report is printed on Laser Printer 600 dpi ->it is properly readable.

Tested for value SurjitKumarAggarwar123456

Limilabs Support team says that we should use Printer extact DPI, but no example is given and we are struct

We did not find any parameter /method to specify the printer dpi

Thanks in advance

Suresh Bansal

by
retagged by

1 Answer

0 votes

Use 203 on 203dpi printer and 600 on 600dpi printer.

Use NarrowBarWidth (set it to e.g. 2) property to make barcode wider, if it's too small and barcode is unreadable.

If you use non printer dpi value, your barcode image is going to be blurry in most cases. Of course 150 on 600dpi won't look bad as 600 is divisible by 150.

You can't control the barcode width directly as all barcode bars must
have the same width.

You can use NarrowBarWidth property to set the width of the narrow bar.

If the bar width (NarrowBarWidth) is set to 2 and you've got 10 bars in your barcode then the barcode is 20 points wide.

You can not scale it to take 21 points,
because that would mean that one bar is wider then the rest.
Such barcode most likely would not be readable.

That's why you are not allowed to change the width of the barcode only
the width of single bars.

For XDpi parameter you should choose the target device/printer resolution.

For example if you set the resolution to 300dpi.
150 pixels will take about 0.5 inch.
For 600dpi, 150 pixels take twice less space (0.25 inch).

So if your printer has high resolution you can set width more accurately.

by (297k points)
Hi

In the above if I use

b.savedpi(string,imagetype.png,203,203) on 203 DPI Label Printer ->Resulting bar code width is too small (just 50%) as we were told that default is 100 and again there is readable problem

To increase the width if we set
NarrowBarWidth = 2 then width may again increase to double ->so where is the advantage.

Idea is produce approx 25 Chars Barcode Code128 on 3 Inch label with proper reading.

It will be good , if you could try out approx 25 Characters say with value   SurjitKumarAggarwal123456  and printed on 3 Inch label on 203 DPI Label Printer with proper readability and send that syntex.

Suresh Bansal
I think you still don't understand what dpi is.

203 dpi is the printer resolution and it means your printer can print 203 vertical lines on 1 inch. It can't print any more.

The smallest bar it can print is thus 1/203 inch wide.

In code128, 25 chars take: (1+25+1+1) * 11 = 308 bars

This includes start, stop and checksum (we assume you don't use numbers, as those are compressed - numbers only, take ~2 times less space)

308 bars * 1/203 = 1.52 inch

If you use NarrowBarWidth = 2 (bar is 2/203 inch wide then)

308 bars * 2/203 = 3.03 inch

You can not (it is impossible) to create barcode, that has 308 bars and takes, for example, 2 inches - This is limited by your printer resolution.
From above I understand, we can not print 25 Character Barcode on 203 DPI Printer using any of properties /methods of Barcode.dll

a) But on 300 DPI Thermal can we print readable barcode using

b.savedpi(string,imagetype.png,300,300)  and
b.NarrowBardwidth = 2

OR

b.savedpi(string,imagetype.png,150,150) as 300 is divisible by 2

b) How many max character we can print using Code128 on 203 DPI Printer and syntex for that.

Bansal
> we can not print 25 Character Barcode on 203 DPI Printer

How did you come to this conclusion?

You can print 25 character barcode on 203dpi printer.

I showed you - it will be 1.5 inch wide -or- 3 inches wide, if you set NarrowBarWidth=2.

You can print as many characters you want. There is no such limit in Barcode.dll.

If you want to get proper results you MUST use target device dpi.
Why do you insist on values like 150, if your printer is 203 or 300 dpi - it makes no sense!
...