46 lines
1.0 KiB
PHP
46 lines
1.0 KiB
PHP
<?php
|
|
$maxLength = max(mb_strlen($firstline ?? ''), mb_strlen($secondline ?? ''), mb_strlen($thirdline ?? ''));
|
|
|
|
$fontSize = '13px';
|
|
if ($maxLength <= 11) $fontSize = '28px';
|
|
elseif ($maxLength <= 20) $fontSize = '18px';
|
|
elseif ($maxLength <= 45) $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>
|