2

I am working on this website which has a documents gallery that will be updated periodically. One of the core requirements is to generate a thumbnail from the uploaded PDF file(First Page of the PDF file) and to be displayed in the documents gallery page(Implemented with views). I have installed Imagemagick on my test server and configured it in PHP.ini and also installed the drupal module successfully. But I have not been able to go beyond that because of the following:

  • I can't upload a pdf to an image field so there is no way of applying an image style to the uploaded pdf

  • I can't find any Drupal 8 Module that can generate the thumbnail and attach it to an image field in the content type.

  • I tried installing spatie/pdf-to-image, which is supposed to be able to do that, via composer but it doesn't show in the admin/modules page and I can't find any folder with it's name in the modules directory

Please can anyone point me in the right direction on this? A module which can perform this task or how I can create one myself. This is my first drupal website and this requirement has made life hell for me in the past two weeks. Any help on this will be really appreciated.

-1

For similar purpose i was using Media Entity in Drupal 8, so on this way you can use reference field to upload document and get preview like thumbnail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.