EPub: Create ebook in EPUB format for ex. Apple iPad

Recommend this page to a friend!
  Info   View files (22)   Download .zip   Reputation   Support forum (37)   Blog    
Ratings Unique User Downloads Download Rankings
78%Total: 4,518 This week: 1All time: 619 This week: 261
Version License PHP version Categories
epub 3.22GNU Lesser Genera...5.2PHP 5, Files and Folders, Content man...
Description Author

This class can be used to create create an ebook in EPUB format for Apple iPad and other ebook readers.

It can set the ebook details like the author, publisher, comments, etc., as well the ebook chapter data.

The class builds an archive with all the ebook information and serves the ebook archive for download or returns it as a string.

PHP 5.2 seems to work. 5.3 with GD extensions are recommended


Drupal 7 project print
Looking for ePub package

Innovation Award
PHP Programming Innovation award nominee
April 2010
Number 9

Prize: One copy of Delphi for PHP
The release of the iPad raised the public interest for ebooks again.

EPub is a ebook format that is supported by the iPad.

This class provides a pure PHP solution to build ebooks in the EPub format.

Manuel Lemos
Picture of Asbjorn Grandt
Name: Asbjorn Grandt <contact>
Classes: 10 packages by
Country: Denmark Denmark
Age: 48
All time rank: 1771 in Denmark Denmark
Week rank: 81 1 in Denmark Denmark
Innovation award
Innovation award
Nominee: 4x

File Role Description
demo (7 files)
EPub.php Class Main class, 2.5x is backwards compatible with EPub 1.0, except for the createUUID function.
EPubChapterSplitter.php Class HTML Splitter, can be used without EPub. It splits an (X)HTML file into an array of parts, splitting at either a set max size or at a search string (both regexp or plain text supported), while retaining the HTML structure across the split point. When using a search string, the matching HTML entity/line is returned as the parts' array key.
EPub.NCX.php Class Structure holding NCX data
EPub.OPF.php Class Structure holding OPF data
EPub.HtmlEntities.php Class Utility class
Zip.php Class Zip.php from my Zip class, added for convenience
lib.uuid.php Class J. King's DrUUID class for UUID generation, required by EPub
EPub.Example1.php Example Example file for generating book for download.
EPub.Example2.php Example Example file for showing nested chapter levels.
EPub.Example3.php Example Example script showing generation of an ePub 3 book
EPub.ExampleSimple.php Example Example script showing the most basic steps needed to create a simple book
EPub.ExampleImg.php Example Simple Example showing only image import features
Logger.php Example Used by the example scripts
lib.uuid.LICENCE.txt Doc. LICENCE file for J. King's DrUUID class for UUID generation
lib.uuid.manual.html Doc. Documentation for J. King's DrUUID class for UUID generation

  Files  /  demo  
File Role Description
   512x700.jpg Data Used by example scripts
   512x700_1.jpg Data Used by example scripts
   512x700_2.jpg Data Used by example scripts
   512x700_3.jpg Data Used by example scripts
   512x700_g1.gif Data Auxiliary data
   cover-image.jpg Data Demo image
   DemoInlineImage.jpg Data Used by example scripts

epub-2014-09-21.zip 553KB
epub-2014-09-21.tar.gz 545KB
Install with Composer
Needed packages  
Class DownloadWhy it is needed Dependency
Zip .zip .tar.gz ePub's are Zip archives, this class is needed to generate those. Zip is a small, easy to use Zip archive creator. Required
 Version Control Unique User Downloads Download Rankings  
This week:1
All time:619
This week:261
User Ratings User Comments (4)
 All time
A very useful class to create epub files.
7 years ago (Ashesh Bharadwaj)
7 years ago (gautier abry)
The most completed one.
8 years ago (Saif Taifur)
This class is continually updating to add new features as des...
8 years ago (Kirstyn Amanda Fox)

For more information send a message to info at phpclasses dot org.