Feature: Labelprint für Kistenetiketten hinzugefügt

This commit is contained in:
2025-10-27 12:14:44 +01:00
parent 43bc416554
commit 14bae6c9ef
1068 changed files with 229014 additions and 1807 deletions

View File

@@ -1115,7 +1115,12 @@ class Html extends BaseWriter
if ($textAlign) {
$css['text-align'] = $textAlign;
if (in_array($textAlign, ['left', 'right'])) {
$css['padding-' . $textAlign] = (string) ((int) $alignment->getIndent() * 9) . 'px';
$css['padding-' . $textAlign] = (string) ($alignment->getIndent() * Alignment::INDENT_UNITS_TO_PIXELS) . 'px';
}
} else {
$indent = $alignment->getIndent();
if ($indent !== 0) {
$css['text-indent'] = (string) ($alignment->getIndent() * Alignment::INDENT_UNITS_TO_PIXELS) . 'px';
}
}
$rotation = $alignment->getTextRotation();
@@ -1126,6 +1131,12 @@ class Html extends BaseWriter
$css['transform'] = "rotate({$rotation}deg)";
}
}
$direction = $alignment->getReadOrder();
if ($direction === Alignment::READORDER_LTR) {
$css['direction'] = 'ltr';
} elseif ($direction === Alignment::READORDER_RTL) {
$css['direction'] = 'rtl';
}
return $css;
}
@@ -1516,7 +1527,6 @@ class Html extends BaseWriter
/** @param string|string[] $cssClass */
private function generateRowCellData(Worksheet $worksheet, null|Cell|string $cell, array|string &$cssClass): string
{
$cellData = ' ';
if ($cell instanceof Cell) {
$cellData = '';
// Don't know what this does, and no test cases.
@@ -1565,13 +1575,21 @@ class Html extends BaseWriter
}
}
} else {
$cellData = "$cell";
// Use default borders for empty cell
if (is_string($cssClass)) {
$cssClass .= ' style0';
}
}
/*
* Browsers may remove an entirely empty row.
* An interesting option is to leave an empty cell empty using css.
* td:empty::after{content: "\00a0";}
* This works well in modern browsers.
* Alas, none of our Pdf writers can handle it.
*/
return $cellData;
return (trim($cellData) === '') ? ' ' : $cellData;
}
private function generateRowIncludeCharts(Worksheet $worksheet, string $coordinate): string
@@ -2093,6 +2111,7 @@ class Html extends BaseWriter
// For each of the omitted rows we found above, the affected rowspans should be subtracted by 1
if (isset($this->isSpannedRow[$sheetIndex])) {
foreach ($this->isSpannedRow[$sheetIndex] as $rowIndex) {
/** @var int $rowIndex */
$adjustedBaseCells = [];
$c = -1;
$e = $countColumns - 1;