-
Notifications
You must be signed in to change notification settings - Fork 0
/
example-labels.html
592 lines (547 loc) · 12.7 KB
/
example-labels.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>example labels</title>
<script src='http://code.jquery.com/jquery-2.1.4.min.js'></script>
<script src='jflower.js'></script>
<style>
@page { /* define the printed page size */
margin: 0;
size: A4 portrait;
}
body {
margin: 0;
padding: 0;
font-family: Arial, Helvetica, sans-serif;
font-size: 10pt;
}
.box {
position: absolute;
background-color: #ffffe8; /* so we can see them on the screen */
overflow: hidden; /* critical: this is what decides where content
should be moved to the next box */
}
.box *:first-child {
margin-top: 0; /* this avoids blank margins at the top of boxes,
because absolute elements don't collapse their vertical margins */
}
.page {
position: relative; /* so boxes and background are relative to page */
width: 209mm; /* our page size in absolute units */
height: 295mm; /* less than A4 because Chrome overflow physical page if exactly the same as @page */
overflow: hidden; /* just precautionary */
outline: 1px solid black; /* so we can see the page edges on screen */
}
.background {
position: absolute;
top: 0;
left: 0;
width: 100%;
}
@media print {
/* Don't actually print the guides we had on screen */
.page {
outline: none;
page-break-before: always;
}
.page:first-child {
page-break-before: avoid;
}
@-moz-document url-prefix() { /* Firefox only printing bug workround */
.page {
margin-top: 1px;
top: -1px;
}
}
.box {
background-color: white;
}
}
/* some styling for the label content: */
.label {
font-size: 10pt;
}
.labelinfo {
font-weight: bold;
text-align: right;
}
</style>
<script>
/* run jflower when the document has loaded */
$(function(){
$(".page").flow(".content", {pagination: "repeat"});
});
</script>
</head>
<body>
<!-- our page definition: just one, repeated indefinitely, containing 16 boxes sized
and positioned for the label blanks on which we would print.
You might want to leave some margins either by making the boxes smaller than the
labels or by assigning some margins in CSS to the boxes themseleves
-->
<div class="page">
<div class="box" style="left: 15mm; top: 15.9mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 15.9mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 49.8mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 49.8mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 83.7mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 83.7mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 117.6mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 117.6mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 151.5mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 151.5mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 185.4mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 185.4mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 219.3mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 219.3mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 15mm; top: 253.2mm; width: 90mm; height: 28mm"></div>
<div class="box" style="left: 116mm; top: 253.2mm; width: 90mm; height: 28mm"></div>
</div>
<!-- some sample content: 40 mailing labels.
Imagine these being generated from a database perhaps - though just generating the HTML directly
in that case might be just as easy.
Thanks http://www.randomthing.me/ !
-->
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 432372</div>
<div class='addressee'>Joseph Anderson</div>
<div class='address'>
1095 Jackson Way<br>
Albuquerque<br>
CT 12345
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 864712</div>
<div class='addressee'>Margaret Adams</div>
<div class='address'>
636 Main Way<br>
Raleigh<br>
WV 23456
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 343003</div>
<div class='addressee'>Gary Daniels</div>
<div class='address'>
166 9th St<br>
Pembroke Pines<br>
SC 34567
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 859402</div>
<div class='addressee'>Carl L. Sanders</div>
<div class='address'>
1233 Jackson Ave<br>
Cedar Rapids<br>
CO 45678
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 369323</div>
<div class='addressee'>Charles Robinson</div>
<div class='address'>
151 Willow Way<br>
Broken Arrow<br>
IL 56789
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 369021</div>
<div class='addressee'>Marie Sanchez</div>
<div class='address'>
787 South Way<br>
Moreno Valley<br>
AZ 67890
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 519319</div>
<div class='addressee'>Johnny Webb</div>
<div class='address'>
1315 4th Lane<br>
Toledo<br>
GA 78901
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 654739</div>
<div class='addressee'>Howard Harrison</div>
<div class='address'>
521 Chestnut Lane<br>
Glendale<br>
NH 89012
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 991672</div>
<div class='addressee'>François Tucker</div>
<div class='address'>
460 Elm Way<br>
Rochester<br>
WV 90123
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 776795</div>
<div class='addressee'>Lois Perez</div>
<div class='address'>
887 Highland Dr<br>
Escondido<br>
SD 54321
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 435153</div>
<div class='addressee'>Evelyn Miller</div>
<div class='address'>
963 2nd Ave<br>
Beaumont<br>
AK 65432
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref1 820693</div>
<div class='addressee'>Robin Richardson</div>
<div class='address'>
886 Meadow Way<br>
Lubbock<br>
FL 76543
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 533355</div>
<div class='addressee'>Craig Moore</div>
<div class='address'>
569 5th Way<br>
Manchester<br>
MS 87654
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 865858</div>
<div class='addressee'>Anthony Long</div>
<div class='address'>
106 South St<br>
Orlando<br>
MN 98765
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 805226</div>
<div class='addressee'>Marie Wood</div>
<div class='address'>
555 View Ct<br>
Stockton<br>
NC 19876
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 13868</div>
<div class='addressee'>Russell F. Wells</div>
<div class='address'>
980 9th St<br>
North Las Vegas<br>
NJ 21098
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 13868</div>
<div class='addressee'>William F. Collins</div>
<div class='address'>
293 Cedar Ct<br>
San Antonio<br>
NE 32109
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 629089</div>
<div class='addressee'>Wayne Taylor</div>
<div class='address'>
1027 Lake Ct<br>
El Monte<br>
IA 43210
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 483279</div>
<div class='addressee'>Victor Sanders</div>
<div class='address'>
846 Pine Blvd<br>
Killeen<br>
TN 67584
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 559468</div>
<div class='addressee'>Ernest Ross</div>
<div class='address'>
58 11th Dr<br>
Aurora<br>
WI 76859
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 527065</div>
<div class='addressee'>Juan Peterson</div>
<div class='address'>
962 5th Lane<br>
Oakland<br>
ID 87960
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 900081</div>
<div class='addressee'>Justin Baker</div>
<div class='address'>
296 Wilson Dr<br>
Flint<br>
CO 98071
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 871138</div>
<div class='addressee'>Keith Morris</div>
<div class='address'>
1128 West St<br>
Lowell<br>
VA 19283
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 561456</div>
<div class='addressee'>Sara Black</div>
<div class='address'>
522 1st Lane<br>
South Bend<br>
MD 21394
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 506728</div>
<div class='addressee'>Jesse Ford</div>
<div class='address'>
58 6th Ct<br>
Lincoln<br>
DE 32419
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 661434</div>
<div class='addressee'>Peter Fisher</div>
<div class='address'>
1131 Hill Blvd<br>
Madison<br>
KS 43520
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 529331</div>
<div class='addressee'>Ralph Henry</div>
<div class='address'>
1241 Center Ct<br>
Chandler<br>
ME 54630
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 791057</div>
<div class='addressee'>Lori Rivera</div>
<div class='address'>
1201 Meadow Ave<br>
Fargo<br>
GA 87098
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 538897</div>
<div class='addressee'>Jennifer U. Morales</div>
<div class='address'>
1238 Waze St<br>
Aurora<br>
NH 78698
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 401747</div>
<div class='addressee'>Lois Butler</div>
<div class='address'>
1059 Elm Blvd<br>
Gresham<br>
MS 76598
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 13868</div>
<div class='addressee'>Eric Cooper</div>
<div class='address'>
758 10th Blvd<br>
Sacramento<br>
MN 65987
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 273853</div>
<div class='addressee'>Shirley Rivera</div>
<div class='address'>
1148 View Way<br>
West Jordan<br>
PA 54980
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 593003</div>
<div class='addressee'>Janet Garcia</div>
<div class='address'>
9 Walnut Lane<br>
St. Louis<br>
VA 54097
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 895534</div>
<div class='addressee'>Joseph Owens</div>
<div class='address'>
795 Jackson Lane<br>
Springfield<br>
IL 87453
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 210732</div>
<div class='addressee'>Bonnie Mason</div>
<div class='address'>
985 Spring Ave<br>
Lansing<br>
TX 65487
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 259300</div>
<div class='addressee'>Carlos Perez</div>
<div class='address'>
1072 Forest Ct<br>
Palm Bay<br>
AR 65421
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 926064</div>
<div class='addressee'>Richard Barnes</div>
<div class='address'>
674 Main St<br>
Fairfield<br>
NV 54989
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 293938</div>
<div class='addressee'>Michelle Morris</div>
<div class='address'>
1190 3rd Dr<br>
Charlotte<br>
IN 65982
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 466061</div>
<div class='addressee'>Cheryl Allen</div>
<div class='address'>
809 4th Lane<br>
Thousand Oaks<br>
OH 45222
</div>
</div>
</div>
<div class='content'>
<div class='label'>
<div class='labelinfo'>ref 631163</div>
<div class='addressee'>Roy Ortiz</div>
<div class='address'>
485 West Ct<br>
Spokane<br>
ME 65877
</div>
</div>
</div>
</body>
</html>