if (isset($post['sheet_photos']) && $post['sheet_photos'] === '1') {
$pdf->withImages();
}
- $pdf->drawSheet($members, $doc_title);
+ $pdf->drawSheet($members);
$response = $this->response->withHeader('Content-type', 'application/pdf');
$response->write($pdf->Output(_T("attendance_sheet") . '.pdf', 'D'));
return $response;
}
$html .= $this->model->hheader;
$this->writeHtml($html, true, false, true, false, '');
+
+ if ($title !== null) {
+ $this->writeHtml('<h2 style="text-align:center;">' . $title . '</h2>');
+ }
+
if (trim($this->model->title) !== '') {
$htitle = '';
if (trim($this->model->hstyles) !== '') {
public function Header() // phpcs:ignore PSR1.Methods.CamelCapsMethodName
{
if ($this->PageNo() > 1) {
+ $this->setTopMargin(15);
+ $this->setY(10);
$this->SetFont(Pdf::FONT, '', self::SHEET_FONT);
$head_title = $this->doc_title;
if ($this->sheet_title !== null) {
if ($this->sheet_date !== null) {
$head_title .= ' - ' . $this->sheet_date->format(__("Y-m-d"));
}
- $this->Cell(0, 10, $head_title, 1, false, 'C', 0, '', 0, false, 'M', 'M');
+ $this->Cell(0, 10, $head_title, 0, false, 'C', 0, '', 0, false, 'M', 'M');
}
}
/**
* Draw members cards
*
- * @param array $members Members
- * @param string $doc_title Document title
+ * @param array $members Members
*
* @return void
*/
- public function drawSheet($members, $doc_title)
+ public function drawSheet($members)
{
$this->Open();
$this->AddPage();
- $this->PageHeader($doc_title);
+ $this->PageHeader($this->doc_title);
if ($this->sheet_date) {
$date_fmt = null;