PDF Transform


PDF Transform lets you transform a PDF stored in Assets, to an image. This can then be output via Twig in to a template.

A use case for this is to show the preview of a PDF before a user downloads that particular file.

Features

  • Transform PDF's to images via Twig (The file needs to be an existing Asset element)
  • PDF's are transformed when PDF's are uploaded to an image
  • Transformed PDF images are indexed and available in Assets like all other asset files.

Templating

To transform a PDF to an image, and then output the URL use the following Twig tag:

{% set asset = entry.pdfAsset.one() %}
{{ craft.pdfTransform.url(asset) }}

If the transformed image doesn't exist then the PDF will be transformed via the template. This may cause the template/page to become slow whilst the PDF is transformed.

Be aware that this also may output a large image, so we'd recommend running this through an image transform.


Free

Package Name

To install this plugin, search for its package name on the Plugin Store and click “Install”.


Information

  • Version 1.0.2
  • Last Update 11/15/2018
  • Active Installs 97
  • Compatibility Craft 3
  • License MIT
  • Categories Assets

Report an issue