guillaumepotier/pdfxtractor 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

guillaumepotier/pdfxtractor

最新稳定版本:1.0.0

Composer 安装命令:

composer require guillaumepotier/pdfxtractor

包简介

Convert PDFs to JPEG images like a charm!

README 文档

README

PdfXtractor is a PHP class that relies on GhostScript. This is a handy wrapper that allows PDF conversion to JPEG files.

Build Status

Installation

The recommended way to install PdfXtractor is through composer.

Just create a composer.json file for your project:

{
    "require": {
        "guillaumepotier/PdfXtractor": "*"
    }
}

And run these two commands to install it:

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

Now you can add the autoloader, and you will have access to the library:

<?php

require 'vendor/autoload.php';

If you don't use neither Composer nor a ClassLoader in your application, just require the provided autoloader:

<?php

require_once 'src/autoload.php';

Be sure to give permissions to the GhostScript binary you'll use:

chmod 777 bin/gs-905-osx

You're done!

Usage

You'll just need to specify the pdf you want to convert, where you want to dump the .jpg files generated and under which name:

<?php

$pdfXtractor = new PdfXtractor\PdfXtractor();
$pdfXtractor->load(__DIR__.'/file.pdf')->set(__DIR__.'/output', 'extract');
$pdfXtractor->extract();

Unit Tests

To run unit tests, set your proper phpunit.xml file by doing:

cp phpunit.xml.dist phpunit.xml
vi phpunit.xml

Set the GS_BIN you'll use in your environement. Save and launch then the following command:

phpunit

TODO

Need to better rationalize the GhostScript binary used in function of the user OS. Maybe integrate a shell script to build gs properly for the user os, because the 3 gs bin provided here are a little heavy (~100Mb) and still no better than a proper build.

Credits

Guillaume Potier. @guillaumepotier

License

PdfXtractor is released under the MIT License for the PHP Wrapper. Unfortunately, GhostScript is under GPL license. Which makes this whole project under GPL license. See the bundled LICENSE file for more details.

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 3
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: GPL
  • 更新时间: 2012-05-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固