8000 GitHub - imrelaszlo/epubli-epub: PHP library for reading metadata, document structure, and plain text contents from EPUB files.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PHP library for reading metadata, document structure, and plain text contents from EPUB files.

License

Notifications You must be signed in to change notification settings

imrelaszlo/epubli-epub

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Epubli EPUB Library

PHP library for reading metadata, document structure, and plain text contents from EPUB files.

Origin

This PHP EPUB library is a fo 6936 rk of splitbrain/php-epub-meta. The original code was changed quite a bit to fit our more conventional PHP coding standards in a symfony environment. Additional functionality includes reading the TOC/spine structure of EPUBs and extracting contents from contained XML files.

Installation

Using composer:

composer require hans-thomas/epub

Usage

<?php

// Open an EPUB file
$epub = new Epubli\Epub\Epub('/path/to/your/book.epub');
// and read some of its metadata
$title = $epub->getTitle();
$authors = $epub->getAuthors();
$desc = $epub->getDescription();

// Get the EPUB’s structural elements
$toc = $epub->getToc();
$spine = $epub->getSpine();

// Iterate over the EPUB structure
foreach ($spine as $spineItem) {
    // Get some text from the EPUB
    $chapterText = $spineItem->getContents();

    // Or find all navigation points pointing to that spine item
    $navPoints = $toc->findNavPointsForFile($spineItem->getHref());

    // Do something useful with the NavPoints.
    
    // At the end, don't forget to close the spine item
    $spineItem->close();
}

About

PHP library for reading metadata, document structure, and plain text contents from EPUB files.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 99.6%
  • HTML 0.4%
0