epub_viewer
epub_viewer copied to clipboard
Changing epub sdk
hello, would you mind trying a sdk change to Readium, a more stable & well maintained epub sdk for android? folio is not fixing some big issues, like randering a big TOC, and opening big epub files. thanks, Tayeb.
Hey, You're right about Folioreader not fixing issues. I'll look into Readium and work on changing it.
dont you need a flutter plugin for readium?
On 10/31/20, Festus Olusegun [email protected] wrote:
Hey, You're right about Folioreader not fixing issues. I'll look into Readium and work on changing it.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/JideGuru/epub_viewer/issues/49#issuecomment-719989705
I'll use the swift and kotlin libraries to turn this one into a Flutter plugin
otherwise just add it as a platform code and use platform channel to open the epub into a dedicated activity, maybe.
On 11/1/20, Festus Olusegun [email protected] wrote:
I'll use the swift and kotlin libraries to turn this one into a Flutter plugin
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/JideGuru/epub_viewer/issues/49#issuecomment-720068191
any updates on this ?
@mrifni The past few weeks have been pretty hectic for me. but I'm almost done with this. Check the readium-android branch if you want contribute. Thanks
@mrifni It's this same repo. check the readium-android branch
any updates on this ?
Waiting for the update
any updates on this is the plugin ready ?
please change to readium sdk, Folioreader not update anymore!
I've viewed the code of readium, I think we should connect direct from dart to readium js and readium css via webview. If we could implement these from flutter, we could have cross platform epub viewer. In Readium Kotlin and Readium Swift, they connect webview with readium js and css.
@winterdl Wow that's a great idea. I actually never thought of that. I'll start looking into that Immediately.
I didn’t test but you should try this case, android or ios plugin uses r2-stream to create server and addPublication, from flutter we call startServer, stopServer, addEpub, the plugin will return baseUrl after parse and serve publication. Flutter side we use webview to open the baseUrl, inject readium js and readium css. For simple we could try with folioReader js and folioReader css, all native ui now handle by flutter ui. If we have time, we could port r2-server and r2-stream to dart, and remove the native plugins
you dont have to, its already done by some https://github.com/Mantano/mp_readium
Thanks @mrifni and @winterdl. This should make the work easier and faster
I known the project but they will take time to fully port r2-streamer to dart, and the project doesn’t have r2-navigator port. The r2-streamer-kotlin and r2-streamer-swift are mature and stable now, we should use them as native plugin to hosting publication, and starting implement r2-navigator by flutter. When the porting of r2-streamer- dart done, we could remove the native plugin later. FolioReader itselft is a simplified of r2-navigator reimplement, simple and easier to understand than r2-navigator.
Good news, with the latest update of the mno packages last day, we could serve publication with flutter, no need to create native plugin:
final pubBox = await EpubParser().parse(filePath);
if (pubBox != null) {
serverBloc.add(StartServer(
[FetcherRequestHandler(pubBox.publication)]));
}
The bad news is the flutter webview not as good as native webview, I've just tested the flutter webview to open a book, It was too laggy and slow, too dificult to swipe if we intergrate webview with pageview, the pageview didnt have preload, if we want to port UI to flutter, it will be long way to go, but we should try, and hope flutter engine will be better.
@winterdl that sounds bad. Can you send a link to the repo where you implemented this? Also, I already created a new reading branch(locally) where I'll start working on moving from Folioreader to readium (with mp-readium)
Hello, is webView required for reading epub? why dont we use a native text widget?
Both Readium and FolioReader are using webview for rendering html content and paging using css column. If your ebook only text, you could rendering content by canvas, find text_composion for example or flutter_novel, or using html_view. I’ve just quick test, not created repo yet, but the test very simple I will post to gist later.
The gist contains main functions to open server, load epub from asset and create webview to open publication from created server: https://gist.github.com/winterdl/de0bac7ee7cd9bd932dc486c54ac06a5
webview issues:
https://github.com/flutter/flutter/issues/61795 https://github.com/flutter/flutter/issues/54810 https://github.com/flutter/flutter/issues/34138 https://stackoverflow.com/questions/55587918/web-view-is-too-slow
i think it would be great to migrate to readium either native or ported, better thant the native webView. this would let the plugin be compatible also with windows, mac, linux and web. what do you think?
i think we better create a special branch for real test of the plugin with the ported readium library, no?
On 9/24/21, winterdl @.***> wrote:
The gist contains main function to open server, load epub from asset and create webview to open publication from created server: https://gist.github.com/winterdl/de0bac7ee7cd9bd932dc486c54ac06a5
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/JideGuru/epub_viewer/issues/49#issuecomment-926287511
I've created a testing repo, flutter_readium, reading epub app using only flutter, based on readium project. https://github.com/winterdl/flutter_readium . I dont have time to follow the project, hope everyone could create a repo to mainly development the idea. Thank you.
Hello, after trying your well writen example, all i can see is the Open book button, but clicking it do nothing. please note that i built the release apk, didnt run flutter run.
On 9/27/21, winterdl @.***> wrote:
I've created a testing repo, flutter_readium, reading epub app using only flutter which based on readium project. https://github.com/winterdl/flutter_readium . I dont have time to follow the project, hope everyone could create a repo to mainly development the idea. Thank you.
-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/JideGuru/epub_viewer/issues/49#issuecomment-927558921
I dont have android device, I just run debug on emulator. I've just tested with the code from repo, it runs okay. The code also working on real ios device.

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.2.3)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.60.2)

I've built release apk and installed to emulator, it wont open the book as you said and not throw any errors, maybe these errors came from the parser packages (https://github.com/Mantano) which the app used or came from the embbed webview. I confirmed the bug, but not have time to go further. The parser may contains some issues, hope they will actively development.
@voipworld I fixed the issue with release build, you should add android.permission.INTERNET to AndroidManifest.xml.
For now, we have 2 ways to changing sdk to readium
- Porting all readium projects to flutter (https://github.com/Mantano done almost the hard works), I've just demo a prototype at above repo, I though this is a promise way, we could write one time and run on ios and android, this way could apply to FolioReader as well.
- Write each native plugin, we have the branch https://github.com/JideGuru/epub_viewer/tree/readium-android, we need a prototype ios plugin.
Do you have any ETA for this ? I have someone integrated this to flutter to method channel and it was working good but not 100%. I need someone who can help me integrating into flutter app, Im ready to pay please.