jove4015/epub-to-text
Composer 安装命令:
composer require jove4015/epub-to-text
包简介
Extract text from a epub - based on spatie/pdf-to-text
关键字:
README 文档
README
This package provides a class to extract text from an epub.
\jove4015\epub2txt\Epub::getText('book.epub'); //returns the text from the epub
Requirements
Behind the scenes this package leverages epub2txt. You can verify if the binary installed on your system by issueing this command:
which epub2txt
If it is installed it will return the path to the binary.
To install the binary you can follow the instructions here: (http://kevinboone.net/README_epub2txt.html)
Installation
You can install the package via composer:
$ composer require jove4015/epub-to-text
Usage
Extracting text from an epub is easy.
$text = (new Epub()) ->setepub('book.epub') ->text();
Or easier:
\jove4015\EpubToText\Epub::getText('book.epub')
By default the package will assume that the epub2txt is located at /usr/bin/epub2txt.
If you're using the a different location pass the path to the binary in constructor
$text = (new Epub('/custom/path/to/epub2txt')) ->setepub('book.epub') ->text();
or as the second parameter to the getText-function:
\jove4015\EpubToText\Epub::getText('book.epub', '/custom/path/to/epub2txt')
Testing
$ composer test
Credits
- Freek Van der Herten - Wrote the original pdf-to-text package on which this is based
- Kevin Boone - Wrote the epub2txt CLI utility
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 83
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-12-15