Hi Mahdi,
Not sure whether I understand your question correctly, but maybe a
little background will help.
An epub file is basically a zip file. It contains HTML files for the
book content, CSS, images and fonts.
It also contains several XML files that contain the book's title,
author and the order in which the chapters of the book should be read.
Epublib makes the contents of all these files available via the
Book.getResources() method.
The Epub standard defines three indexes into the book's contents.
The Spine, which is the list of chapters if you were to read the book
from cover to cover.
The Table of Contents.
And finally the Guide, which is a collection of predefined 'special'
pages.
Epublib makes all 3 ways of accessing the content available. The Spine
is available via the Book.getSpine() method, the Table of Contents is
available via the Book.getTableOfContents() method and the Guide is
available via the Book.getGuide() method.
The problem of this is that none of these methods guarantee to give
you the entire contents of the book.
The Spine often does not contain the cover page.
Sometimes large HTML files are split up in pieces to save memory.
These individual pieces will all be in the Spine, but only the first
piece will be referred to by the Table of Contents.
The Table of Contents may point to chapters that are not in the Spine
or the Guide.
Finally the Guide. The Guide is used to point to predefined 'special'
pages. Pages like the cover pages, the list of images page, the table
of contents page, etc.
Of the available Guide pages only the cover page is widely used.
Finally there may be HTML files in the epub file that are referenced
by none of these indexes.
Now a common question is: how do I retrieve the entire contents of the
book.
The answer is: you can't. At least not reliably.
Epublib has the Book.getContents() method. This gives you all
Resources of the Book that can be reached via the Spine, the
TableOfContents or the Guide.
Hope this helps,
Paul Siegmann