Skip to content

A Statamic addon to automatically generate a thumbnail per uploaded PDF asset

Notifications You must be signed in to change notification settings

insight-media/statamic-pdf-thumbnailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Insight Media Logo

Statamic Pdf Thumbnailer

Statamic Pdf Thumbnailer automatically generates an image per uploaded PDF asset.

Particularly useful when you want to show image previews when linking to PDF files.

Features

  • Generates an image asset of the first page for every uploaded PDF
  • The uploaded PDF contains a relation to the image asset
  • Includes a page number selector, when an image preview other than the first page is needed
  • Includes a simple tag to show the image previews in your antlers templates

Requirements

You should have Imagick and Ghostscript installed. See issues regarding Ghostscript on the underlying Spatie package page.

How to Install

You can search for this addon in the Tools > Addons section of the Statamic control panel and click install, or run the following command from your project root:

composer require insight-media/statamic-pdf-thumbnailer

How to Use

In your antlers templates

For example, if you have an Assets fieldtype named 'catalogs', containing some Pdf's:

{{ catalogs }}

    <a href="{{ url }}">
        <img src="{{ pdf :to="thumbnail" }}">
        
        <!-- or when using glide: -->
        <img src="{{ glide src=thumbnail width="200" }}">
    </a>

{{ /catalogs }}

About

A Statamic addon to automatically generate a thumbnail per uploaded PDF asset

Resources

Stars

Watchers

Forks

Packages

No packages published