I am using mPDF in generating payslips. However, the icons in the payslip aren't showing once it is generated. It only leaves a blank space just like this:
Icons should show on those highlighted spots. So far, here's what I've done:
I am using Yii2 PHP framework and here's my action controller:
public function actionPdf($id)
{
$model = $this->findModel($id);
$earnings = EarningDetails::find()->where(['payslip_id' => $model->_id, 'status' => 1])->all();
$deductions = DeductionDetails::find()->where(['payslip_id' => $model->_id, 'status' => 1])->all();
$html = $this->render('view', [
'model' => $model,
'earnings' => $earnings,
'deductions' => $deductions,
]);
$mpdf = new mPDF('c','A5-L','0','',0,4,1,1,0,0);
$mpdf->allow_charset_conversion = true;
$mpdf->charset_in = 'windows-1252';
$mpdf->SetTopMargin(0);
$user_password = User::find()->where(['_id' => $model->user_id ])->one();
$password = $user_password->fname.$user_password->lname;
$mpdf->SetProtection(array(), $password, $password);
$mpdf->WriteHTML($html);
$mpdf->Output('Payslip.pdf', 'D');
exit;
}
Am I missing something? Please let me know.