From 01d00ec93b47e3c400f527b374e6b58322c143d2 Mon Sep 17 00:00:00 2001 From: iIronside Date: Mon, 21 Nov 2022 15:26:08 +0300 Subject: [PATCH] quick fix footer --- .../card/controllers/UserCardController.php | 47 ++++++++++++------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/backend/modules/card/controllers/UserCardController.php b/backend/modules/card/controllers/UserCardController.php index abf8cf9..ccc5cc3 100755 --- a/backend/modules/card/controllers/UserCardController.php +++ b/backend/modules/card/controllers/UserCardController.php @@ -309,24 +309,39 @@ class UserCardController extends Controller $pdf = new Pdf(); $mpdf = $pdf->api; - $mpdf->SetHTMLHeader(" - - - - -
$headerText{PAGENO}
- "); - $mpdf->SetHTMLFooter(" - - - - -
$footerText{PAGENO}
- "); + if (!pathinfo($resumeTemplate->header_image, PATHINFO_EXTENSION)) { + $mpdf->SetHeader($headerText); + } else { + $imagePath = Yii::getAlias('@frontend') . '/web' . $resumeTemplate->header_image; + $mpdf->setAutoTopMargin='stretch'; + $mpdf->SetHTMLHeader( + "
+

$headerText

+
" + ); + } + +// $mpdf->SetHTMLHeader(" +//
+// +// +// +//
$headerText
+// "); + +// $mpdf->SetHTMLFooter(" +//
+// +// +// +//
$footerText{PAGENO}
+// "); $mpdf->WriteHTML("
$userCard->resume_text
"); + $mpdf->SetFooter('{PAGENO}'); + $mpdf->Output("Resume - {$userCard->fio}", 'D'); // call the mpdf api output as needed exit; }