[barcode] Printing label sheets

Maximilian HEISE max.heise@gmx.net
Tue Jun 7 03:12:43 CEST 2005


Hi Brendon,

i had a related problem, but i did not have margins on the blank sheets 
on top and bottom, so i got hit by the printer HW margin.

The current table mode knows about 6 margins (four starting from left 
ccw=>left,bottom,right,top and two internal ones) xmargin0, ymargin0, 
xmargin1, ymargin1, ximargin and yimargin (the last ones are symmetrical 
applied if i remember correctly).

But please have a look at the doc at http://ar.linux.it/software/barcode 
to be sure.

With -t you set the four margins around xmargin0, ymargin0, xmargin1, 
ymargin1. With -g you only set xmargin0 and ymargin1, i do not think you 
should set margins with -g when printing tables. With -m you set the two 
internal margins. Note that if you do not specify the internal margina 
they will be set to 10pt (10 * 25,4mm * 72 = 3,527mm), as the a standard 
value.

Quoting from the doc mentioned above:

-g geometry
     The geometry argument is of the form "[<width> x <height>] [+ 
<xmargin> + <ymargin>]" (with no intervening spaces). Unspecified margin 
values will result in no margin; unspecified size results in default 
size. The specified values represent print points by default, and can be 
inches, millimeters or other units according to the -u option or the 
BARCODE_UNIT environment variable. The argument is used to place the 
printout code on the page. Note that an additional white margin of 10 
points is added to the printout. If the option is unspecified, 
BARCODE_GEOMETRY is looked up in the environment, if missing a default 
size and no margin (but the default 10 points) are used.
-t table-geometry
     Used to print several barcodes to a single page, this option is 
meant to be used to print stickers. The argument is of the form 
"<columns> x <lines> [+ <leftmargin> + <bottommargin> [- <rightmargin> 
[- <topmargin>]]]" (with no intervening spaces); if missing, the top and 
right margin will default to be the same as the bottom and left margin. 
The margins are specified in print points or in the chosen unit (see -u 
below). If the option is not specified, BARCODE_TABLE is looked up in 
the environment, otherwise no table is printed and each barcode will get 
its own page. The size (but not the position) of a barcode item within a 
table can also be selected using -g (see "geometry" above), without 
struggling with external and internal margins. I still think management 
of geometries in a table is suboptimal, but I can't make it better 
without introducing incompatibilities.
-m margin(s)
     Specifies an internal margin for each sticker in the table. The 
argument is of the form "<xmargin>,<ymargin>" and the margin is applied 
symmetrically to the sticker. If unspecified, the environment variable 
BARCODE_MARGIN is used or a default internal margin of 10 points is used.

So AFAIK it should not be a problem to set the things you need. Have a 
look at main.c, functions get_geomety, get_margin, get_table.

I did not look at the cmd line parsing, but i guess if -g overrides -t 
then you have -g after -t? The -u can be applied more than once on the 
cmd line to change the units (mm, inch, pt) in use, so logically the cmd 
line is parsed one after another starting from argv[1].

Hope this helps

Regards
Max


> Hi all,
> 
> I'm trying to layout a sheet of sticky labels to print barcodes in bulk for 
> our tape library but cannot seem to get it "just right".
> 
> Part of the problem seems to be that the blank sheets we're using have a 15mm 
> top & bottom "margin", and barcode seems to want to use the whole page, the 
> first label printing just a few mm from the top (or bottom - whichever way 
> you want to look at it).  I can't seem to tell it about the 15mm offset to 
> the first label (subsequent rows have about a 3mm vertical gap between them). 
> I've had no problem with the horizontal positioning - it's only the vertical 
> which is causing me headaches.
> 
> In case anyone's familiar, these are Avery DL45 A4 label sheets - 3 cols x 15 
> rows, and have the best "fit" for our tapes out of all the sticky labels 
> we've tried.
> 
> Failing that, can anyone give me a rundown on how the various margin settings 
> are intended to work?  So far, it seems to me that if you have margins with 
> both -t and -g, that the -g settings override -t.  I've tried diddling the 
> starting offset in the code but must be missing something obvious (still 
> trying though).
> 
> Not that it should make any difference, but we're printing plain EAN-13 
> labels, and our tape library has no problem reading the barcodes.  This is 
> purely a sheet-layout problem.
> 
> Thanks for any help or suggestions.
> 
> Cheers,
> 
> - Brendon.
> 


-- 
Maximilian HEISE
max.heise@gmx.net, Maximilian.Heise@upc.edu
Key fingerprint = 1801 8B78 CF81 B20E 5529  0F84 4E59 8AB5 D5D4 0E99


More information about the barcode mailing list