After looking around for something like this, I was thinking I would have to create something from scratch, then I found this project. Fantastic work, thank you very much.
If I were going to make an improvement in this script I would like to see something that handles audio and video files in much the same way that images are handled now.
Also a TOC, while not important in ePUB files, is important when I convert ePUB to mobi format. Therefore it would be a nice feature if I had the option of generating a TOC on the fly just like it creates the opf file.
Andy Ward - 2011-03-29 19:55:03 - In reply to message 2 from Asbjorn Grandt
What I was hoping for was support for inline media. So for example this tag inserted into my HTML should work in iBooks <audio src="../media/linda.mp3" controls="" preload="auto" autobuffer=""/>. The way your script works with images, using EXTERNAL_REF_ADD, works great for me, I just dump in the entire HTML page and EPub sorts out the images in there and adds them to the file. It would be great if it could do the same with inline audio and video files, the trouble is it doesn't add the audio file to the epub package.
I will see what I can do to write the function to handle these, then you can do with it as you please. I just hate to make too many alterations to your code, then when you release a new version I have to go through and make it all work again.
Asbjorn Grandt - 2011-03-31 16:54:21 - In reply to message 4 from Asbjorn Grandt
I have a beta you might want to test out.
You can find it at http://www.grandt.com/ePub/EPub_php.txt
Just rename it back to EPub.php.
Rev. 2.05 - 2011-03-31
* Changed: referenced media now attemps to include audio and video.
* Added: function createTOC, to generate and add a Table of Contents to the book.
* Fixed: setCoverImage: The default assumption that filenames were absolute as seen from the document root was ... ill advised.
* Fixed: If the HTML added is not utf-8 the class could produce books which would fail with invalid encoding.
* Fixed: Cover page added to the Navigation Map, it shouldn't.
* Fixed: The Coverpage HTML generated by addCoverImage was not compliant with the XHTML 1.1 sppecification.
* Added: funciton addReferencePage. Reference pages is usually one or two pages for items such as Table of Contents, reference lists, Author notes or Acknowledgements. These do not show up in the regular navigation list.
* Added: Constants REFERENCE_* for use with the new addReferencePage.