I have ~1500 generated .epub files and their indesign files

I need a script or program to generate previews for these EPUBs. Preview could be in jpeg or epub format.

By preview I mean first 10 pages of the book as indicated by indesign's pagination system.
I use both Mac and Windows machines,

  • 1
    What do you consider a preview (first N pages?). What platform/OS are you working on? – Anthon Mar 7 '14 at 14:22
  • 1
    Is there any consistency in the formatting of the InDesign files or the epubs? If they're done with a template, it should be fairly easy to put together a script that would grab the first n sections (eg, cover, copyright page, introduction, chapter 1). If the files aren't consistent or well-tagged, then it'll be trickier. – Tom Mar 7 '14 at 22:06
  • 5
    Do you have some indication (based on CSS, or the indesign files) of where page 10 ends? A normal EPUB page contents varies wildly and depends on the resolution of the device it is viewed upon, the font size, margins etc. – Anthon Mar 11 '14 at 12:05

The ePub file does not contain any information about the InDesign pagination -- that information is all left behind when the ePub file is generated. So your only possible way to do that is inside InDesign.

Inside InDesign it will be either point-click-clic-click ...a few thousand times or you script it with an additional tool like AutoHotkey or AutoIt that can open, select the first 10 pages and then save the selection to ePub and re-do-it in the next file...

If your files have a lot of consistency -- almost the same structure -- and you can live with separating the first chapter, for example, then you can open them up (unzip), and edit with "sed" or "awk" to have a smaller set containing only a certain specific part.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.