matejkucera / epubgenerator
Library for generating EPUB files.
0.1
2019-11-26 15:17 UTC
Requires
- php: ^7.1
- nelexa/zip: dev-master
- nesbot/carbon: ^2.0@dev
- phlak/strgen: dev-master
Requires (Dev)
- joshtronic/php-loremipsum: dev-master
- php-coveralls/php-coveralls: 2.1.x-dev
- phpunit/phpunit: ^7
- symfony/var-dumper: ^5.1@dev
This package is auto-updated.
Last update: 2022-10-27 22:14:10 UTC
README
by Matej Kucera https://matejkucera.cz
Installation
composer require matejkucera/epubgenerator
Usage
// Create generator instance $book = new EpubBook(); // Set book info $book->setId(671534); $book->setTitle('Grey Wolf'); $book->setAuthor('Matej Kucera'); $book->setDescription('Lorem ipsum'); $book->setLanguage('cs'); $book->setPublisher('My Books Inc.'); $book->setSubject('Story about the Grey Wolf'); $book->setBottomNote('Written using Wordistry'); $book->setNavTitle('Navigation'); // Create chapter $chapter = new EpubChapter(); $chapter->setTitle('First Chapter'); $chapter->addParagraph('Lorem ipsum dolor...'); $chapter->addParagraph('Lorem ipsum dolor...'); // Add the chapter to the book $epub->addChapter($chapter); // Save book to the file $book->saveToFile('/var/output/book.epub'); // Save book to stream $book->stream($stream);
Disclaimer
This library is work in progress. Do not use it in any production environment.