Q:

Is there a way to convert epub format to images?

I need a tool to programmatically convert epub files to a series of images.  The output should look like screenshots taken on a canonical device (for this application, an iPad).  I haven't been able to find any tools that do something like this.
So what I'd really like (1) is a tool that does that.  But assuming that I'm correct that no such tool exists, is there (2) a library (preferably a Perl module, but I'm not that picky) that will read and render ePub?
Obviously, rolling my own I could combine tools for unzipping, reading html, reading xml, putting everything in the right order, and rendering html within certain constraints.  Though I'd rather not do that, and if that's the only option I'll have to go on to look for a tool that will do the last part of that or I'll have to create that too.
Any leads on (1), or failing that (2)?

A:

Apologies if what I'm about to type is just crazy-talk on my part--in fact, I'm pretty sure it is--but perhaps something like this might work and I'm kind of interested in knowing how well it might work for you:
Use Frank (https://github.com/moredip/Frank) to control the iOS Simulator on a Mac.  Program it to open up the EPUB docs you need.
All you need then is something to automate the taking of the screen shots.  Obviously, these will look like the EPUBs are being rendered in an iPad (or an iPhone if you wish--the iOS Simulator does both, of course).  
Automating the screenshots can probably be done with AppleScript, although the hard part might be getting it to talk to Frank.  Worst case, you can tell Frank to pause for 5 seconds after it loads each page and tell AppleScript to take a screen shot every five seconds.  That sucks, but if you're desperate, it will get it done.  It's also possible Frank can somehow make the screenshots happen--I haven't used it enough to know.

