viterbit/pdfimages-extractor
Composer 安装命令:
composer require viterbit/pdfimages-extractor
包简介
Extract images from pdf
README 文档
README
This package provides a class to extract images from a pdf.
use Viterbit\PdfImagesExtractor\Pdf; $images = Pdf::getImages('book.pdf'); //returns a FilesystemIterator
Requirements
Behind the scenes this package leverages pdfimages. You can verify if the binary installed on your system by issuing this command:
which pdfimages
If it is installed it will return the path to the binary.
To install the binary you can use this command on Ubuntu or Debian:
apt-get install poppler-utils
On a mac you can install the binary using brew
brew install poppler
If you're on RedHat or CentOS use this:
yum install poppler-utils
Installation
You can install the package via composer:
composer viterbit/pdfimages-extractor
Usage
Getting images from a pdf is easy.
$images = (new Pdf()) ->setPdf('book.pdf') ->images();
Or easier:
$images = Pdf::getImages('book.pdf');
By default the package will assume that the pdftoimages command is located at /usr/bin/pdftoimages.
If it is located elsewhere pass its binary path to constructor
$images = (new Pdf('/custom/path/to/pdftoimages')) ->setPdf('book.pdf') ->images();
or as the second parameter to the getImages static method:
echo Pdf::getText('book.pdf', '/custom/path/to/pdftoimages');
Sometimes you may want to use pdfimages options. To do so you can set them up using the setOptions method.
$images = (new Pdf()) ->setPdf('book.pdf') ->setOptions(['j', 'f 1']) ->images() ;
or as the third parameter to the getImages static method:
$images = Pdf::getImages('book.pdf', null, ['j', 'f 1']);
Please note that successive calls to setOptions() will overwrite options passed in during previous calls.
If you need to make multiple calls to add options (for example if you need to pass in default options when creating
the Pdf object from a container, and then add context-specific options elsewhere), you can use the addOptions() method:
$images = (new Pdf()) ->setPdf('book.pdf') ->addOptions(['f 1']) ->images() ;
Change log
Please see CHANGELOG for more information about what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker. design agency based in Antwerp, Belgium. You'll find an overview of all our open source projects on our website.
License
The MIT License (MIT). Please see License File for more information.
viterbit/pdfimages-extractor 适用场景与选型建议
viterbit/pdfimages-extractor 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 69.97k 次下载、GitHub Stars 达 2, 最近一次更新时间为 2021 年 09 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「extractor」 「pdfimages」 「viterbit」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 viterbit/pdfimages-extractor 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 viterbit/pdfimages-extractor 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 viterbit/pdfimages-extractor 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple library that uses the hydration pattern to fill objects given different sources of data.
Bing Image Extractor
Extract information from web pages.
PDF text extractor
Smart compressed files extractor
Image Extractor
统计信息
- 总下载量: 69.97k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 15
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-09-22