innoweb/silverstripe-pdf-image-converter
最新稳定版本:1.0.4
Composer 安装命令:
composer require innoweb/silverstripe-pdf-image-converter
包简介
Converts the first page of a PDF file to an image
README 文档
README
Overview
This module converts the first page of a PDF file to an image.
It uses the high level conversion API introduced in Silverstripe 5.3, see the image documentation.
Requirements
- Silverstripe Assets 2.3 (Silverstripe 5.3)
- ext-imagick
Installation
Install the module using composer:
composer require innoweb/silverstripe-pdf-image-converter
Then run dev/build.
Usage
To display a thumbnail of a PDF file in a template you can convertthe PDF to an image in the template:
<img src="$PDFDocument.Convert('jpg').Pad(100,150).URL" height="150" width="100" alt="">
You can use the Quality method to set a specific image quality for different formats:
<picture>
<source type="image/webp" srcset="$PDFDocument.Convert('webp').Quality(80).Pad(100,150).URL">
<img src="$PDFDocument.Convert('jpg').Pad(100,150).URL" height="150" width="100" alt="">
</picture>
License
BSD 3-Clause License, see License
统计信息
- 总下载量: 52
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-11-07