1 <?php include "../../common_php.inc"; ?>
3 <?php gLabelsHeader("docs"); ?>
5 <h1 class="doc">Defining new gLabels templates for gLabels 2.0.x</h1>
8 Predefined templates are defined by XML files located in
9 <i>${prefix}/share/glabels/</i>,
10 where <i>${prefix}</i> is usually something like
11 <i>/usr/local</i> or <i>/usr</i> depending
12 on the configuration option <i>prefix</i>. gLabels will
13 use all files of the form <i>*-templates.xml</i> or <i>*.template</i>,
14 that it finds in <i>${prefix}/share/glabels/</i> and <i>${HOME}/.glabels/</i>.
15 Additional templates can be added by creating additional
16 <i>*.template</i> files in either of these directories.
19 <li>The format for these files is defined in the DTD: <?a("/doc/glabels-2.0.dtd.txt","glabels-2.0.dtd");?>. (This DTD also describes other XML formats used by glabels.)</li>
22 <h2>Assumptions/caveats</h2>
24 <li>A sheet contains only one size of label or card (if a sheet contains more than one size of item, it can be split into multiple templates for multiple pass printing)</li>
25 <li>Distances can be expressed in units of <i>pt</i>, <i>in</i>, <i>mm</i>, <i>cm</i>, or <i>pc</i>. For example: "1.0in" or "2.54cm". If no units are specified, computer points (<i>pt</i>) will be assumed (1 pt = 1/72 in = 0.352778 mm).</li>
29 <h2><i>*-templates.xml</i> and <i>*.template</i> files</h2>
31 <?xml version="1.0"?>
32 <Glabels-templates>
34 ...<i>templates</i>...
36 </Glabels-templates>
40 <h2>Example Template</h2>
42 <Template name="Avery 8160" size="US-Letter" description="Mailing Labels">
43 <Label-rectangle id="0" width="189" height="72" round="5">
44 <Markup-margin size="5"/>
45 <Layout nx="3" ny="10" x0="11.25" y0="36" dx="200" dy="72"/>
46 </Label-rectangle>
47 <Alias name="Avery 5160"/>
48 <Alias name="Avery 6233"/>
53 <h2>Template Node</h2>
55 A <i>Template</i> node describes a single stationary product. It must contain
56 one instance of any type of Label node (<i>Label-rectangle</i>,
57 <i>Label-round</i>, or <i>Label-cd</i>). This node can be followed by zero
58 or more <i>Alias</i> nodes.
63 <td valign="top">name</td>
64 <td>Name or part # of stationary product. E.g. "Avery 8160"</td>
67 <td valign="top">size</td>
68 <td>Size of sheet. E.g., "US-Letter," "A4", ...</td>
71 <td valign="top">description</td>
72 <td>Description of stationary product. E.g, "Mailing Labels."</td>
75 <td valign="top">_description</td>
76 <td>Translatable description of stationary product. E.g, "Mailing Labels." (Only useful for predefined templates)</td>
79 <td valign="top">width</td>
80 <td>Page width. Only valid if size="Other"</td>
83 <td valign="top">height</td>
84 <td>Page height. Only valid if size="Other"</td>
88 <h2>Label-rectangle Node</h2>
90 A <i>Label-rectangle</i> node describes the dimensions of a single label or
91 business card that is rectangular in shape (may have rounded edges).
96 <td valign="top">id</td>
97 <td>Reserved for future use. Should always be 0.</td>
100 <td valign="top">width</td>
101 <td>Width of label/card</td>
104 <td valign="top">height</td>
105 <td>Height of label/card</td>
108 <td valign="top">round</td>
109 <td>Radius of corners. For items with square edges (business cards)
110 , the radius should be 0.</td>
113 <td valign="top">x_waste</td>
114 <td>Amount of horizontal waste (over-print) to allow. This is useful for minimizing alignment problems when using non-white backgrounds (e.g. images).</td>
117 <td valign="top">y_waste</td>
118 <td>Amount of vertical waste (over-print) to allow. This is useful for minimizing alignment problems when using non-white backgrounds (e.g. images).</td>
122 <?img("glabels-template-label.png","Label illustration");?>
124 <h2>Label-round Node</h2>
126 A <i>Label-round</i> node describes the dimensions of a simple round label (not a CD).
131 <td valign="top">id</td>
132 <td>Reserved for future use. Should always be 0.</td>
135 <td valign="top">radius</td>
136 <td>Radius (1/2 diameter) of label</td>
139 <td valign="top">waste</td>
140 <td>Amount of waste (over-print) to allow. This is useful for minimizing alignment problems when using non-white backgrounds (e.g. images).</td>
144 <h2>Label-cd Node</h2>
146 A <i>Label-cd</i> node describes the dimensions of a CD, DVD, or business card
152 <td valign="top">id</td>
153 <td>Reserved for future use. Should always be 0.</td>
156 <td valign="top">radius</td>
157 <td>Outer radius of label</td>
160 <td valign="top">hole</td>
161 <td>Radius of concentric hole</td>
164 <td valign="top">width</td>
165 <td>If present, the label is clipped to the given width. (Useful for "business card CDs").</td>
168 <td valign="top">height</td>
169 <td>If present, the label is clipped to the given height. (Useful for "business card CDs").</td>
172 <td valign="top">waste</td>
173 <td>Amount of waste (over-print) to allow. This is useful for minimizing alignment problems when using non-white backgrounds (e.g. images).</td>
177 <?img("glabels-template-cd.png","CD Label illustration");?>
180 <h2>Markup-margin Node</h2>
182 A <i>Markup-margin</i> describes a margin along all edges of a label.
187 <td valign="top">size</td>
188 <td>Size of the margin. I.e. the distance of the margin line from the
189 edge of the card/label.</td>
194 <h2>Markup-line Node</h2>
196 A <i>Markup-line</i> describes a markup line.
201 <td valign="top">x1</td>
202 <td>x coordinate of 1st endpoint of the line segment.</td>
205 <td valign="top">y1</td>
206 <td>y coordinate of 1st endpoint of the line segment.</td>
209 <td valign="top">x2</td>
210 <td>x coordinate of 2nd endpoint of the line segment.</td>
213 <td valign="top">y2</td>
214 <td>y coordinate of 2nd endpoint of the line segment.</td>
218 <h2>Markup-circle Node</h2>
220 A <i>Markup-circle</i> describes a markup circle.
225 <td valign="top">x0</td>
226 <td>x coordinate of circle origin (center).</td>
229 <td valign="top">y0</td>
230 <td>y coordinate of circle origin (center).</td>
233 <td valign="top">radius</td>
234 <td>Radius of circle.</td>
240 A label node may contain multiple <i>Layout</i> children. If labels are layed out in
241 a simple grid pattern, only one layout is needed. However, if labels are
242 layed out in multiple grids, such as a running bond pattern, multiple
243 <i>layout</i> tags can be used. Note: a single label can always be treated as
249 <td valign="top">nx</td>
250 <td>Number of labels/cards across in the grid (horizontal)</td>
253 <td valign="top">ny</td>
254 <td>Number of labels/cards up and down in the grid (vertical)</td>
257 <td valign="top">x0</td>
258 <td>Distance from left edge of sheet to the left edge of the left
259 column of cards/labels in the layout.</td>
262 <td valign="top">y0</td>
263 <td>Distance from the top edge of sheet to the top edge of
264 the top row of labels/cards in the layout.</td>
267 <td valign="top">dx</td>
268 <td>Horizontal pitch of grid.</td>
271 <td valign="top">dy</td>
272 <td>Vertical pitch of grid.</td>
276 <?img("glabels-template-layout.png","Layout illustration");?>
282 <td valign="top">name</td>
283 <td>The name or part # of a product with the same size and layout
284 characteristics.</td>
291 <?php gLabelsFooter(); ?>