定制 jianhuawang/laravel-pdf-to-image 二次开发

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

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

jianhuawang/laravel-pdf-to-image

Composer 安装命令:

composer require jianhuawang/laravel-pdf-to-image

包简介

Convert pdf files to images

README 文档

README

Convert pdf files to images for Laravel.

Laravel 框架下的 PDF 转图片工具包,

本包提供了Laravel 把pdf文件转换为图片的功能, 同时基于Laravel Storage 对生成的图片进行存储和管理。

功能列表:

  1. 按页转换PDF文件为图片,每页生成1张图片
  2. Convert every page of PDF fiel to one image.
  3. 保存到指定的存储空间
  4. Save images to disk of Storage
  5. 支持云存储(测试中)
  6. Save image to cloud disk.(Developing)
  7. 支持定时任务后台转换图片(开发中)
  8. Convert PDF file to images by cron task.(Developing)

依赖 Package dependencies

必须安装扩展包,You must install package imagick, 参考信息 more info: http://php.net/manual/en/book.imagick.php http://php.net/manual/en/imagick.setup.php

"ext-imagick" : "*",
"intervention/image": "^2.0",
"illuminate/support": "5.*"

执行 run: php artisan vendor:publish --provider="Intervention\Image\ImageServiceProviderLaravel5"
then: you will find a new file image.php in folder config. Change " 'driver' => 'gd' " to " 'driver' => 'imagick' "

安装Installation:

composer require jianhuawang/laravel-pdf-to-image:^0.4

Laravel >= 5.5, after install nothing left to do.
Laravel <5.5

Add a provider in providers array in config/app.php:
JianhuaWang\PdfToImage\PdfToImageMaker::class,
 Add a aliase in aliases array:
'PdfToImage'=>JianhuaWang\PdfToImage\PdfToImageFacade::class,

用法Usage:

  1. Following code will read pdf file on (project root) + /storage/app/test.pdf, and convert first page to image, the image will be saved on (project root) + /storage/app/(current date)/(seconds).jpg $pdfFileNameWithPath='test.pdf';     $converter=new JianhuaWang\PdfToImage\PdfToImageMaker($pdfFileNameWithPath);
      $converter->saveImage();// Default action is converting all pages to images.
    
  2. The following codes has same function with above.

    use PdfToImage; PdfToImage::pdfFile('test.pdf')->saveImage();

统计信息

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

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-04-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固