Skip to content

Commit 2ed2b01

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents 5ca9d31 + 312be98 commit 2ed2b01

File tree

3 files changed

+126
-1
lines changed

3 files changed

+126
-1
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4198,6 +4198,15 @@
41984198
"contributions": [
41994199
"code"
42004200
]
4201+
},
4202+
{
4203+
"login": "FlorestanII",
4204+
"name": "Johannes Pollitt",
4205+
"avatar_url": "https://avatars.githubusercontent.com/u/15015119?v=4",
4206+
"profile": "https://github.com/FlorestanII",
4207+
"contributions": [
4208+
"code"
4209+
]
42014210
}
42024211
]
42034212
}

CONTRIBUTORS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Thanks goes to all of these wonderful people ([emoji key](https://github.com/ken
6868
| [<img src="https://avatars.githubusercontent.com/u/181059?v=4" width="110px;"/><br /><sub>Juan Font</sub>](https://github.com/juanfont)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juanfont "Code") | [<img src="https://avatars.githubusercontent.com/u/13137708?v=4" width="110px;"/><br /><sub>Juho Taipale</sub>](https://github.com/juhotaipale)<br />[💻](https://github.com/snipe/snipe-it/commits?author=juhotaipale "Code") | [<img src="https://avatars.githubusercontent.com/u/1007419?v=4" width="110px;"/><br /><sub>Korvin Szanto</sub>](https://github.com/KorvinSzanto)<br />[💻](https://github.com/snipe/snipe-it/commits?author=KorvinSzanto "Code") | [<img src="https://avatars.githubusercontent.com/u/8513053?v=4" width="110px;"/><br /><sub>Lewis Foster</sub>](https://lewisfoster.foo/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=sniff122 "Code") | [<img src="https://avatars.githubusercontent.com/u/33877541?v=4" width="110px;"/><br /><sub>Logan Swartzendruber</sub>](https://github.com/loganswartz)<br />[💻](https://github.com/snipe/snipe-it/commits?author=loganswartz "Code") | [<img src="https://avatars.githubusercontent.com/u/1156208?v=4" width="110px;"/><br /><sub>Lorenzo P.</sub>](https://github.com/lopezio)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lopezio "Code") | [<img src="https://avatars.githubusercontent.com/u/33946590?v=4" width="110px;"/><br /><sub>Lukas Jung</sub>](https://github.com/m4us1ne)<br />[💻](https://github.com/snipe/snipe-it/commits?author=m4us1ne "Code") |
6969
| [<img src="https://avatars.githubusercontent.com/u/10965027?v=4" width="110px;"/><br /><sub>Ellie</sub>](https://leafedfox.xyz/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=LeafedFox "Code") | [<img src="https://avatars.githubusercontent.com/u/20960555?v=4" width="110px;"/><br /><sub>GA Stamper</sub>](https://github.com/gastamper)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gastamper "Code") | [<img src="https://avatars.githubusercontent.com/u/206553556?v=4" width="110px;"/><br /><sub>Guillaume Lefranc</sub>](https://github.com/gl-pup)<br />[💻](https://github.com/snipe/snipe-it/commits?author=gl-pup "Code") | [<img src="https://avatars.githubusercontent.com/u/733892?v=4" width="110px;"/><br /><sub>Hajo Möller</sub>](https://github.com/dasjoe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=dasjoe "Code") | [<img src="https://avatars.githubusercontent.com/u/3420063?v=4" width="110px;"/><br /><sub>Istvan Basa</sub>](https://github.com/pottom)<br />[💻](https://github.com/snipe/snipe-it/commits?author=pottom "Code") | [<img src="https://avatars.githubusercontent.com/u/810824?v=4" width="110px;"/><br /><sub>JJ Asghar</sub>](https://jjasghar.github.io/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jjasghar "Code") | [<img src="https://avatars.githubusercontent.com/u/40404495?v=4" width="110px;"/><br /><sub>James E. Msenga</sub>](https://github.com/JemCdo)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JemCdo "Code") |
7070
| [<img src="https://avatars.githubusercontent.com/u/6865786?v=4" width="110px;"/><br /><sub>Jan Felix Wiebe</sub>](https://github.com/jfwiebe)<br />[💻](https://github.com/snipe/snipe-it/commits?author=jfwiebe "Code") | [<img src="https://avatars.githubusercontent.com/u/43412008?v=4" width="110px;"/><br /><sub>Jo Drexl</sub>](https://www.nfon.com/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=drexljo "Code") | [<img src="https://avatars.githubusercontent.com/u/4807843?v=4" width="110px;"/><br /><sub>Austin Sasko</sub>](https://github.com/austinsasko)<br />[💻](https://github.com/snipe/snipe-it/commits?author=austinsasko "Code") | [<img src="https://avatars.githubusercontent.com/u/4875039?v=4" width="110px;"/><br /><sub>Jasson</sub>](http://jassoncordones.github.io)<br />[💻](https://github.com/snipe/snipe-it/commits?author=JassonCordones "Code") | [<img src="https://avatars.githubusercontent.com/u/76069640?v=4" width="110px;"/><br /><sub>Okean</sub>](https://github.com/Tinyblargon)<br />[💻](https://github.com/snipe/snipe-it/commits?author=Tinyblargon "Code") | [<img src="https://avatars.githubusercontent.com/u/6515064?v=4" width="110px;"/><br /><sub>Alejandro Medrano</sub>](https://www.lst.tfo.upm.es/alejandro-medrano/)<br />[💻](https://github.com/snipe/snipe-it/commits?author=amedranogil "Code") | [<img src="https://avatars.githubusercontent.com/u/58696401?v=4" width="110px;"/><br /><sub>Lukas Kraic</sub>](https://github.com/lukaskraic)<br />[💻](https://github.com/snipe/snipe-it/commits?author=lukaskraic "Code") |
71-
| [<img src="https://avatars.githubusercontent.com/u/1571724?v=4" width="110px;"/><br /><sub>Герхард PICCORO Lenz McKAY </sub>](https://github-readme-stats.vercel.app/api?username=mckaygerhard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mckaygerhard "Code") |
71+
| [<img src="https://avatars.githubusercontent.com/u/1571724?v=4" width="110px;"/><br /><sub>Герхард PICCORO Lenz McKAY </sub>](https://github-readme-stats.vercel.app/api?username=mckaygerhard)<br />[💻](https://github.com/snipe/snipe-it/commits?author=mckaygerhard "Code") | [<img src="https://avatars.githubusercontent.com/u/15015119?v=4" width="110px;"/><br /><sub>Johannes Pollitt</sub>](https://github.com/FlorestanII)<br />[💻](https://github.com/snipe/snipe-it/commits?author=FlorestanII "Code") |
7272
<!-- ALL-CONTRIBUTORS-LIST:END -->
7373

7474
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome!
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
3+
namespace App\Models\Labels\Tapes\Dymo;
4+
5+
6+
class LabelWriter_11354 extends LabelWriter
7+
{
8+
private const BARCODE1D_HEIGHT = 3.00;
9+
private const BARCODE_MARGIN = 1.80;
10+
private const TAG_SIZE = 2.80;
11+
private const TITLE_SIZE = 2.80;
12+
private const TITLE_MARGIN = 0.50;
13+
private const FIELD_SIZE = 2.80;
14+
private const FIELD_MARGIN = 0.15;
15+
16+
public function getUnit()
17+
{
18+
return 'mm';
19+
}
20+
public function getWidth()
21+
{
22+
return 57;
23+
}
24+
public function getHeight()
25+
{
26+
return 32;
27+
}
28+
public function getSupportAssetTag()
29+
{
30+
return true;
31+
}
32+
public function getSupport1DBarcode()
33+
{
34+
return true;
35+
}
36+
public function getSupport2DBarcode()
37+
{
38+
return true;
39+
}
40+
public function getSupportFields()
41+
{
42+
return 5;
43+
}
44+
public function getSupportLogo()
45+
{
46+
return false;
47+
}
48+
public function getSupportTitle()
49+
{
50+
return true;
51+
}
52+
public function preparePDF($pdf)
53+
{
54+
}
55+
56+
public function write($pdf, $record)
57+
{
58+
$pa = $this->getPrintableArea();
59+
60+
$currentX = $pa->x1;
61+
$currentY = $pa->y1;
62+
$usableWidth = $pa->w;
63+
$usableHeight = $pa->h;
64+
65+
// Wide 1D barcode on top
66+
if ($record->has('barcode1d')) {
67+
static::write1DBarcode(
68+
$pdf, $record->get('barcode1d')->content, $record->get('barcode1d')->type,
69+
$currentX, $currentY, $usableWidth, self::BARCODE1D_HEIGHT
70+
);
71+
$currentY += self::BARCODE1D_HEIGHT + self::BARCODE_MARGIN;
72+
$usableHeight -= self::BARCODE1D_HEIGHT + self::BARCODE_MARGIN;
73+
}
74+
75+
// 2D Barcode in left column
76+
if ($record->has('barcode2d')) {
77+
$barcodeSize = $usableHeight - self::TAG_SIZE;
78+
79+
static::writeText(
80+
$pdf, $record->get('tag'),
81+
$currentX, $pa->y2 - self::TAG_SIZE,
82+
'freesans', 'b', self::TAG_SIZE, 'C',
83+
$barcodeSize, self::TAG_SIZE, true, 0
84+
);
85+
static::write2DBarcode(
86+
$pdf, $record->get('barcode2d')->content, $record->get('barcode2d')->type,
87+
$currentX, $currentY,
88+
$barcodeSize, $barcodeSize
89+
);
90+
$currentX += $barcodeSize + self::BARCODE_MARGIN;
91+
$usableWidth -= $barcodeSize + self::BARCODE_MARGIN;
92+
}
93+
94+
// Right column
95+
if ($record->has('title')) {
96+
static::writeText(
97+
$pdf, $record->get('title'),
98+
$currentX, $currentY,
99+
'freesans', 'b', self::TITLE_SIZE, 'L',
100+
$usableWidth, self::TITLE_SIZE, true, 0
101+
);
102+
$currentY += self::TITLE_SIZE + self::TITLE_MARGIN;
103+
}
104+
105+
foreach ($record->get('fields') as $field) {
106+
static::writeText(
107+
$pdf, (($field['label']) ? $field['label'].' ' : '') . $field['value'],
108+
$currentX, $currentY,
109+
'freesans', '', self::FIELD_SIZE, 'L',
110+
$usableWidth, self::FIELD_SIZE, true, 0, 0.3
111+
);
112+
$currentY += self::FIELD_SIZE + self::FIELD_MARGIN;
113+
}
114+
}
115+
116+
}

0 commit comments

Comments
 (0)