[barcode] UNAPPLIED PCL PATCH

Andrea Scopece andrea.scopece@tiscali.it
Thu Dec 14 14:58:13 CET 2006


Dear all,

back in October 2002, a patch was sent to this list, about PCL codes.
Some problems may arise when printing small size barcodes using PCL.
Problem were related to two things:
	1) - an erroneous precision used to specify decipoints
	(look at ".0f" chnaged to hit my ".1f", in format specifier of printf.
	2) - an incorrect use of SHRINK_AMOUNT.

The proposed patch correct the problems, and was submitted to
the list and specifically to the maintainer, 
with reference to GNU barcode-0.98.

No one have submitted question about PCL output in the past few year,
so either, no one is using PCL printing or no one is printing small barcodes 
using PCL.

Richard, please, update your software with the proposed patch, 
before those errors will go around too much.

Alessandro, please, update cvs.

Best Regards

Andrea Scopece

 

----------  Forwarded Message  ----------

Subject: Re: [barcode] barcode on PCL printer
Date: Saturday 19 October 2002 05:06
From: "Andrea Scopece" <a.scopece@vizzavi.it>
To: r.krebs@netlab.ch
Cc: "Alessandro Rubini - FSFE" <rubini@fsfeurope.org>, barcode@lists.linux.it

Well, I finally double-checked PCL output versus PS output:

PS output use Points as unit of measure, with a precision of  1/100,
therefore equivalent to 1/7200 of Inch.

PCL output was using decipoints, with unitary precision, equivalent to 1/720
of Inch.

I changed pcl.c code, for use of decipoints with a precision of 1/10,
therefore
equivalent to PS output, and checked it, it look bar width were corrected,
but
x coordinates positions were a little different from PS output.
(probably when I writed pcl.c, and I looked manuals, I see the range value
(0-32676),
and don't see a note that command allow for 2 decimal places)

Finally I realized that when pcl.c was corrected for difference about
drawing from PS and PCL,
(PS line drawing need center coordinate of the bar, PCL rectangular are fill
needs left x coordinate of the bar), that patch don't take in account for
SHRINK_AMOUNT.

Now, PCL output value look like PS output value.

Please, try the following patch:

-----------------------snip------------------------
diff -ur barcode-0.98/pcl.c work2/pcl.c
--- barcode-0.98/pcl.c Tue Nov 13 13:38:19 2001
+++ work2/pcl.c Sat Oct 19 02:41:08 2002
@@ -131,7 +131,7 @@
  if (isdigit (*ptr))   j = *ptr-'0';
  else                  j = *ptr-'a'+1;
  if (i%2) { /* bar */
-     x0 = bc->xoff + xpos;
+     x0 = bc->xoff + xpos + SHRINK_AMOUNT/2.0;
             y0 = bc->yoff + bc->margin;
             yr = bc->height;
             if (!(bc->flags & BARCODE_NO_ASCII)) { /* leave space for text
*/
@@ -145,10 +145,10 @@
   }
      }

-     fprintf(f,"%c&a%.0fH", 27, x0 * 10.0);
-     fprintf(f,"%c&a%.0fV", 27, y0 * 10.0);
-     fprintf(f,"%c*c%.0fH", 27, ((j*scalef)-SHRINK_AMOUNT) * 10.0);
-     fprintf(f,"%c*c%.0fV", 27, yr * 10.0);
+     fprintf(f,"%c&a%.1fH", 27, x0 * 10.0);
+     fprintf(f,"%c&a%.1fV", 27, y0 * 10.0);
+     fprintf(f,"%c*c%.1fH", 27, ((j*scalef)-SHRINK_AMOUNT) * 10.0);
+     fprintf(f,"%c*c%.1fV", 27, yr * 10.0);
      fprintf(f,"%c*c0P\n", 27);
  }
  xpos += j * scalef;

-----------------------snip------------------------

Best Regards

Andrea Scopece

-------------------------------------------------------


More information about the barcode mailing list