improved cpev2

This commit is contained in:
Luca Haid
2025-07-22 10:38:42 +02:00
parent d8bff67391
commit e8be372560
3 changed files with 101 additions and 4 deletions
@@ -0,0 +1,45 @@
<?php
$maxLength = max(mb_strlen($firstline ?? ''), mb_strlen($secondline ?? ''));
$fontSize = '12px';
if ($maxLength <= 15) $fontSize = '24px';
elseif ($maxLength <= 24) $fontSize = '18px';
elseif ($maxLength <= 50) $fontSize = '16px';
$this->setReturnValue(['filename' => "xyz." . time() . "pdf"]);
?>
<!DOCTYPE html>
<html>
<head>
<title>CPE-Etikett</title>
<meta charset="utf-8"/>
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
font-family: "Open Sans", sans-serif, Verdana;
font-weight: bold;
text-align: center;
}
body {
display: flex;
align-items: center;
justify-content: center;
}
.content-block {
font-size: <?= $fontSize ?>;
}
</style>
</head>
<body>
<div class="content-block">
<div><?= $firstline ?></div>
<div><?= $secondline ?></div>
<div><?= $thirdline ?></div>
<div><?= $fourthline ?></div>
</div>
</body>
</html>