pdf title
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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') ?? '';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user