Download the PHP package wudg/pdf-images without Composer
On this page you can find all versions of the php package wudg/pdf-images. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package pdf-images
pdf 转换图片或者图片生成 pdf
安装
前置条件
依赖php扩展 imagick,bcmath
安装 ghostscript
安装 imagick扩展
- install detail http://blog.sixtymore.cn/archives/8/
安装 pdfinfo (非必须,安装后会对处理多页 pdf 文件占用大量内存有优化)
参数配置说明
save_img_path: 生成的图片保存路径,绝对路径save_pdf_path: 生成的pdf文件保存路径,绝对路径engine.imagick.dpi: 渲染 DPI,越高细节越好,内存占用也越高,默认 300engine.imagick.width: 默认生成图片宽度,宽度保持统一高度自适应,默认 1191engine.imagick.compression_quality: 压缩质量,0-100,越高质量越好,默认 100engine.imagick.ext: pdf 生成的图片后缀名称,支持 png,jpeg, 默认 jpeg
使用
此插件支持在 hyperf 框架下运行 也可以脱离hyperf 框架使用,测试环境为 hyperf 3.1.10, 非 hyperf 框架会安装 "hyperf/contract","hyperf/support" 两个组件
在 hyperf 框架下使用
注解模式
非 hyperf 框架下使用
此种方式也适合 hyperf 框架使用,配置文件初始化时给到,然后直接调用也会走携程模式来处理 pdf 转换图片
图片相关操作
图片操作采用链式调用设计,易于理解 需要什么调用什么,最后支持返回 二进制,base64 或者直接保存到本地返回路径
基础方法
你也可以一次打点多个文本到同一张图片中,想怎么来就怎么来
图片合成 gif 带转场效果
图片拼接
多张图合并成一张照片墙
PDF 合成图片和文字内容,此方法在携程环境下效率很高,建议在携程环境使用
实际效果
测试 5 页 pdf 转换图片fpm和携程下差距
测试 5张图片生成 pdf fpm和携程下差距,图片张数少时 时间差不多,大量图片没做测试
图片操作
图片合成 gif 动图
pdf 指定页数打点或者合成图片,5页 pdf 在每页做图片和文字合成
All versions of pdf-images with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
ext-bcmath Version *
ext-imagick Version *
ext-json Version *
hyperf/contract Version ~3.1.0
hyperf/support Version ~3.1.0
psr/container Version ^1.0 || ^2.0
ramsey/uuid Version ^4.9
ext-bcmath Version *
ext-imagick Version *
ext-json Version *
hyperf/contract Version ~3.1.0
hyperf/support Version ~3.1.0
psr/container Version ^1.0 || ^2.0
ramsey/uuid Version ^4.9
The package wudg/pdf-images contains the following files
Loading the files please wait ...