Closed jmechevarria closed 2 years ago
Have you actually composer installed mPDF? This is an option, not installed as part of PHPSpreadsheet itself
composer require mpdf/mpdf
Have you actually composer installed mPDF? This is an option, not installed as part of PHPSpreadsheet itself
composer require mpdf/mpdf
I had not. I really missed this: You must now install a PDF rendering library yourself. I guess I scanned the docs instead of reading the docs, and missed that bit.
Thanks a lot
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue for you, please try to help by debugging it further and sharing your results. Thank you for your contributions.
Have you actually composer installed mPDF? This is an option, not installed as part of PHPSpreadsheet itself
composer require mpdf/mpdf
It MUST be in docs ar least... i get the same error...
This is:
What is the expected behavior?
\Mpdf\Mpdf
to be defined and its constructor's signature to comply with the parent class' (PhpOffice\PhpSpreadsheet\Writer\Pdf
)What is the current behavior?
\Mpdf\Mpdf
is not definedWhat are the steps to reproduce?
composer require phpoffice/phpspreadsheet
Errors screens :
Please provide a Minimal, Complete, and Verifiable example of code that exhibits the issue without relying on an external Excel file or a web server:
First time using this tool, but the only
Mpdf
class I can find in the whole codebase is the same in which the error is occurring, there's no Mpdf folder at all, hence there can't be an\Mpdf\Mpdf
class. So I tried to change:with
since it did make more sense to me and, yes, the error went away, but then this happened:
So I switched it back and posted this here.
Thanks
Which versions of PhpSpreadsheet and PHP are affected?
PHP 7.4.11 PhpSpreadsheet 1.14.1 - 2020-07-19
PS there's also a typo in the docs (same link), in section Or you can instantiate directly the writer of your choice like so:
$writer = \PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf($spreadsheet);
throws error Call to undefined function PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf(), it seems to be missing the keyword new after = sign.