I've just installed a fresh copy of Drupal 8 rc 2 and Entity Print 8,x-1.0-rc1.
When I try to generate a pdf with .../entityprint/node/1 i get the following error:

Fatal error: Class 'mikehaertl\wkhtmlto\Pdf' not found in /var/www/html/drupal8rc2/modules/entity_print/src/Plugin/EntityPrint/PdfEngine/PhpWkhtmlToPdf.php on line 29

According to this issue it is not necessary to install PhpWkhtmlToPdf in Drupal 8: https://www.drupal.org/node/2518862

On the module page you mention about D8: "The main difference is the need to create the "PDF" view mode manually."

If I go to admin/structure/types/manage/page/display I don't have the option to create a new view mode, I just can activate the existing view modes (Full content, RSS, Search index, Search result highlighting input, Teaser).

Should there be a Pdf view mode or if not how can I create it?

Thanks

Comments

mabuweb created an issue. See original summary.

benjy’s picture

I've not tested this in a while but I will. Have you run a composer install? It looks like the dependency is missing, I may need a dependency on composer_manager

Drupal 8 allows you to create new display modes, under /admin/structure

mabuweb’s picture

Thank's benjy.
I've created the display mode PDF.
I didn't run the composer command before.
Now I have exceuted from the drupal /vendor directory the command:
composer require mikehaertl/phpwkhtmltopdf (not sure if this is the correct way).

I still get the same error message.

mabuweb’s picture

Ok I've seen how the composer is intended to work in D8 at https://bojanz.wordpress.com/2015/09/18/d8-composer-definitive-intro/

After installing composer correctly and running "composer drupal-update" the error disappeared and the pdf file is created correctly.

Thanks!

mabuweb’s picture

Status: Active » Closed (works as designed)
benjy’s picture

Thanks, I added a note on the module page.