Automatic Image thumbnail for PDF files in your nodes

If you allow to upload PDF files into any of your Content types, maybe you are insterested in generating automatically thumbnail images with the real content of the PDF document.

In order to do that there are many alternatives but here we will focus on the module PDF to ImageField

https://www.drupal.org/project/pdf_to_imagefield

Thanks to this module we can have a File field on the Content type that will allow admins/editors to upload the PDF documents but also a Image field that will be generated automatically with the content of the PDF uploaded. A use case to this module might be to use the images generated as a link to the real document when rendering the content on views for example.

Due constraints of the CERN Drupal infrastructure there is one special configuration you need to adjust in order to make this module work.

So after installing and enabling the module you need to go to the Image toolkit 's configuration page (https://<YOURSITE>.web.cern.ch/admin/config/media/image-toolkit) and set the convert and ghostscript binary paths as follows:

Path to the convert binary:  /usr/bin/convert

PAth to the ghostscript gs binary: /usr/bin/gs

 

Hint of the day: If you want to understand how your Content type needs to be configured to use this feature, you can enable the "PDF module" that will install a "Document" Content type with the necessary fields to test the functionality

You are here