[barcode] Printing label sheets

Brendon Oliver brendon.oliver@redsheriff.com
Thu Jun 9 02:26:59 CEST 2005


Hi Max,

Thanks for your reply.

On Tuesday 07 June 2005 11:12, Maximilian HEISE wrote:

> 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).
>
> 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.

Yes - it appears that both -g's get_geometry() and -t's get_table() both set 
xmargin0/1 and ymargin0/1, so if you've supplied margins for both options, 
then whichever option you've given last is the one whose margins are applied.  
The comment circa line 470 in main.c is the giveaway:
	/* FIXME: print warnings for incompatible options */
(grrrr).

So, what I'm working with now is -t to set row x col, and -g to set the size 
of the label (neither with margins).  That's giving me a sheet which almost 
fist horizontally, bit still no joy vertically.  I think I will have to hack 
something up to allow you to set a page header or leader space to indicate 
where printing should start.  Without that, barcode wants to place the 3x15 
rows of labels centered on the sheet.

> 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.

> -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.

One question here with -m:  If I have -g 51x15 to set the label size (talking 
in mm here).  If I set -m 2.5x2, should that give me a printed barcode size 
of 46mm x 11mm (ie 51 - 2.5 - 2.5 / 15 - 2 - 2 since its symmetrical) which 
is rouhgly centered within the label, or should I get a label 51x15mm which 
is _surrounded_ by a 2.5mm margin left & right and 2mm margin top & bottom - 
I'm not sure what it _should_ be doing.

On the whole, I find the manpage rather ambiguous as far as the margin 
descriptions go.  If I can figure out how it _should_ be working I may 
rewrite it (at least for our internal purposes!). ;-)

> 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.

Heh, that's exactly what I'm doing... have included a bunch of fprintf()'s too 
so I can see how the cmdline options are being used - just not getting my 
head around it yet.

> 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].

Yes - but you can have multiple -u which resets the units of measure for 
following arguments (crazy if you ask me: who would be mad enough to mix pt, 
mm, cm and inches in the one command!).  So my first arg is -u mm (I also set 
BARCODE_UNIT=mm just to be sure).

Thanks for your thoughts.

Cheers,

- Brendon.

-- 

Nielsen//NetRatings
Brendon Oliver
[brendon.oliver@redsheriff.com]

96-98 Market Street	  +61 3 8606 4035 tel
South Melbourne VIC 3205  +61 3 8606 4001 fax
Australia                 +61 411 048 342 mob

This message and any files transmitted with it are confidential and intended 
solely for the use of the individual or entity to whom they are addressed. If 
you are not the intended recipient, you are hereby notified that any use or 
dissemination of this communication is strictly prohibited. If you have 
received this message in error please notify us immediately by return email 
or telephone +61 (3) 8606 4035, then delete this message. Any views expressed 
in this messageare those of the individual sender and many not necessarily 
reflect the views of Nielsen//NetRatings.
---
The heaviest object in the world is the body of the woman you have ceased
to love.
		-- Marquis de Lac de Clapiers Vauvenargues

 10:10:27 up 9 days, 22:56,  1 user,  load average: 0.13, 0.08, 0.18



More information about the barcode mailing list