定制 insight-media/statamic-pdf-thumbnailer 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

insight-media/statamic-pdf-thumbnailer

最新稳定版本:v1.0.1

Composer 安装命令:

composer require insight-media/statamic-pdf-thumbnailer

包简介

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

README 文档

README


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 }}

统计信息

  • 总下载量: 391
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2022-07-09