Closed okaufmann closed 1 year ago
Please share the PDF in question and also a minimal reproducable code snipped, so that we can reproduce this. Thanks!
I generate it like this: (unfortunately I can not share the base PDF file. But it is a PDF (version 1.5).
$mpdf = new Mpdf([
'fontDir' => ['fonts'],
'fontdata' => ['volkart' => [
'R' => 'volkart-regular/Volkart-Regular.ttf',
]],
'default_font' => 'volkart',
]);
$mpdf->setSourceFile('my-pdf.pdf');
$mpdf->AddPage('P');
$templateId = $mpdf->importPage(1);
$mpdf->useTemplate($templateId);
$mpdf->WriteFixedPosHTML($this->html('a wonderful product', '#000'), 77.5, 85.3, 99, 15, 'auto');
$mpdf->WriteFixedPosHTML($this->html('a description', '#000'), 77.5, 126, 99, 15, 'auto');
// ...
protected function html(string $text, string $color)
{
return <<<HTML
<table style="width: 100%; margin: 0; padding: 0;" cellpadding="0" cellspacing="0">
<tr>
<td style="height: 47pt; text-align: center; vertical-align: middle; padding: 0px 5px; margin: 0; font-size: 35px; color: {$color}">
{$text}
</td>
</tr>
</table>
HTML;
}
Okay, there's a variable clash between FPDI and mPDF.
I just added a quick fix to the development branch. Can you please test it? If this works I am going to release a hotfix tomorrow morning. Gn8!
Description: While running my project with FPDI version 2.4.0, I encountered an
Undefined array key "rect"
error. This error seems to be originating from theFpdiTrait.php
file. Notably, this issue does not occur in version 2.3.7.Error Message:
Environment: