Is it possible to auto generate PDF preview images with Craft transforms? This popular Q/A at Stack Overflow shows a PHP solution making use of ImageMagick and GhostScript. Is installing these plugins all I'd need to make Craft do the transforms with pdf.getUrl('thumb')
?
Currently I use an assets - asset meta field on the PDF to achieve what I want (see code below), but that means I have to generate and upload the image myself. So I wondered if there's a nice and easy way to automate that process.
{% for pdf in entry.pdfAssets %}
{# Get the pdf preview thumb or use a generic one as a fallback #}
{% set previewImage = pdf.previewImage|length ? pdf.previewImage.first.url('thumb') : 'pdf_thumb.jpg' %}
<a href="{{ pdf.url }}" target="_blank">
<img src="{{ previewImage }}">
</a>
{% endfor %}