labels(3)
NAME
PDF::Labels - Routines to produce formatted pages of mail
ing labels in PDF
SYNOPSIS
use PDF::Labels; Requires: PDF::Create
DESCRIPTION
GENERAL
Provides package PDF::Labels
- Package Global Variables:
- @PDF::Labels:PageFormats is a list of known page
- formats. Each
page format is a : delimited list of fields which - provide the
following properties about a page of labels:
pagewidth Width of actual page ininches
pageheight Height of actual page ininches
pagexoffset Offset from left edge ofpage to leftedge of first column oflabels in inchespageyoffset Offset from bottom edge ofpage tobottom edge of lowest rowof labelsxlabels Number of labels in eachrow
ylabels Number of labels in eachcolumn
labelwidth Width of each label ininches, includingmarginlabelheight Height of each label ininches, includingmarginlabelxmar Minimum Distance to offsetprinting fromleft and right edges oflabellabelymar Minimum distance to offsetprinting fromtop and bottom edges oflabelfontsize Size of font to use withthis label
linespacing Line spacing (points) touse with thislabel - SYNTAX
Example
use PDF::Create;
use PDF::Labels;$pdf = new PDF::Labels($PDF::Labels::PageFormats[0],filename=>'labels.pdf',
Author=>'PDF Labelmaker',
Title=>'My Labels');- $pdf->setlabel(5); # Start with label 5 on
- first page
- $pdf->label('John Doe', '1234 Some Street',
- 'Anytown, ID', '12345');
- $pdf->label('Jane Doe', '5493 Other Drive',
- 'Nowhere, CA', '92213');
- $pdf->label('Bob Smith', '392 Cedar Lane',
- 'Deep Shit, AR', '72134');
- $pdf->close();
- The above example will produce 3 labels on an
- 8.5x11 sheet with
three labels in a row and 10 rows of labels. The - labels are
2.625"x1". This is a common sheet-feed label. In - this case, the
three labels will be the last label of the second - row and the
first two labels of the third row. The labels can - be moved by
changing the parameter to the setlabel call. - Creation
$pdf = new PDF::Labels($PageFormat,
PDF::Create parameters- )
- $PageFormat is a string containing a single ele
- ment of PageFormats
or a custom page format specification in the same - format.
- PDF::Create parameters are described in the
- PDF::Create pod.
- Setup
$pdf->setlabel(n)- n is a number from 0 to maxlabels. Subsequent
- calls to create
labels will create labels starting from this posi - tion on the
page. Position 0 is the upper left label, working - across each
row down in columns.
i.e. 0 1 23 4 5
6 7 8
... - Setlabel will not go backwards. If n is less than
- the current
cursor position, a new page will be created. - Label Creation
$pdf->label('string1', 'string2', 'string3'[,- 'string4'...])
- As much of each string as possible will be placed
- on a seperate
line of the label. If there are more strings than - the label can
hold, extra strings will not be printed. - @(#) Labels.pm Last updated 01/02/10 18:59:54
- (SCCS Version 1.8)
AUTHOR
- Owen DeLong, owen@delong.com