Class: EpubData

EpubData(input)

Class to load data from epub file

Needs JSZip https://stuk.github.io/jszip/

Constructor

new EpubData(input)
Parameters:
Name Type Description
input HTMLInputElement

File input to load epub file

Extends

  • EventTarget

Members

id :String

Book unique identifier

Type:
  • String
manifest :Object

list of items mapping an id and a href

Type:
  • Object
spine :Array.<String>

List of ids

Type:
  • Array.<String>

Methods

parse(doc)

Get data from a content.opf document

Parameters:
Name Type Description
doc Document

Xml document

spineFromHref(href) → {String}

Get the spine root from an href.

Parameters:
Name Type Description
href String

Page href

Returns:

Path in spine or null.

Type
String
toString() → {String}

Return a JSON stringified version of book data

Returns:

book data

Type
String

Events

event:epubdata-error

Fired when an error has occured during epub loading or data reading.

Type:
  • CustomEvent
event:epubdata-loaded

Fired when data is loaded from an epub file

Type:
  • CustomEvent