pdf title

This commit is contained in:
Yuri Kuznetsov
2021-07-30 17:19:47 +03:00
parent 0658f5b7fa
commit a56acf553c
6 changed files with 25 additions and 1 deletions
@@ -18,7 +18,8 @@
"pageFormat": "Paper Format",
"pageWidth": "Page Width (mm)",
"pageHeight": "Page Height (mm)",
"fontFace": "Font"
"fontFace": "Font",
"title": "Title"
},
"links": {
},
@@ -33,6 +33,7 @@
{
"label": "",
"rows": [
[{"name": "title"}, false],
[{"name":"printHeader"}, {"name":"headerPosition"}],
[{"name":"header","fullWidth":true}],
[{"name":"printFooter"}, {"name":"footerPosition"}],
@@ -100,6 +100,9 @@
"type": "enum",
"view": "views/template/fields/font-face",
"default": ""
},
"title": {
"type": "varchar"
}
},
"links": {
@@ -72,6 +72,11 @@ class EntityProcessor
$fontFace = $template->getFontFace();
}
if ($template->hasTitle()) {
// @todo Support placeholders.
$pdf->SetTitle($template->getTitle());
}
$pdf->setFont($fontFace, '', $this->fontSize, '', true);
$pdf->setAutoPageBreak(true, $template->getBottomMargin());
+4
View File
@@ -62,4 +62,8 @@ interface Template
public function getPageWidth(): float;
public function getPageHeight(): float;
public function hasTitle(): bool;
public function getTitle(): string;
}
@@ -119,4 +119,14 @@ class TemplateWrapper implements Template
{
return $this->template->get('pageHeight') ?? 0.0;
}
public function hasTitle(): bool
{
return $this->template->get('title') !== null;
}
public function getTitle(): string
{
return $this->template->get('title') ?? '';
}
}