定制 jmoont/pdfthumb 二次开发

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

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

jmoont/pdfthumb

最新稳定版本:1.0.6

Composer 安装命令:

composer require jmoont/pdfthumb

包简介

PDF thumbnail generation for Craft CMS 3

README 文档

README

PDF thumbnail generation for Craft CMS 3

Usage

The craft.PDFThumb.thumbnail() template tag returns a URL to the generated thumbnail.

{% for myAsset in item.assetRef %}
    <img src="{{ craft.PDFThumb.thumbnail(myAsset) }}">
    <img src="{{ craft.PDFThumb.thumbnail(myAsset, 100, 100) }}">
    <img src="{{ craft.PDFThumb.thumbnail(myAsset, 100, 150, true, 'jpg') }}">
{% endfor %}

Heavily based on https://github.com/carnesmedia/pthumb

PThumb

PThumb is a Craft plugin that generates thumbnail preview images for PDF documents. It's easy to drop into your templates, requires only the commmand-line version of ImageMagick (not the PHP bindings), and caches the generated thumbnails.

It's still very much a work in progress, so use it in production environments at your own risk.

Installation

  1. Download the ZIP file
  2. Unzip it and move the pthumb folder to craft/plugins
  3. Install the plugin from the Plugins page of your control panel
  4. Click on the PThumb link on the plugins page to configure the plugin

Configuration

Setting Description
Storage Path Absolute or relative path to the storage directory for PDFs on the server, ex ~/craft/public/uploads/pdfs
Base URL URL to the storage path, ex /uploads/pdfs

Usage

The craft.PThumb.thumbnail() template tag returns a URL to the generated thumbnail.

<img src="{{ craft.PThumb.thumbnail(myAsset) }}">
<img src="{{ craft.PThumb.thumbnail(myAsset, 100, 100) }}">
<img src="{{ craft.PThumb.thumbnail(myAsset, 100, 150, true, 'jpg') }}">

The arguments, in order, are:

Argument Description
Asset Required
Width In pixels, default: 250
Height In pixels, default: 250
Exact size Force the canvas to exactly match the height/width specified by extending transparent (PNG) or white (JPG) space to the dimensions, useful for producing square images of rectangular documents, default: false
File format Options are 'png' or 'jpg', default: png

Known issues

  • Files must be limited to a single directory
  • Files must be stored locally

统计信息

  • 总下载量: 3.95k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 7
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 7
  • Watchers: 0
  • Forks: 7
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固