Click here to skip to this page's main content.

 Hello!   The State of Washington is participating in our eBook lending program. Browse the growing lending library of over 250,000 eBooks!

Site Search

Site Search
Last edited by Jessamyn West
September 15, 2008 | History

Book Reader

Requested Features

  • Ability to work with non-archive books (which means the bookreader should not expect data in any format)
  • Ability to embed into any webpage with ease
  • Possibility of keeping multiple books in the same page (no global state)

To make is it easier to work with other sources, the bookreader can expect a book interface with the following functions from the client.

getPageCount()
getPage(index)
getPageWidth(index)
getPageHeight(index)

The book reader can have optional functionality which is enabled only when the book implementation has the required method defined.
For example, bookmarks functionality can be enabled only when the book interface has getBookmarks method defined.

getBookmarks(index)

Typical usage:

<script src="/js/bookreader.js" type="text/javascript"/>
<script src="/js/archivebook.js" type="text/javascript"/>
<div id="book1"></div>
<script>
    document.onload = function() {
        var b = bookreader("book1", ArchiveBook("tomsayer"));
       b.showPage(42);
    }
</script>

History Created September 15, 2008 · 154 revisions

February 14, 2015 Edited by Jessamyn West added new example!
November 21, 2013 Edited by Anand Chitipothu Fixed the link to download source code.
January 3, 2012 Edited by mangtronix Edited without comment.
January 3, 2012 Edited by mangtronix Edited without comment.
September 15, 2008 Created by Anand Chitipothu book reader suggestions