Walflower is an ActionScript framework for working with ePub files in Flash. You can download the code from github at http://www.github.com/maxl0rd/walflower.
EPub is an open-source format that has become one of the most popular ways of distributing non-DRM-protected eBooks. It is essentially a zip file containing a directory of XHTML documents, supporting files like images, and a variety of manifests and metadata that describe the shape of the document, the order it should be read, etc.
Walflower integrates the nice zip library written by nochump, which is not the fastest unzip routine ever seen, but it works quite nicely. It then parses all the book meta-data into various data structures that describe the book. Finally, it works through all the XHTML pages and parses them into TextFlows that can be displayed with the Text Layout Framework, as described in a previous post.
There is a sample project up in the repo that shows this in action here: http://github.com/maxl0rd/walflower/tree/master/examples/EPubExample/
It does not generate any output yet, but it would be a good starting point for a project based on this lib. The process of making sense of this file format was rather horrible, and I hope this code is useful to anyone on the same path.
You can see an example eBook reader that was made with this library over here:
walflower halloween book teaser.
Hi Max,
ReplyDeleteI am Uday Bhaskar from India. I am using your files of EPubExample in my project to read epub format in flex, to display the book content on stage i am not getting any clue. please help me, how I can do that? Thank you in Advance.
Hi Uday
ReplyDeleteThe walflower project that I am showing here does not include any display code. It only unzips and parses epubs into data structures, and translates xhtml into textflow.
You will have to learn how to use the Text Layout Framework, and write your own display code to paginate and style a document to create an epub reader from this. Luckily, using TLF is documented on many places on the web.
Hi Max
ReplyDeleteMay I download Walflower v2.0 source code.
Thank you.
kevin chao
I see it's been quite some time since you blogged on this project or made any changes to the git repo. I'm interested in doing something similar, and if you're willing, I would love to see the code used in your demo application (the one that actually displays content). Would you mind sharing it?
ReplyDeleteHi
ReplyDeleteThis is a way to read ePub format I want to get output in ePub format. please can you have any solution or example please explain it...
Vinitkar Tripathi
Spark'ans.