[barcode] barcode on PCL printer
r.krebs@netlab.ch
r.krebs@netlab.ch
Fri, 18 Oct 2002 17:33:23 +0200
Hello Andrea
The barcode reader is one which is embedded in a medical analyzer of Bayer,
so I don't know its brand.
I used code 128-C, but I think there's the same problem with other codes.
Here's an example:
Barcode_Encode_and_Print(data, stdout, width, height, xoffs, yoffs,
flags) ;
data = "123456789827"
width = 73 (25.8mm)
height = 34 (12mm)
xoffs = 22 (8mm)
yoffs = 136 (48mm)
-> This results in a scaling factor of 0.722772
Since the printout is done by the line
fprintf(f,"%c*c%.0fH", 27, ((j*scalef) - SHRINK_AMOUNT) * 10.0);
the result for the different bars will therefore be (SHRINK_AMOUNT = 0.15):
j = 1 -> 5.72 -> 5 decipoints
j = 2 -> 12.95 -> 12 decipoints
j = 3 -> 20.18 -> 20 decipoints
j = 4 -> 27.41 -> 27 decipoints
I changed the source to take as an additional parameter the SHRINK_AMOUNT,
so that it's possible to set it to 0.
As you can see, for example with a scaling factor of 0.78 and SHRINK_AMOUNT
of 0 you would get the sequence 7, 15, 23, 31. Since 2*7 != 15, this
barcode reader refused the code.
Best regards
Roland Krebs
|---------+---------------------------->
| | "Andrea Scopece" |
| | <a.scopece@vizzav|
| | i.it> |
| | |
| | 18.10.2002 16:55 |
| | |
|---------+---------------------------->
>---------------------------------------------------------------------------------------------------------------------------------------|
| |
| To: <barcode@lists.linux.it>, <r.krebs@netlab.ch> |
| cc: |
| Subject: Re: [barcode] barcode on PCL printer |
>---------------------------------------------------------------------------------------------------------------------------------------|
Thanks for the patch.
the pcl code is derived from a conversion of postscript engine,
and in the past, a bug (postcript bars are drawed providing the middle
coordinates of bars,
and pcl bars are drawed providing the upper-left corner of the bar), were
corrected.
Your patch probably correct another bug, altought I did't noticed it
before,
some users
reported difficult to read pcl barcode.
Please, can you report more info about this problem?
printer ?
barcode reader ?
encodings ?
size of barcode ?
Next week I will have available a POSTCRIPT/PCL printer, so I'll double
check
both output (PCL & PS).
Andrea Scopece
----- Original Message -----
From: <r.krebs@netlab.ch>
To: <barcode@lists.linux.it>
Sent: Friday, October 18, 2002 8:01 AM
Subject: [barcode] barcode on PCL printer
> Hi,
>
> I had a problem on some barcode readers to read labels printed with PCL
> (Since I don't use postscript, I don't know if the same problem also
exists
> there.)
> The reason was, that the width of the bars and white-spaces are rounded
to
> the next decipoint. This had the effect that a multiple-width bar was
> sometimes one decipoint wider than expected.
>
> The solution is to round the scaling-factor to 0.1:
>
> File pcl.c, line 117(?) after the '#endif'
> scalef = ((double)((int)(scalef * 10 + 0.5))) / 10;
>
> Best regards
> Roland Krebs
>
>
> _______________________________________________
> barcode mailing list
> barcode@lists.linux.it
> http://lists.linux.it/listinfo/barcode