fix footer

This commit is contained in:
iIronside 2022-11-21 15:32:02 +03:00
parent 01d00ec93b
commit 454286ca03

View File

@ -309,38 +309,24 @@ class UserCardController extends Controller
$pdf = new Pdf(); $pdf = new Pdf();
$mpdf = $pdf->api; $mpdf = $pdf->api;
if (!pathinfo($resumeTemplate->header_image, PATHINFO_EXTENSION)) { $mpdf->setAutoTopMargin='stretch';
$mpdf->SetHeader($headerText); $mpdf->SetHTMLHeader("
} else { <div><table style='width:100%; height:100%; border-bottom: 1px solid #999; font-family: serif; font-size: 8pt; color:
$imagePath = Yii::getAlias('@frontend') . '/web' . $resumeTemplate->header_image; #000000; font-weight: bold; font-style: italic;'><tr>
$mpdf->setAutoTopMargin='stretch'; <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>
$mpdf->SetHTMLHeader( <td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$headerText</td>
"<div style='border-bottom: 1px solid #999;'> <td width='33%' style='text-align: right; '></td>
<p><img src=$imagePath style='width: 100px; height: 40px; margin: 0; vertical-align: middle;'/>$headerText</p> </tr></table></div>
</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>
// $mpdf->SetHTMLHeader(" <td width='33%' align='center' style='font-weight: bold; font-style: italic;'>$footerText</td>
// <div><table style='width:100%; height:100%; border-bottom: 1px solid #999; font-family: serif; font-size: 8pt; color: <td width='33%' style='text-align: right; '>{PAGENO}</td>
// #000000; font-weight: bold; font-style: italic;'><tr> </tr></table></div>
// <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;