Fatal error: Class 'Knp\Snappy\Pdf' not found
ellipee opened this issue · 4 comments
please help me i install module via composer and it download fine. but when i activate the module in my application config, it displays this error.
Fatal error: Uncaught exception 'Zend\ModuleManager\Exception\RuntimeException' with message 'Module (MvlabsSnappy) could not be initialized.' in C:\websites\ice\vendor\zendframework\zend-modulemanager\src\ModuleManager.php on line 195
i did downloaded the module and put it in my module folder manually the errors stop.
but when i want to generate pdf in my controller this error message appears
Fatal error: Class 'Knp\Snappy\Pdf' not found in C:\websites\ice\vendor\MvlabsSnappy\src\MvlabsSnappy\Services\MvlabsSnappyPdfServiceFactory.php on line 16
please help me
Hi @ellipee,
do you've added the configuration on the config/autoload?
Please take a look at: https://github.com/mvlabs/MvlabsSnappy#configuration
I recommend to install the module via composer. The module has dependencies, and manually could only work by installing the dependencies manually too.
I hope this helps to clarify.
Regards,
Diego Drigani
Thank you @drigani for you quick response.
i did install everything using composer and i copied the configuration on the config/autoload with the settings as follows.
hi @ellipee,
first of all make sure that running the command from terminal works. You can try in the command line:
websites/ice/vendor/google/wkhtmltopdf-amd64/wkhtmltopdf-amd64 --lowquality http://google.com google.pdf
Regards,
Diego Drigani
hi @drigani
I'm with the same issue, and for me, running the command from terminal, it works. I have tried to show direct to browser like in example and also get output and save to a file, but nothing worked.
- I have tried on Windows, with standart instalation, and on Linux via binary file downloaded with composer at the repository h4cc/wkhtmltopdf-amd64