PHP Classes
elePHPant
Icontem

PHP ePub Generator Tool: Create ebook files dynamically in the EPub format

Recommend this page to a friend!
  Info   View files Example   View files View files (59)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2017-10-25 (1 month ago) RSS 2.0 feedNot enough user ratingsTotal: 106 This week: 5All time: 8,786 This week: 153Up
Version License PHP version Categories
phpepub 1.0The PHP License5PHP 5, Files and Folders, Content man...
Description Author

This package can create ebook files dynamically in the EPub format.

It can compose a ebook by adding HTML for each section of the publication.

After finalizing a ebook the class generates a ZIP archive that is the actual ebook in the ePub format.

Name: Emilio Sanchez <contact>
Classes: 1 package by
Country: Spain Spain
Age: ???
All time rank: 4088110 in Spain Spain
Week rank: 131 Up8 in Spain Spain Up

Details

PHP ePub generator

PHPePub allows a php script to generate ePub Electronic books on the fly, and send them to the user as downloads.

PHPePub support most of the ePub 2.01 specification, and enough of the new ePub3 specification to make valid ePub 3 books as well.

The projects is also hosted on PHPClasses.org at the addresses: http://www.phpclasses.org/package/6115

PHPePub is meant to be easy to use for small projects, and still allow for comples and complete e-books should the need arise.

The Zip.php class in this project originates from http://www.phpclasses.org/package/6110

or on Github: git://github.com/Grandt/PHPZip.git

See the examples for example usage. The php files have "some" doumentation in them in the form of Javadoc style function headers.

Installation

Import

Add this requirement to your composer.json file:

    "grandt/phpepub": ">=4.0.3"

Composer

If you already have Composer installed, skip this part.

Packagist, the main composer repository has a neat and very short guide. Or you can look at the guide at the Composer site.

The easiest for first time users, is to have the composer installed in the same directory as your composer.json file, though there are better options.

Run this from the command line:

php -r "readfile('https://getcomposer.org/installer');" | php

This will check your PHP installation, and download the composer.phar, which is the composer binary. This file is not needed on the server though.

Once composer is installed you can create the composer.json file to import this package.

{
    "require": {
        "grandt/phpepub": ">=4.0.3",
        "php": ">=5.3.0"
    }
}

Followed by telling Composer to install the dependencies.

php composer.phar install

this will download and place all dependencies defined in your composer.json file in the vendor directory.

Finally, you include the autoload.php file in the new vendor directory.

<?php
    require 'vendor/autoload.php';
    .
    .
    .

TODO:

  • The goal being to encompass the majority of the features in the ePub 2.0 and 3.0 specifications, except the Daisy type files.
  • Add better handling of Reference structures.
  • Improve handling of media types and linked files.
  • A/V content is allowed, but definitely not recommended, and MUST have a fallback chain ending in a valid file. If no such chain is provided, the content should not be added.
  • Documentation, no one reads it, but everyone complains if it is missing.
  • Better examples to fully cover the capabilities of the EPub classes.
  • more TODO's.
  Files folder image Files  
File Role Description
Files folder imagelegacy (4 files)
Files folder imagesrc (2 files, 1 directory)
Files folder imagetests (9 files, 1 directory)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file documentation.css Data Auxiliary data
Accessible without login HTML file ReadMe.html Doc. Documentation
Accessible without login Plain text file README.md Doc. Documentation
Accessible without login Plain text file REVISION.TXT Data Revision log
Accessible without login Plain text file test.php Example Example script

  Files folder image Files  /  legacy  
File Role Description
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file EPub.Test.Example.php Example Example script
  Accessible without login Plain text file install.bat Data Auxiliary data
  Accessible without login Plain text file install.sh Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imagePHPePub (2 directories)
  Accessible without login HTML file lib.uuid.manual.html Doc. Documentation
  Plain text file lib.uuid.php Class Class source

  Files folder image Files  /  src  /  PHPePub  
File Role Description
Files folder imageCore (4 files, 1 directory)
Files folder imageHelpers (8 files, 2 directories)

  Files folder image Files  /  src  /  PHPePub  /  Core  
File Role Description
Files folder imageStructure (2 files, 2 directories)
  Plain text file EPub.php Class Class source
  Plain text file EPubChapterSplitter.php Class Class source
  Plain text file Logger.php Class Class source
  Plain text file StaticData.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Core  /  Structure  
File Role Description
Files folder imageNCX (3 files)
Files folder imageOPF (10 files)
  Plain text file Ncx.php Class Class source
  Plain text file Opf.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Core  /  Structure  /  NCX  
File Role Description
  Plain text file AbstractNavEntry.php Class Class source
  Plain text file NavMap.php Class Class source
  Plain text file NavPoint.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Core  /  Structure  /  OPF  
File Role Description
  Plain text file DublinCore.php Class Class source
  Plain text file Guide.php Class Class source
  Plain text file Item.php Class Class source
  Plain text file Itemref.php Class Class source
  Plain text file Manifest.php Class Class source
  Plain text file MarcCode.php Class Class source
  Plain text file Metadata.php Class Class source
  Plain text file MetaValue.php Class Class source
  Plain text file Reference.php Class Class source
  Plain text file Spine.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Helpers  
File Role Description
Files folder imageenums (1 file)
Files folder imageRendition (1 file)
  Plain text file CalibreHelper.php Class Class source
  Plain text file Enum.php Class Class source
  Plain text file FileHelper.php Class Class source
  Plain text file IBooksHelper.php Class Class source
  Plain text file ImageHelper.php Class Class source
  Plain text file MimeHelper.php Class Class source
  Plain text file StringHelper.php Class Class source
  Plain text file URLHelper.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Helpers  /  enums  
File Role Description
  Plain text file Boolean.php Class Class source

  Files folder image Files  /  src  /  PHPePub  /  Helpers  /  Rendition  
File Role Description
  Plain text file RenditionHelper.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imagedemo (9 files)
  Accessible without login Plain text file composer.json Data Auxiliary data
  Accessible without login Plain text file EPub.Example1.php Example Example script
  Accessible without login Plain text file EPub.Example2.php Example Example script
  Accessible without login Plain text file EPub.Example2b.php Example Example script
  Accessible without login Plain text file EPub.Example3.php Example Example script
  Accessible without login Plain text file EPub.Example3_1.php Example Example script
  Accessible without login Plain text file EPub.Example3_2.php Example Example script
  Accessible without login Plain text file EPub.ExampleImg.php Example Example script
  Accessible without login Plain text file EPub.ExampleSimple.php Example Example script

  Files folder image Files  /  tests  /  demo  
File Role Description
  Accessible without login Image file 512x700.jpg Data Auxiliary data
  Accessible without login Image file 512x700_1.jpg Data Auxiliary data
  Accessible without login Image file 512x700_2.jpg Data Auxiliary data
  Accessible without login Image file 512x700_3.jpg Data Auxiliary data
  Accessible without login Image file 512x700_g1.gif Data Auxiliary data
  Accessible without login Image file cover-image.jpg Data Auxiliary data
  Accessible without login Image file DemoInlineImage.jpg Data Auxiliary data
  Accessible without login Image file rxhVVUP.gif Icon Icon image
  Accessible without login Plain text file test.svg Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:106
This week:5
All time:8,786
This week:153Up