Skip to content

Is there any documentation on how to use this? #266

Closed Answered by mickael-menu
IneffableBunch asked this question in Q&A
Discussion options

You must be logged in to vote

To get you started, here's how to build a minimal EPUB reader using the Readium Swift toolkit:

1. Parse an EPUB file into a Publication model using the Streamer

let streamer = Streamer()
let epubAsset = FileAsset(url: epubURL)

streamer.open(asset: epubAsset, allowUserInteraction: true) { result in
    switch result {
    case .success(let publication):
        presentNavigator(publication)
    case .failure(let error):
        showError(error)
    case .cancelled:
        break
    }
}

2. Add the Publication to the local HTTP server to serve the EPUB content

To render an EPUB, it needs to be served through an HTTP server. The streamer package provides one.

You need to create it once and …

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Pasta
Comment options

@mickael-menu
Comment options

Answer selected by IneffableBunch
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants