[barcode] rotating a barcode

s.blood steve@copyleft.net
Thu, 14 Nov 2002 02:14:12 -0500 (EST)


Hello. 

I have recently undertaken a barcode project for managing invoices and
inventory at Copyleft.net. I have found GNU Barcode to be incredibly
helpful -- thanks to all for their work (btw, if any of you would like a
shirt or hat or whatever from Copyleft, I'd be more than happy to send
some out as tokens of appreciation for your code which will soon find
itself used here everyday. Just check out the site and drop me an email --
and, yes, I'll happily ship to Italy).

At any rate, one small thing I'd like to be able to do is rotate a barcode
90 degrees. I looked through the docs and couldn't find any mention of it.
After looking at the postscript output, I tried doing a regular expression
which swapped the x and y coordinates. So, this:

<snip>
%  height  xpos   ypos  width       height  xpos   ypos  width
   [72.00  68.34 280.00  2.54]      [72.00  71.70 280.00  1.19]
   [72.00  77.07 280.00  3.88]      [72.00  84.46 280.00  5.22]
</snip>

became this:

<snip>
%  height  xpos   ypos  width       height  xpos   ypos  width
   [2.54 280.00 68.34 72.00]      [1.19 280.00 71.70 72.00]
   [3.88 280.00 77.07 72.00]      [5.22 280.00 84.46 72.00]
</snip>


That seemed like a reasonable approach and the result was a barcode, but
the bars get munged somehow and are not decodable. I don't know much
postscript, so I couldn't figure out why that would be. I assumed the bars
were just rectangles defined by the above coordinates in which case it
wouldn't matter much if x and y were swapped...


I looked around the web some and found kbarcode which will allow you to
rotate a barcode but I couldn't locate the source code responsible for it. 

There was also a reference to using lout to rotate a barcode on this list 
a couple of years ago: 
   http://lists.linux.it/pipermail/barcode/2000-November/000012.html

I had some trouble getting lout to cooperate and figured before getting
too deep into it, I'd post a message here to see if there's not a simpler
way.

My use is just calling barcode from a script and incorporating the output
into a postscript document. I have no trouble when the barcode is read
left to right. 



Any help would be appreciated. Even something as little as "just use
lout, it'll be the easiest way".


Thanks,
steve blood