mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-03 14:59:18 +02:00
3.2 KiB
3.2 KiB
ePub
Creates a new Book
Parameters
url
(string | ArrayBuffer) URL, Path or ArrayBufferoptions
object to pass to the bookoptions.request
the request function to use
Examples
ePub("/path/to/book.epub", {})
Returns Book a new Book object
Book
Creates a new Book
Parameters
_url
stringoptions
objectoptions.requestMethod
method a request function to use instead of the default
Examples
new Book("/path/to/book.epub", {})
Returns Book
url
loaded
Properties
loaded.manifest
promise A child method as property defination
open
open a url
Parameters
Examples
book.open("/path/to/book.epub", { base64: false })
Returns Promise of when the book has been loaded
unpack
unpack the contents of the Books packageXml
Parameters
packageXml
document XML Document
section
Alias for book.spine.get
Parameters
target
string
renderTo
Sugar to render a book
Parameters
element
options
requestMethod
Switch request methods depending on if book is archived or not
Parameters
_url
unarchive
Unarchive a zipped epub
Parameters
bookUrl
isBase64
isArchivedUrl
Checks if url has a .epub or .zip extension, or is ArrayBuffer (of zip/epub)
Parameters
bookUrl
coverUrl
Get the cover url
range
Find a DOM Range for a given CFI Range
Parameters
cfiRange
EpubCFI
EPUB CFI spec: http://www.idpf.org/epub/linking/cfi/epub-cfi.html
Implements:
- Character Offset: epubcfi(/6/4[chap01ref]!/4[body01]/10[para05]/2/1:3)
- Simple Ranges : epubcfi(/6/4[chap01ref]!/4[body01]/10[para05],/2/1:1,/3:4)
Does Not Implement:
- Temporal Offset (~)
- Spatial Offset (@)
- Temporal-Spatial Offset (~ + @)
- Text Location Assertion ([)
Parameters
cfiFrom
base
ignoreClass