{"id":22547095,"url":"https://github.com/kiwilan/php-ebook","last_synced_at":"2025-04-10T00:53:11.025Z","repository":{"id":149895811,"uuid":"618771768","full_name":"kiwilan/php-ebook","owner":"kiwilan","description":"PHP package to read metadata and extract covers from eBooks, comics and audiobooks.","archived":false,"fork":false,"pushed_at":"2025-02-19T08:56:22.000Z","size":58896,"stargazers_count":25,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-10T00:52:55.310Z","etag":null,"topics":["audiobook","azw","book","cb7","cba","cbam","cbr","cbz","comic","comicinfo","cover","ebook","epub","epub2","epub3","metadata","mobi","opf","pdf","php"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/kiwilan/php-ebook","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiwilan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"kiwilan"}},"created_at":"2023-03-25T09:58:14.000Z","updated_at":"2025-03-20T03:15:29.000Z","dependencies_parsed_at":"2024-04-01T03:15:08.544Z","dependency_job_id":null,"html_url":"https://github.com/kiwilan/php-ebook","commit_stats":null,"previous_names":[],"tags_count":72,"template":false,"template_full_name":"spatie/package-skeleton-php","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-ebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-ebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-ebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiwilan%2Fphp-ebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiwilan","download_url":"https://codeload.github.com/kiwilan/php-ebook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137995,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["audiobook","azw","book","cb7","cba","cbam","cbr","cbz","comic","comicinfo","cover","ebook","epub","epub2","epub3","metadata","mobi","opf","pdf","php"],"created_at":"2024-12-07T15:10:07.144Z","updated_at":"2025-04-10T00:53:10.996Z","avatar_url":"https://github.com/kiwilan.png","language":"PHP","readme":"# PHP eBook\n\n![Banner with eReader picture in background and PHP eBook title](https://raw.githubusercontent.com/kiwilan/php-ebook/main/docs/banner.jpg)\n\n[![php][php-version-src]][php-version-href]\n[![version][version-src]][version-href]\n[![downloads][downloads-src]][downloads-href]\n[![license][license-src]][license-href]\n[![tests][tests-src]][tests-href]\n[![codecov][codecov-src]][codecov-href]\n\nPHP package to read metadata and extract covers from eBooks, comics and audiobooks.\n\n\u003e Because metadata are the key against chaos.\n\n-   eBooks: `.epub`, `.pdf`, `.azw`, `.azw3`, `.kf8`, `.kfx`, `.mobi`, `.prc`, `.fb2`\n-   Comics: `.cbz`, `.cbr`, `.cb7`, `.cbt` (metadata from [github.com/anansi-project](https://github.com/anansi-project))\n-   Audiobooks: `.mp3`, `.m4a`, `.m4b`, `.flac`, `.ogg` with external package[`kiwilan/php-audio`](https://github.com/kiwilan/php-audio) (**MUST** be installed separately)\n\nTo know more see [Supported formats](#supported-formats). _Supports Linux, macOS and Windows._\n\n\u003e [!NOTE]\n\u003e\n\u003e This package favors eBooks in open formats such as `.epub` (from [IDPF](https://en.wikipedia.org/wiki/International_Digital_Publishing_Forum)) or `.cbz` (from [CBA](https://en.wikipedia.org/wiki/Comic_book_archive)) and which be parsed with native PHP, so for the best possible experience we recommend converting the eBooks you use. If you want to know more about eBook ecosystem, you can read [documentation](https://github.com/kiwilan/php-ebook/blob/main/docs/README.md).\n\n\u003e [!WARNING]\n\u003e\n\u003e For DRM (Digital Rights Management) eBooks, in some cases you could read metadata but not contents (like HTML files for EPUB). To use all features, you have to use a software to remove DRM before using this package. For EPUB, you can use [calibre](https://calibre-ebook.com/) with [DeDRM plugin](https://github.com/noDRM/DeDRM_tools), [this guide](https://www.epubor.com/calibre-drm-removal-plugins.html) can help you.\n\n## About\n\nThis package was built for [`bookshelves-project/bookshelves`](https://github.com/bookshelves-project/bookshelves), a web app to handle eBooks.\n\n## Requirements\n\n-   **PHP version** `\u003e=8.1`\n-   **PHP extensions**:\n    -   [`zip`](https://www.php.net/manual/en/book.zip.php) (native, optional) for `.EPUB`, `.CBZ`\n    -   [`phar`](https://www.php.net/manual/en/book.phar.php) (native, optional) for `.CBT`\n    -   [`rar`](https://github.com/cataphract/php-rar) (optional) for `.CBR` ([`p7zip`](https://www.7-zip.org/) binary can be used instead)\n    -   [`imagick`](https://www.php.net/manual/en/book.imagick.php) (optional) for `.PDF` cover\n    -   [`intl`](https://www.php.net/manual/en/book.intl.php) (native, optional) for `Transliterator` for better slugify\n    -   [`fileinfo`](https://www.php.net/manual/en/book.fileinfo.php) (native, optional) for better detection of file type\n-   **Binaries**\n    -   [`p7zip`](https://www.7-zip.org/) (optional) binarys for `.CB7` (can handle `.CBR` too)\n-   **Audiobooks**\n    -   [`kiwilan/php-audio`](https://github.com/kiwilan/php-audio) (optional) for `.mp3`, `.m4a`, `.m4b`, `.flac`, `.ogg` (see [Supported formats](#supported-formats))\n-   To know more about requirements, see [Supported formats](#supported-formats)\n\n\u003e [!NOTE]\n\u003e\n\u003e You have to install requirements only if you want to read metadata for these formats, e.g. if you want to read metadata from `.cbr` files, you have to install [`rar` PHP extension](https://github.com/cataphract/php-rar) or [`p7zip`](https://www.7-zip.org/) binary. So all requirements for PHP extensions and binaries are optional.\n\n\u003e [!WARNING]\n\u003e\n\u003e Archives are handle with [`kiwilan/php-archive`](https://github.com/kiwilan/php-archive), for some formats (`.cbr` and `.cb7`) [`rar` PHP extension](https://github.com/cataphract/php-rar) or [`p7zip`](https://www.7-zip.org/) binary could be necessary.\n\u003e Some guides to install these requirements are available on [`kiwilan/php-archive`](https://github.com/kiwilan/php-archive#requirements).\n\n## Features\n\n-   Support multiple formats, see [Supported formats](#supported-formats)\n-   🔎 Read metadata from eBooks, comics, and audiobooks\n-   🖼️ Extract covers from eBooks, comics, and audiobooks\n-   🎵 Works with audiobooks if [`kiwilan/php-audio`](https://github.com/kiwilan/php-audio) is installed\n-   📚 Support metadata\n    -   eBooks: `EPUB` v2 and v3 from [IDPF](https://idpf.org/) with `calibre:series` from [Calibre](https://calibre-ebook.com/) | `MOBI` from Mobipocket (and derivatives) | `FB2` from [FictionBook](https://en.wikipedia.org/wiki/FictionBook)\n    -   Comics: `CBAM` (Comic Book Archive Metadata) : `ComicInfo.xml` format from _ComicRack_ and maintained by [`anansi-project`](https://github.com/anansi-project/comicinfo)\n    -   `PDF` with [`smalot/pdfparser`](https://github.com/smalot/pdfparser)\n    -   Audiobooks: `ID3`, `vorbis` and `flac` tags with [`kiwilan/php-audio`](https://github.com/kiwilan/php-audio) (not included), based on [audiobookshelf specifications](https://www.audiobookshelf.org/docs#book-audio-metadata)\n-   🔖 Chapters extraction (`EPUB` only)\n-   📦 `EPUB` and `CBZ` creation supported\n\u003c!-- -   📝 `EPUB` and `CBZ` metadata update supported --\u003e\n-   Works perfectly with [`kiwilan/php-opds`](https://github.com/kiwilan/php-opds): PHP package to generate OPDS feeds (not included)\n\n### Roadmap\n\n-   [ ] Better `.epub` creation support\n-   [ ] Add `.epub` metadata update support\n-   [ ] Add better handling of MOBI files: [`libmobi`](https://github.com/bfabiszewski/libmobi) and [`ebook-convert`](https://manual.calibre-ebook.com/generated/en/ebook-convert.html) from Calibre (fallback is available)\n-   [ ] Add support of [`ebook-convert`](https://manual.calibre-ebook.com/generated/en/ebook-convert.html) from Calibre\n-   [ ] Add suport for DJVU: [`djvulibre`](https://djvu.sourceforge.net/)\n\n## Installation\n\nYou can install the package via composer:\n\n```bash\ncomposer require kiwilan/php-ebook\n```\n\n## Usage\n\nWith eBook files or audiobook\\* files (to know more about formats, see [Supported formats](#supported-formats)).\n\n\\*: should be installed separately, see [Requirements](#requirements).\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n\n$ebook-\u003egetPath(); // string =\u003e path to ebook\n$ebook-\u003egetFilename(); // string =\u003e filename of ebook\n$ebook-\u003egetExtension(); // string =\u003e extension of ebook\n$ebook-\u003egetTitle(); // string\n$ebook-\u003egetAuthors(); // BookAuthor[] (`name`: string, `role`: string)\n$ebook-\u003egetAuthorMain(); // ?BookAuthor =\u003e First BookAuthor (`name`: string, `role`: string)\n$ebook-\u003egetDescription(); // ?string\n$ebook-\u003egetCopyright(); // ?string\n$ebook-\u003egetPublisher(); // ?string\n$ebook-\u003egetIdentifiers(); // BookIdentifier[] (`value`: string, `scheme`: string)\n$ebook-\u003egetPublishDate(); // ?DateTime\n$ebook-\u003egetLanguage(); // ?string\n$ebook-\u003egetTags(); // string[] =\u003e `subject` in EPUB, `keywords` in PDF, `genres` in CBA\n$ebook-\u003egetSeries(); // ?string =\u003e `calibre:series` in EPUB, `series` in CBA\n$ebook-\u003egetVolume(); // ?int =\u003e `calibre:series_index` in EPUB, `number` in CBA\n$ebook-\u003egetCreatedAt(); // ?DateTime =\u003e file modified date\n$ebook-\u003egetSize(); // int =\u003e file size in bytes\n$ebook-\u003egetSizeHumanReadable(); // string =\u003e file size in human readable format\n```\n\nFor advanced description parsing, you can use `getDescriptionAdvanced()` method with `BookDescription` class.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n\n$description = $ebook-\u003egetDescriptionAdvanced(); // BookDescription\n\n$description-\u003egetDescription(); // string =\u003e raw description\n$description-\u003etoHtml(?int $limit = null); // string =\u003e description formatted to HTML\n$description-\u003etoString(?int $limit = null); // string =\u003e description formatted to plain text\n$description-\u003etoStringMultiline(?int $limit = null); // string =\u003e description formatted to plain text with new lines\n```\n\nFor pages count, you can use these methods:\n\n```php\n$ebook-\u003egetPagesCount(); // ?int =\u003e estimated pages count (250 words by page) in `EPUB`, `pageCount` in PDF, `pageCount` in CBA\n$ebook-\u003egetWordsCount(); // ?int =\u003e words count in `EPUB`\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e For performance reasons, with `EPUB`, `pagesCount` and `wordsCount` are only available on demand. If you use `var_dump` to check eBook, these properties will be `null`.\n\nSome metadata can be stored into `extras()` method, without typing, directly from metadata.\n\n```php\n$ebook-\u003egetExtras(); // array\u003cstring, mixed\u003e =\u003e additional data for book\n$ebook-\u003egetExtra(string $key); // mixed =\u003e safely extract data from `extras` array\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e For audiobooks, all metadata are stored into `extras` array, you will find duplicate with `Ebook::class` properties. See [Formats specifications](#formats-specifications) for more informations.\n\nTo know if eBook is valid, you can use `isValid()` static method, before `read()`.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$isValid = Ebook::isValid('path/to/ebook.epub');\n```\n\nTo get additional data, you can use these methods:\n\n```php\n$ebook-\u003egetParser(); // ?EbookParser =\u003e Parser with modules\n$ebook-\u003egetMetaTitle(); // ?MetaTitle, with slug for `title` and `series`\n$ebook-\u003egetFormat(); // ?EbookFormatEnum =\u003e `epub`, `pdf`, `cba`\n$ebook-\u003egetCover(); // ?EbookCover =\u003e cover of book\n```\n\nTo access to archive of eBook, you can use `getArchive()` method. You can find more informations about archive in [`kiwilan/php-archive`](https://github.com/kiwilan/php-archive).\n\n```php\n$ebook-\u003egetArchive(); // ?BaseArchive =\u003e archive of book from `kiwilan/php-archive`\n```\n\nAnd to test if some data exists:\n\n```php\n$ebook-\u003eisArchive(); // bool =\u003e `true` if `EPUB`, `CBA`\n$ebook-\u003eisMobi(); // bool =\u003e `true` if Mobipocket derivatives\n$ebook-\u003eisAudio(); // bool =\u003e `true` if `mp3`, `m4a`, `m4b`, `flac`, `ogg`\n$ebook-\u003ehasCover(); // bool =\u003e `true` if cover exists\n$ebook-\u003ehasMetadata(); // bool =\u003e `true` if metadata exists\n$ebook-\u003ehasSeries(); // bool =\u003e `true` if series exists\n$ebook-\u003eisBadFile(); // bool =\u003e `true` if file is not readable\n```\n\n### Metadata\n\n`Ebook::class` contains many informations but if you want to access to raw metadata, `metadata()` method is available.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n\n$parser = $ebook-\u003egetParser();\n\n$parser-\u003egetModule(); // Used into parsing can be any of `EbookModule::class`\n\n$parser-\u003egetAudiobook(); // `AudiobookModule::class`\n$parser-\u003egetCba(); // `CbaModule::class`\n$parser-\u003egetEpub(); // `EpubModule::class`\n$parser-\u003egetFb2(); // `Fb2Module::class`\n$parser-\u003egetMobi(); // `MobiModule::class`\n$parser-\u003egetPdf(); // `PdfModule::class`\n\n$parser-\u003eisAudiobook(); // bool\n$parser-\u003eisCba(); // bool\n$parser-\u003eisEpub(); // bool\n$parser-\u003eisFb2(); // bool\n$parser-\u003eisMobi(); // bool\n$parser-\u003eisPdf(); // bool\n```\n\n### MetaTitle\n\nCan be set if book's title is not null.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n$metaTitle = $ebook-\u003egetMetaTitle(); // ?MetaTitle\n\n$metaTitle-\u003egetSlug(); // string =\u003e slug title, like `lord-of-the-rings-en-01-fellowship-of-the-ring-j-r-r-tolkien-1954-epub`\n$metaTitle-\u003egetSeriesSlug(); // ?string =\u003e slug series title, like `lord-of-the-rings-en`\n```\n\nYou can customize slug with `MetaTitle::class`:\n\n```php\n$meta-\u003egetSlug(removeDeterminers: true, addSeries: true, addVolume: true, addAuthor: true, addYear: true, addExtension: true, addLanguage: true);\n$meta-\u003egetSeriesSlug(removeDeterminers: true, addAuthor: false, addExtension: false, addLanguage: true);\n```\n\n### Cover\n\nCover can be extracted from ebook.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n$cover = $ebook-\u003egetCover(); // ?EbookCover\n\n$cover-\u003egetPath(); // ?string =\u003e path to cover\n$cover-\u003egetContents(bool $toBase64 = false); // ?string =\u003e content of cover, if `$toBase64` is true, return base64 encoded content\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e -   For `PDF`, cover can only be extracted if [`imagick` PHP extension](https://www.php.net/manual/en/book.imagick.php).\n\u003e -   For Audiobook, cover can be extracted with [some formats](https://github.com/kiwilan/php-audio#supported-formats).\n\n### Formats specifications\n\n#### Audiobooks\n\nFor audiobooks, you have to install seperately [`kiwilan/php-audio`](https://github.com/kiwilan/php-audio).\n\nSpecifications are based on [audiobookshelf](https://www.audiobookshelf.org/docs#book-audio-metadata) and [ID3](https://id3.org/ID3v2.4.0) tags. Metadata on audio files will be mapped as follows (second tag after \"/\" is a fallback):\n\nProperties of `Audio::class` are:\n\n| **ID3 Tag (case-insensitive)** | **eBook**                  |\n| ------------------------------ | -------------------------- |\n| `artist` / `album-artist`      | Authors\\*                  |\n| `album` / `title`              | Title                      |\n| `subtitle`                     | Extra property `subtitle`  |\n| `publisher`                    | Publisher                  |\n| `year`                         | Publish Year               |\n| `composer`                     | Extra property `narrators` |\n| `description`                  | Description                |\n| `genre`                        | Tags\\*\\*                   |\n| `series` / `mvnm`              | Series                     |\n| `series-part` / `mvin`         | Volume                     |\n| `language` / `lang`            | Language                   |\n| `isbn`                         | Identifiers `isbn`         |\n| `asin` / `audible_asin`        | Identifiers `asin`         |\n| Overdrive MediaMarkers         | Extra property `chapters`  |\n\n-   \\* Authors naming as well as multiple authors separated by `,`, `;`, `\u0026` or `and`.\n-   \\*\\* Tags can include multiple tags separated by `/`, `//`, or `;`. e.g. \"Science Fiction/Fiction/Fantasy\"\n\nYou can find all metadata into `getExtras()` array of `Ebook::class`.\n\n#### EPUB\n\nWith `EPUB`, metadata are extracted from `OPF` file, `META-INF/container.xml` files, you could access to these metatada but you can also get chapters from `NCX` file. And with `chapters()` method you can merge `NCX` and `HTML` chapters to get full book chapters with `label`, `source` and `content`.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$ebook = Ebook::read('path/to/ebook.epub');\n\n$epub = $ebook-\u003egetParser()?-\u003egetEpub();\n\n$epub-\u003egetContainer(); // ?EpubContainer =\u003e {`opfPath`: ?string, `version`: ?string, `xml`: array}\n$epub-\u003egetOpf(); // ?OpfItem =\u003e {`metadata`: array, `manifest`: array, `spine`: array, `guide`: array, `epubVersion`: ?int, `filename`: ?string, `dcTitle`: ?string, `dcCreators`: BookAuthor[], `dcContributors`: BookContributor[], `dcDescription`: ?string, `dcPublisher`: ?string, `dcIdentifiers`: BookIdentifier[], `dcDate`: ?DateTime, `dcSubject`: string[], `dcLanguage`: ?string, `dcRights`: array, `meta`: BookMeta[], `coverPath`: ?string, `contentFile`: string[]}\n$epub-\u003egetNcx(); // ?NcxItem =\u003e {`head`: NcxItemHead[]|null, `docTitle`: ?string, `navPoints`: NcxItemNavPoint[]|null, `version`: ?string, `lang`: ?string}\n$epub-\u003egetChapters(); // EpubChapter[] =\u003e {`label`: string, `source`: string, `content`: string}[]\n$epub-\u003egetHtml(); // EpubHtml[] =\u003e {`filename`: string, `head`: ?string, `body`: ?string}[]\n$epub-\u003egetFiles(); // string[] =\u003e all files in EPUB\n```\n\n\u003e [!NOTE]\n\u003e\n\u003e For performance reasons, with `ncx`, `html` and `chapters` are only available on demand. If you use `var_dump` to check metadata, these properties will be `null`.\n\n### Creation\n\nYou can create an EPUB or CBZ file with `create()` static method.\n\n\u003e [!NOTE]\n\u003e\n\u003e Only `EPUB` and `CBZ` are supported for creation.\n\n```php\nuse Kiwilan\\Ebook\\Ebook;\n\n$creator = Ebook::create('path/to/ebook.epub');\n\n// Build manually\n$creator-\u003eaddFromString('mimetype', 'application/epub+zip')\n    -\u003eaddFromString('META-INF/container.xml', '\u003c?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?\u003e\u003ccontainer version=\"1.0\" xmlns=\"urn:oasis:names:tc:opendocument:xmlns:container\"\u003e\u003crootfiles\u003e\u003crootfile full-path=\"OEBPS/content.opf\" media-type=\"application/oebps-package+xml\"/\u003e\u003c/rootfiles\u003e\u003c/container\u003e')\n    -\u003esave();\n\n// Build from files\n$creator-\u003eaddFile('mimetype', 'path/to/mimetype')\n    -\u003eaddFile('META-INF/container.xml', 'path/to/container.xml')\n    -\u003esave();\n\n// Build from directory\n$creator-\u003eaddDirectory('./', 'path/to/directory')\n    -\u003esave();\n```\n\n## Supported formats\n\nThere is a lot of different formats for eBooks and comics, if you want to know more about:\n\n-   [Comparison of e-book formats](https://en.wikipedia.org/wiki/Comparison_of_e-book_formats) for eBooks\n-   [Comic book archive](https://en.wikipedia.org/wiki/Comic_book_archive) for comics\n-   Amazing [MobileRead wiki](https://wiki.mobileread.com/wiki/Category:Formats)\n\n|       Name       |               Extensions                | Supported |                                                   Uses                                                   |                                Support cover                                | Support series |\n| :--------------: | :-------------------------------------: | :-------: | :------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------: | :------------: |\n|   EPUB (IDPF)    |                 `.epub`                 |    ✅     |                        Native [`zip`](https://www.php.net/manual/en/book.zip.php)                        |                                     ✅                                      |       ✅       |\n| Kindle (Amazon)  |     `.azw`, `.azw3`, `.kf8`, `.kfx`     |    ✅     |                 Native [`filesystem`](https://www.php.net/manual/en/book.filesystem.php)                 |                ✅ (See [MOBI cover note](#mobi-cover-note))                 |       ❌       |\n|    Mobipocket    |             `.mobi`, `.prc`             |    ✅     |                 Native [`filesystem`](https://www.php.net/manual/en/book.filesystem.php)                 |                ✅ (See [MOBI cover note](#mobi-cover-note))                 |       ❌       |\n|       PDF        |                 `.pdf`                  |    ✅     |                   [`smalot/pdfparser`](https://github.com/smalot/pdfparser) (included)                   |      Uses [`imagick`](https://www.php.net/manual/en/book.imagick.php)       |       ❌       |\n|  iBook (Apple)   |                `.ibooks`                |    ❌     |                                                                                                          |                                     N/A                                     |      N/A       |\n|       DjVu       |             `.djvu`, `.djv`             |    ❌     |                                                                                                          |                                     N/A                                     |      N/A       |\n| Rich Text Format |                 `.rtf`                  |    ❌     |                                                                                                          |                                     N/A                                     |      N/A       |\n|   FictionBook    |                 `.fb2`                  |    ✅     |                 Native [`filesystem`](https://www.php.net/manual/en/book.filesystem.php)                 |                                     ✅                                      |       ✅       |\n| Broadband eBooks |             `.lrf`, `.lrx`              |    ❌     |                                                                                                          |                                     N/A                                     |      N/A       |\n|    Palm Media    |                 `.pdb`                  |    ❌     |                                                                                                          |                                     N/A                                     |      N/A       |\n|    Comics CBZ    |                 `.cbz`                  |    ✅     |                        Native [`zip`](https://www.php.net/manual/en/book.zip.php)                        |                                     ✅                                      |       ✅       |\n|    Comics CBR    |                 `.cbr`                  |    ✅     | [`rar`](https://github.com/cataphract/php-rar) PHP extension or [`p7zip`](https://www.7-zip.org/) binary |                                     ✅                                      |       ✅       |\n|    Comics CB7    |                 `.cb7`                  |    ✅     |                                 [`p7zip`](https://www.7-zip.org/) binary                                 |                                     ✅                                      |       ✅       |\n|    Comics CBT    |                 `.cbt`                  |    ✅     |                       Native [`phar`](https://www.php.net/manual/en/book.phar.php)                       |                                     ✅                                      |       ✅       |\n|      Audio       | `.mp3`, `.m4a`, `.m4b`, `.flac`, `.ogg` |    ✅     |               If [`kiwilan/php-audio`](https://github.com/kiwilan/php-audio) is installed                | [Depends of format](https://github.com/kiwilan/php-audio#supported-formats) |       ❌       |\n\n### MOBI cover note\n\nMobipocket files and derivatives (`.mobi`, `.prc`, `.azw`, `.azw3`, `.kf8`, `.kfx`) can have a cover image embedded in the file. With native solution of `php-ebook` cover could be extracted but resolution is not good. Best solution is to convert file with [`calibre`](https://calibre-ebook.com/) and use `EPUB` format.\n\n## Testing\n\n```bash\ncomposer test\n```\n\n## Changelog\n\nPlease see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.\n\n## Credits\n\n-   [`spatie`](https://github.com/spatie) for `spatie/package-skeleton-php`\n-   [`kiwilan`](https://github.com/kiwilan) for `kiwilan/php-archive`, `kiwilan/php-audio`, `kiwilan/php-xml-reader`\n-   [Ewilan Rivière](https://github.com/ewilan-riviere) author of this package\n-   [All Contributors](../../contributors)\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE.md) for more information.\n\n[\u003cimg src=\"https://user-images.githubusercontent.com/48261459/201463225-0a5a084e-df15-4b11-b1d2-40fafd3555cf.svg\" height=\"120rem\" width=\"100%\" /\u003e](https://github.com/kiwilan)\n\n[version-src]: https://img.shields.io/packagist/v/kiwilan/php-ebook.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[version-href]: https://packagist.org/packages/kiwilan/php-ebook\n[php-version-src]: https://img.shields.io/static/v1?style=flat\u0026label=PHP\u0026message=v8.1\u0026color=777BB4\u0026logo=php\u0026logoColor=ffffff\u0026labelColor=18181b\n[php-version-href]: https://www.php.net/\n[downloads-src]: https://img.shields.io/packagist/dt/kiwilan/php-ebook.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[downloads-href]: https://packagist.org/packages/kiwilan/php-ebook\n[license-src]: https://img.shields.io/github/license/kiwilan/php-ebook.svg?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[license-href]: https://github.com/kiwilan/php-ebook/blob/main/README.md\n[tests-src]: https://img.shields.io/github/actions/workflow/status/kiwilan/php-ebook/run-tests.yml?branch=main\u0026label=tests\u0026style=flat\u0026colorA=18181B\n[tests-href]: https://packagist.org/packages/kiwilan/php-ebook\n[codecov-src]: https://img.shields.io/codecov/c/gh/kiwilan/php-ebook/main?style=flat\u0026colorA=18181B\u0026colorB=777BB4\n[codecov-href]: https://codecov.io/gh/kiwilan/php-ebook\n","funding_links":["https://github.com/sponsors/kiwilan"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Fphp-ebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiwilan%2Fphp-ebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiwilan%2Fphp-ebook/lists"}