quick fix footer

This commit is contained in:
iIronside 2022-11-21 15:26:08 +03:00
parent a30bc6482b
commit 01d00ec93b

View File

@ -309,24 +309,39 @@ class UserCardController extends Controller
$pdf = new Pdf(); $pdf = new Pdf();
$mpdf = $pdf->api; $mpdf = $pdf->api;
$mpdf->SetHTMLHeader(" if (!pathinfo($resumeTemplate->header_image, PATHINFO_EXTENSION)) {
<table width='100%' style='border-bottom: 1px solid #999; vertical-align: bottom; font-family: serif; font-size: 8pt; color: $mpdf->SetHeader($headerText);
#000000; font-weight: bold; font-style: italic;'><tr> } else {
<td width='33%'><span style='font-weight: bold; font-style: italic;'><img src=$headerImagePath style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'></span></td> $imagePath = Yii::getAlias('@frontend') . '/web' . $resumeTemplate->header_image;
<td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$headerText</td> $mpdf->setAutoTopMargin='stretch';
<td width='33%' style='text-align: right; '>{PAGENO}</td> $mpdf->SetHTMLHeader(
</tr></table> "<div style='border-bottom: 1px solid #999;'>
"); <p><img src=$imagePath style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'/>$headerText</p>
$mpdf->SetHTMLFooter(" </div>"
<table width='100%' style='border-top: 1px solid #999; vertical-align: bottom; font-family: serif; font-size: 8pt; color: );
#000000; font-weight: bold; font-style: italic;'><tr> }
<td width='33%'><span style='font-weight: bold; font-style: italic;'><img src=$footerImg style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'></span></td>
<td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$footerText</td>
<td width='33%' style='text-align: right; '>{PAGENO}</td>
</tr></table>
");
// $mpdf->SetHTMLHeader("
// <div><table style='width:100%; height:100%; border-bottom: 1px solid #999; font-family: serif; font-size: 8pt; color:
// #000000; font-weight: bold; font-style: italic;'><tr>
// <td width='33%'><span style='font-weight: bold; font-style: italic;'><img src=$headerImagePath style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'></span></td>
// <td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$headerText</td>
// <td width='33%' style='text-align: right; '></td>
// </tr></table></div>
// ");
// $mpdf->SetHTMLFooter("
// <div><table width='100%' style='border-top: 1px solid #999; vertical-align: bottom; font-family: serif; font-size: 8pt; color:
// #000000; font-weight: bold; font-style: italic;'><tr>
// <td width='33%'><span style='font-weight: bold; font-style: italic;'><img src=$footerImg style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'></span></td>
// <td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$footerText</td>
// <td width='33%' style='text-align: right; '>{PAGENO}</td>
// </tr></table></div>
// ");
$mpdf->WriteHTML("<div>$userCard->resume_text</div>"); $mpdf->WriteHTML("<div>$userCard->resume_text</div>");
$mpdf->SetFooter('{PAGENO}');
$mpdf->Output("Resume - {$userCard->fio}", 'D'); // call the mpdf api output as needed $mpdf->Output("Resume - {$userCard->fio}", 'D'); // call the mpdf api output as needed
exit; exit;
} }