Coder Social home page Coder Social logo

vocsy_epub_viewer's Introduction

Vocsy Epub Viewer pub package

originally a fork of epub_kitty with few more features. i made this out of epub_kitty because the author was inactive(he isn't merging PRs or attending to issues) and i started having alot of issues with the plugin

vocsy_epub_viewer is an epub ebook reader that encapsulates the folioreader framework. It supports iOS and android.

Features

Name Android iOS
Reading Time Left / Pages left
Last Read Locator
Distraction Free Reading
Load E-Pub from Asset
Copy and Share Text
Highlight Text
Multiple Theme [Light / Dark]
Support Multiple Device Language
Change FontStyle
Android 13 Supported

ScreenShots

  • Light
                 
  • Dark
              

Install

This plugin requires Swift to work on iOS. Also, the minimum deployment target is 9.0

platform :ios, '9.0'

Import into pubspec.yaml

dependencies:
  vocsy_epub_viewer: latest_version

NOTE Please add this to the release build type in your app build.gradle to avoid crashes on android release builds

minifyEnabled false
shrinkResources false

NOTE Add These Lines In manifest

  
  • 1
    <uses-permission android:name="android.permission.INTERNET" />
  • 2
   xmlns:tools="http://schemas.android.com/tools"
  • 3
   android:usesCleartextTraffic="true"
   android:requestLegacyExternalStorage="true"
   android:networkSecurityConfig="@xml/network_security_config"
  • 4
   android:exported="true"

NOTE android -> app -> src -> main -> res -> xml Inside xml Folder create xml file network_security_config.xml

Usage

VocsyEpub.setConfig(
           themeColor: Theme.of(context).primaryColor,
           identifier: "iosBook",
           scrollDirection: EpubScrollDirection.ALLDIRECTIONS,
           allowSharing: true,
           enableTts: true,
           nightMode: true,
       );

/**
 * @bookPath
 * @lastLocation (optional and only android)
 */
VocsyEpub.open(
          'bookPath',
           lastLocation: EpubLocator.fromJson({
	   "bookId": "2239",
	   "href": "/OEBPS/ch06.xhtml",
	   "created": 1539934158390,
	   "locations": {
		"cfi": "epubcfi(/0!/4/4[simple_book]/2/2/6)"
	          }
	    }), // first page will open up if the value is null
        );

// Get locator which you can save in your database

VocsyEpub.locatorStream.listen((locator) {
	print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
	// convert locator from string to json and save to your database to be retrieved later
});

You can also load epub from your assets using EpubViewer.openAsset()

await VocsyEpub.openAsset('assets/3.epub',
lastLocation: EpubLocator.fromJson({
	"bookId": "2239",
	"href": "/OEBPS/ch06.xhtml",
	"created": 1539934158390,
	"locations": {
	"cfi": "epubcfi(/0!/4/4[simple_book]/2/2/6)"
	  }
	}), // first page will open up if the value is null
   );

// Get locator which you can save in your database

VocsyEpub.locatorStream.listen((locator) {
	print('LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}');
	// convert locator from string to json and save to your database to be retrieved later
});

Check the Example for implementation

Issues

If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github and I'll look into it. Pull request are also welcome.

For help getting started with Flutter, view the online documentation.

For help on editing plugin code, view the documentation.

vocsy_epub_viewer's People

Contributors

kaushikgodhani avatar vinodasodariya0 avatar vocsygautam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vocsy_epub_viewer's Issues

TTS not visible

I have enabled the tts during configuration but still it doesn't show on menu bar. Even the all other options are visible.

Error installing vocsy_epub_viewer in iOS

Hello, tried this library and works correctly in android. But when trying to run this in iOS, it always prompt an error with this log :

Launching lib/main.dart on iPhone 14 Pro Max in debug mode...
CocoaPods' output:

Preparing
Analyzing dependencies
Inspecting targets to integrate
Using ARCHS setting to build architectures of target Pods-Runner: (``)
Fetching external sources
-> Fetching podspec for Flutter from `Flutter`
-> Fetching podspec for `path_provider_foundation` from `.symlinks/plugins/path_provider_foundation/ios`
-> Fetching podspec for `vocsy_epub_viewer` from `.symlinks/plugins/vocsy_epub_viewer/ios`
Resolving dependencies of `Podfile`
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_4_2_c.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/3.0.0/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_4_7_f.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/7/f/EpubViewerKit/0.1.3/EpubViewerKit.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/7/f/EpubViewerKit/0.1.3/EpubViewerKit.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_2_1_2.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/2/1/2/SSZipArchive/2.5.3/SSZipArchive.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_5_e_4.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/5/e/4/MenuItemKit/4.0.1/MenuItemKit.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_7_2_e.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/7/2/e/ZFDragableModalTransition/0.6/ZFDragableModalTransition.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_2_e_0.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/2/e/0/AEXML/4.6.1/AEXML.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_9_d_3.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/9/d/3/FontBlaster/5.3.0/FontBlaster.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_9_4_5.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/9/4/5/RealmSwift/10.35.1/RealmSwift.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/2/1/2/SSZipArchive/2.2.3/SSZipArchive.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/5/e/4/MenuItemKit/4.0.1/MenuItemKit.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/7/2/e/ZFDragableModalTransition/0.6/ZFDragableModalTransition.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/2/e/0/AEXML/4.6.0/AEXML.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/9/d/3/FontBlaster/5.1.1/FontBlaster.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/9/4/5/RealmSwift/5.5.1/RealmSwift.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: all_pods_versions_b_a_7.txt exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/b/a/7/Realm/10.35.1/Realm.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/b/a/7/Realm/5.5.1/Realm.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/b/a/7/Realm/5.5.1/Realm.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/3.0.0/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/2.10.2/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/2.5/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/2.2.2/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/2.0.0/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/1.22.4/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/1.17.0/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/1.12.1303/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
CDN: trunk Relative path: Specs/4/2/c/FlutterMacOS/1.9.102/FlutterMacOS.podspec.json exists! Returning local because checking is only performed in repo update
Comparing resolved specification to the sandbox manifest
A AEXML
A EpubViewerKit
A Flutter
A FontBlaster
A MenuItemKit
A Realm
A RealmSwift
A SSZipArchive
A ZFDragableModalTransition
A path_provider_foundation
A vocsy_epub_viewer
Downloading dependencies
-> Installing AEXML (4.6.0)
> Copying AEXML from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/AEXML/4.6.0-2fbb7` to `Pods/AEXML`
-> Installing EpubViewerKit (0.1.3)
> Copying EpubViewerKit from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/EpubViewerKit/0.1.3-5f6c8` to `Pods/EpubViewerKit`
-> Installing Flutter (1.0.0)
-> Installing FontBlaster (5.1.1)
> Copying FontBlaster from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/FontBlaster/5.1.1-8897e` to `Pods/FontBlaster`
-> Installing MenuItemKit (4.0.1)
$ /usr/bin/git ls-remote -- https://github.com/cxa/MenuItemKit.git master
22c027e9cdd89a8e449c714b5a5f64c8976b54ac refs/heads/master
> Copying MenuItemKit from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/MenuItemKit/4.0.1-14599` to `Pods/MenuItemKit`
-> Installing Realm (5.5.1)
> Copying Realm from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/Realm/5.5.1-c2ffe` to `Pods/Realm`
-> Installing RealmSwift (5.5.1)
> Copying RealmSwift from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/RealmSwift/5.5.1-5a35c` to `Pods/RealmSwift`
-> Installing SSZipArchive (2.2.3)
> Copying SSZipArchive from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/SSZipArchive/2.2.3-62d49` to `Pods/SSZipArchive`
-> Installing ZFDragableModalTransition (0.6)
> Copying ZFDragableModalTransition from `/Users/btsolve/Library/Caches/CocoaPods/Pods/Release/ZFDragableModalTransition/0.6-0d294` to `Pods/ZFDragableModalTransition`
-> Installing path_provider_foundation (0.0.1)
-> Installing vocsy_epub_viewer (2.0.0)
- Running pre install hooks
- Running pre integrate hooks
Generating Pods project
- Creating Pods project
- Installing files into Pods project
- Adding source files
CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only performed in repo update
――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
### Command
/usr/local/bin/pod install --verbose
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
### Stack
```
CocoaPods : 1.11.3
Ruby : ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]
RubyGems : 3.0.3.1
Host : macOS 12.6 (21G115)
Xcode : 14.1 (14B47b)
Git : git version 2.37.1 (Apple Git-137.1)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/
```
### Plugins
```
cocoapods-deintegrate : 1.0.5
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.1
cocoapods-trunk : 1.6.0
cocoapods-try : 1.2.0
```
### Podfile
```ruby
# Uncomment this line to define a global platform for your project
platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
project 'Runner', {
'Debug' => :debug,
'Profile' => :release,
'Release' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), FILE)
unless File.exist?(generated_xcode_build_settings_path)
raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT=(.*)/)
return matches[1].strip if matches
end
raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end
require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)
flutter_ios_podfile_setup
target 'Runner' do
use_frameworks!
use_modular_headers!
flutter_install_all_ios_pods File.dirname(File.realpath(FILE))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
end
end
```
### Error
```
Errno::ENOENT - No such file or directory @ realpath_rec - /Users/btsolve/development/playground/sample_epub/ios/Pods/Realm/Realm/RLMAccessor.h
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/project.rb:326:in `realpath'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/project.rb:326:in `realpath'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/project.rb:326:in `reference_for_path'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/project.rb:269:in `add_file_reference'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:228:in `block (2 levels) in add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:227:in `map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:227:in `block in add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `each'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `flat_map'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:217:in `add_file_accessors_paths_to_pods_group'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:99:in `block in add_source_files_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:98:in `add_source_files_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb:49:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:102:in `block in install_file_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:149:in `message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/pods_project_generator.rb:100:in `install_file_references'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:17:in `generate!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:314:in `block in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/user_interface.rb:64:in `section'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:309:in `create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:301:in `generate_pods_project'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:180:in `integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/installer.rb:167:in `install!'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command/install.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/lib/cocoapods/command.rb:52:in `run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.11.3/bin/pod:55:in `<top (required)>'
/usr/local/bin/pod:23:in `load'
/usr/local/bin/pod:23:in `

'
```
――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
[!] Oh no, an error occurred.
Search for existing GitHub issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=No+such+file+or+directory+%40+realpath_rec+-+%2FUsers%2Fbtsolve%2Fdevelopment%2Fplayground%2Fsample_epub%2Fios%2FPods%2FRealm%2FRealm%2FRLMAccessor.h&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Be sure to first read the contributing guide for details on how to properly submit a ticket:
https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
Don't forget to anonymize any private data!
Looking for related issues on cocoapods/cocoapods...
Found no similar issues. To create a new issue, please visit:
https://github.com/cocoapods/cocoapods/issues/new
Error running pod install
Error launching application on iPhone 14 Pro Max.
Exited

I hope somebody could help me with this. Thank you

P.S This project was newly created so no other library is associated with my pubspec.yaml file (just to try this library before putting in my project)

Disable night mode is not working

EpubViewer.setConfig(
nightMode: false,
identifier: "test",
scrollDirection: EpubScrollDirection.ALLDIRECTIONS,
allowSharing: false,
enableTts: false);
on adding the config as nightMode: false the option for switch to night and day mode is not hiding

font family

Hi , I use epub files that are Persian language . so these font families that exist in this package are not useful . what i do to add my custom Persian fonts to this ?

Search, book mark and font customization are not vissible

A few days back I integrated this package into my app that time the search, bookmark and font customization were visible but now I run the same app but it is not showing this feature please check. But I tried the example app from this package it shows correctly. I am also using the latest version also tried to add this source code in dependency in project also but still not working

Listener not working on android

VocsyEpub.locatorStream.listen((locator) {
print(locator);
if (int.parse(locator) >= 5) {
VocsyEpub.closeReader();
}
});

Close reader function not exist in package so I added that function. This listener only works on IOS not working on Android. What is the issue?

reopen last page

I can stuff with open last page which I read last, when I reopen the same book .....Please guys help me to solve that issue as soon as possible.....

1)I use version :
Flutter 3.3.9 • channel stable • https://github.com/flutter/flutter.git
Framework • revision b8f7f1f986 (5 months ago) • 2022-11-23 06:43:51 +0900
Engine • revision 8f2221fbef
Tools • Dart 2.18.5 • DevTools 2.15.0

2)I use vocsy_epub_viewer: ^2.0.0

doesn't show options to change font

Hi,
Thanks for resuming epub project.

I'm using vocsy_epub_viewer but it doesn't show options to change font. It also doesn't show the font icon next to the title.

how do i make it appear?

Listener not working on android

VocsyEpub.locatorStream.listen((locator) {
print(locator);
if (int.parse(locator) >= 5) {
VocsyEpub.closeReader();
}
});

Close reader function not exist in package so I added that function. This listener only works on IOS not working on Android. What is the issue?

java.lang.NullPointerException: Attempt to invoke virtual method

E/NanoHTTPD( 4997): Communication with the client broken, or an bug in the handler code
E/NanoHTTPD( 4997): java.lang.NullPointerException: Attempt to invoke virtual method 'org.nanohttpd.protocols.http.response.Response org.nanohttpd.router.RouterNanoHTTPD$UriResource.process(java.util.Map, org.nanohttpd.protocols.http.IHTTPSession)' on a null object reference
E/NanoHTTPD( 4997): at org.nanohttpd.router.RouterNanoHTTPD$UriRouter.process(RouterNanoHTTPD.java:597)
E/NanoHTTPD( 4997): at org.nanohttpd.router.RouterNanoHTTPD.serve(RouterNanoHTTPD.java:672)
E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:376)
E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:372)
E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.NanoHTTPD.handle(NanoHTTPD.java:535)
E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.HTTPSession.execute(HTTPSession.java:421)
E/NanoHTTPD( 4997): at org.nanohttpd.protocols.http.ClientHandler.run(ClientHandler.java:75)
E/NanoHTTPD( 4997): at java.lang.Thread.run(Thread.java:818)
I/System.out( 4997): close [socket][/127.0.0.1:8080]

Listener works differently on android and iOS

In ios listener prints the chapter number while scrolling the epub. but in android prints like this when a user closes the epub viewer

I/flutter (12703): LOCATOR: {"bookId":"urn:uuid:ba1e1afc-defb-458d-b13b-b21f4e93d12a","href":"/OEBPS/Text/The_Racketeer_split_006.html","created":1670904297508,"locations":{"cfi":"epubcfi(/0!/4/2[filepos38088])"},"title":""}

I want to restrict the users to read only the first chapter of the book. I want to listen to chapter number as it works for ios. In android, the listener works a different way. do you have any solution for this?

How to use the parameters returned by method locaterStream ?

EpubViewer.locatorStream.listen((locator) {
// print('------------------LOCATOR: ${EpubLocator.fromJson(jsonDecode(locator))}')
});
I find that print doesn't work and I cannot use locater to call some method . It seems that this method can only return pagenum and now can I detect it is the lastpage or not .
there are some parameters in log,such as scrollTolast and DirectionalViewpager. i dont know which method are these belong to?how can I use them ?
anybody help?thx

Some Books Not Render.

book_error
Some Books Not Render Show Below Error.

Error:
book_error
"Below is a rendering of the page up to the first error"

Close button

Hi the close button pops everything from the navigation stack, how can I change that behaviour
so it just pops once

Folio Reader Not showing book viewer

Hi,

E-Pub viewer is not showing book pages, and the app got crashed several times while running this function.
Help me in this

Thanks in Advance

Listener not working on android

VocsyEpub.locatorStream.listen((locator) {
print(locator);
});

This listener only works on IOS not working on Android. What is the issue?

Facing Issue To Calling Epub and App is crashed

Process: com.raaymedia.saga.ebooks, PID: 6586
E/AndroidRuntime( 6586): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.raaymedia.saga.ebooks/com.folioreader.ui.activity.FolioActivity}: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
E/AndroidRuntime( 6586): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3676)
E/AndroidRuntime( 6586): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3813)
E/AndroidRuntime( 6586): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
E/AndroidRuntime( 6586): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime( 6586): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime( 6586): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2308)
E/AndroidRuntime( 6586): at android.os.Handler.dispatchMessage(Handler.java:106)
E/AndroidRuntime( 6586): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime( 6586): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime( 6586): at android.app.ActivityThread.main(ActivityThread.java:7898)
E/AndroidRuntime( 6586): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6586): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime( 6586): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime( 6586): Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.Boolean
E/AndroidRuntime( 6586): at com.folioreader.Config.(Config.java:160)
E/AndroidRuntime( 6586): at com.folioreader.util.AppUtil$Companion.getSavedConfig(AppUtil.kt:120)
E/AndroidRuntime( 6586): at com.folioreader.ui.activity.FolioActivity.setConfig(FolioActivity.kt:1129)
E/AndroidRuntime( 6586): at com.folioreader.ui.activity.FolioActivity.onCreate(FolioActivity.kt:273)
E/AndroidRuntime( 6586): at android.app.Activity.performCreate(Activity.java:8290)
E/AndroidRuntime( 6586): at android.app.Activity.performCreate(Activity.java:8269)
E/AndroidRuntime( 6586): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1384)
E/AndroidRuntime( 6586): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3657)

Getting Error Failed to initialize book

Failed to initialize book
E/FolioActivity( 3558): java.lang.Exception: -> Unknown book file extension EPUB'
E/FolioActivity( 3558): at com.folioreader.ui.activity.FolioActivity.initBook(FolioActivity.kt:603)
E/FolioActivity( 3558): at com.folioreader.ui.activity.FolioActivity.setupBook(FolioActivity.kt:577)
E/FolioActivity( 3558): at com.folioreader.ui.activity.FolioActivity.onCreate(FolioActivity.kt:316)
E/FolioActivity( 3558): at android.app.Activity.performCreate(Activity.java:7893)
E/FolioActivity( 3558): at android.app.Activity.performCreate(Activity.java:7880)
E/FolioActivity( 3558): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
E/FolioActivity( 3558): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3286)
E/FolioActivity( 3558): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3460)
E/FolioActivity( 3558): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
E/FolioActivity( 3558): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/FolioActivity( 3558): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/FolioActivity( 3558): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2047)
E/FolioActivity( 3558): at android.os.Handler.dispatchMessage(Handler.java:107)
E/FolioActivity( 3558): at android.os.Looper.loop(Looper.java:224)
E/FolioActivity( 3558): at android.app.ActivityThread.main(ActivityThread.java:7590)
E/FolioActivity( 3558): at java.lang.reflect.Method.invoke(Native Method)
E/FolioActivity( 3558): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/FolioActivity( 3558): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
E/FolioActivity( 3558): Caused by: java.lang.IllegalArgumentException: No enum constant org.readium.r2.shared.Publication.EXTENSION.EPUB'
E/FolioActivity( 3558): at java.lang.Enum.valueOf(Enum.java:257)
E/FolioActivity( 3558): at org.readium.r2.shared.Publication$EXTENSION.valueOf(Unknown Source:2)
E/FolioActivity( 3558): at com.folioreader.ui.activity.FolioActivity.initBook(FolioActivity.kt:601)
E/FolioActivity( 3558): ... 17 more

App Restart while Trying Select Text

if the Book have input text Box ,After Enter Text Select the Entered Text App Restart with Following Error.
2

Error Details:

/FolioWebView( 6557): -> startActionMode
D/FolioWebView( 6557): -> onCreateActionMode
D/FolioWebView( 6557): -> onPrepareActionMode
D/FolioWebView( 6557): -> onGetContentRect
V/ResourceHandler( 6557): Method: GET, Uri: /83821586240571/EPUB/
D/FolioWebView( 6557): -> onDestroyActionMode
D/FolioWebView( 6557): -> dismissPopupWindow -> /EPUB/pr01.xhtml
V/WebViewConsole( 6557): -> getSelectionRect [file:///android_asset/js/Bridge.js:764]
E/WebViewConsole( 6557): Uncaught TypeError: Cannot read property 'left' of null [file:///android_asset/js/Bridge.js:777]
V/FolioAppBarLayout( 6557): -> onApplyWindowInsets
D/AndroidRuntime( 6557): Shutting down VM
E/ResourceHandler( 6557): Exception in get
E/ResourceHandler( 6557): kotlin.KotlinNullPointerException
E/ResourceHandler( 6557): at org.readium.r2.streamer.server.handler.ResourceHandler.get(ResourceHandler.kt:51)
E/ResourceHandler( 6557): at org.nanohttpd.router.RouterNanoHTTPD$UriResource.process(RouterNanoHTTPD.java:385)
E/ResourceHandler( 6557): at org.nanohttpd.router.RouterNanoHTTPD$UriRouter.process(RouterNanoHTTPD.java:597)
E/ResourceHandler( 6557): at org.nanohttpd.router.RouterNanoHTTPD.serve(RouterNanoHTTPD.java:672)
E/ResourceHandler( 6557): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:376)
E/ResourceHandler( 6557): at org.nanohttpd.protocols.http.NanoHTTPD$1.handle(NanoHTTPD.java:372)
E/ResourceHandler( 6557): at org.nanohttpd.protocols.http.NanoHTTPD.handle(NanoHTTPD.java:535)
E/ResourceHandler( 6557): at org.nanohttpd.protocols.http.HTTPSession.execute(HTTPSession.java:421)
E/ResourceHandler( 6557): at org.nanohttpd.protocols.http.ClientHandler.run(ClientHandler.java:75)
E/ResourceHandler( 6557): at java.lang.Thread.run(Thread.java:761)
E/AndroidRuntime( 6557): FATAL EXCEPTION: main
E/AndroidRuntime( 6557): Process: com.xsosys.example, PID: 6557
E/AndroidRuntime( 6557): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 6557): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:783)
E/AndroidRuntime( 6557): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime( 6557): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime( 6557): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:893)
E/AndroidRuntime( 6557): ... 1 more
E/AndroidRuntime( 6557): Caused by: org.json.JSONException: Value null of type org.json.JSONObject$1 cannot be converted to JSONObject
E/AndroidRuntime( 6557): at org.json.JSON.typeMismatch(JSON.java:111)
E/AndroidRuntime( 6557): at org.json.JSONObject.(JSONObject.java:160)
E/AndroidRuntime( 6557): at org.json.JSONObject.(JSONObject.java:173)
E/AndroidRuntime( 6557): at com.folioreader.ui.view.FolioWebView$TextSelectionCb2$onGetContentRect$1.onReceiveValue(FolioWebView.kt:574)
E/AndroidRuntime( 6557): at com.folioreader.ui.view.FolioWebView$TextSelectionCb2$onGetContentRect$1.onReceiveValue(FolioWebView.kt:547)
E/AndroidRuntime( 6557): at sl.onResult(chromium-Monochrome.aab-stable-424018521:1)
E/AndroidRuntime( 6557): at Lr0.run(chromium-Monochrome.aab-stable-424018521:1)
E/AndroidRuntime( 6557): at android.os.Handler.handleCallback(Handler.java:751)
E/AndroidRuntime( 6557): at android.os.Handler.dispatchMessage(Handler.java:95)
E/AndroidRuntime( 6557): at android.os.Looper.loop(Looper.java:154)
E/AndroidRuntime( 6557): at android.app.ActivityThread.main(ActivityThread.java:6138)
E/AndroidRuntime( 6557): ... 3 more
I/Process ( 6557): Sending signal. PID: 6557 SIG: 9
Lost connection to device.

Books not render

Hi
Thanks for this plugin , I have a problem when using it when the device in arabic language the app crush at rendering book.

Automatically changing fonts whenever clicking on Upper Right Button

The problem is,
My ebup files are in Bengali Language(ASCII) and the fonts(Bengali ASCII) are included in the epub files. So when I open my books they are working fine. But whenever I tap on the upper right button to change theme or font size, then all the fonts get changed(maybe in UNICODE) and the books are unable to read.
So I want to remove the option of changing font.
Can you please help me with it.
TIA

The option to customise font does not appear

Hi,

I have setup the reader in my app but I am facing the below two issues

  1. Option to customise font / font size does not appear and I do not see the option to enable it
  2. Unable to hide the go back button

Can you please assist me ?

Regards,
Ameya

FolioActivity.kt line 264 com.folioreader.ui.activity.FolioActivity.onCreate

Exception java.lang.RuntimeException:
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3408)
at android.app.ActivityThread.handleLaunchActivity (ActivityThread.java:3547)
at android.app.ActivityThread.handleRelaunchActivityInner (ActivityThread.java:5487)
at android.app.ActivityThread.handleRelaunchActivity (ActivityThread.java:5395)
at android.app.servertransaction.ActivityRelaunchItem.execute (ActivityRelaunchItem.java:69)
at android.app.servertransaction.TransactionExecutor.executeCallbacks (TransactionExecutor.java:140)
at android.app.servertransaction.TransactionExecutor.execute (TransactionExecutor.java:96)
at android.app.ActivityThread$H.handleMessage (ActivityThread.java:2080)
at android.os.Handler.dispatchMessage (Handler.java:107)
at android.os.Looper.loop (Looper.java:264)
at android.app.ActivityThread.main (ActivityThread.java:7581)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:980)
Caused by androidx.fragment.app.Fragment$InstantiationException:
at androidx.fragment.app.Fragment.instantiate (Fragment.java:678)
at androidx.fragment.app.FragmentContainer.instantiate (FragmentContainer.java:57)
at androidx.fragment.app.FragmentManager$3.instantiate (FragmentManager.java:507)
at androidx.fragment.app.FragmentState.instantiate (FragmentState.java:81)
at androidx.fragment.app.FragmentStateManager. (FragmentStateManager.java:85)
at androidx.fragment.app.FragmentManager.restoreSaveStateInternal (FragmentManager.java:2505)
at androidx.fragment.app.FragmentManager.attachController (FragmentManager.java:2665)
at androidx.fragment.app.FragmentController.attachHost (FragmentController.java:117)
at androidx.fragment.app.FragmentActivity.lambda$init$3$androidx-fragment-app-FragmentActivity (FragmentActivity.java:140)
at androidx.fragment.app.FragmentActivity$$ExternalSyntheticLambda0.onContextAvailable
at androidx.activity.contextaware.ContextAwareHelper.dispatchOnContextAvailable (ContextAwareHelper.java:99)
at androidx.activity.ComponentActivity.onCreate (ComponentActivity.java:352)
at androidx.fragment.app.FragmentActivity.onCreate (FragmentActivity.java:217)
at androidx.appcompat.app.AppCompatActivity.onCreate (AppCompatActivity.java:115)
at com.folioreader.ui.activity.FolioActivity.onCreate (FolioActivity.kt:264)
at android.app.Activity.performCreate (Activity.java:7805)
at android.app.Activity.performCreate (Activity.java:7794)
at android.app.Instrumentation.callActivityOnCreate (Instrumentation.java:1306)
at android.app.ActivityThread.performLaunchActivity (ActivityThread.java:3378)
Caused by java.lang.NoSuchMethodException:
at java.lang.Class.getConstructor0 (Class.java:2332)
at java.lang.Class.getConstructor (Class.java:1728)
at androidx.fragment.app.Fragment.instantiate (Fragment.java:663)

ReaderConfig Initialisation error

I used this line of code:-

VocsyEpub.setConfig(
themeColor: Theme.of(context).primaryColor,
scrollDirection: EpubScrollDirection.VERTICAL,
allowSharing: false,
enableTts: true,
nightMode: true,
// identifier: bookname
);

  // Get.back();
  // get current locator
  VocsyEpub.locatorStream.listen((locator) {
    print('LOCATOR: $locator');
  });

  VocsyEpub.open(
    file.path,
    lastLocation: EpubLocator(
      bookId: "",
      href: "",
      created: 0,
      locations: Locations(cfi: "")), // first page will open up if the value is null
  );

Error:-

FATAL EXCEPTION: main
E/AndroidRuntime(18090): Process: com.raaymedia.saga.ebooks, PID: 18090
E/AndroidRuntime(18090): java.lang.ExceptionInInitializerError
E/AndroidRuntime(18090): at com.vocsy.epub_viewer.ReaderConfig.(ReaderConfig.java:25)
E/AndroidRuntime(18090): at com.vocsy.epub_viewer.EpubViewerPlugin.onMethodCall(EpubViewerPlugin.java:131)
E/AndroidRuntime(18090): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:262)
E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger.invokeHandler(DartMessenger.java:295)
E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger.lambda$dispatchMessageToQueue$0$io-flutter-embedding-engine-dart-DartMessenger(DartMessenger.java:319)
E/AndroidRuntime(18090): at io.flutter.embedding.engine.dart.DartMessenger$$ExternalSyntheticLambda0.run(Unknown Source:12)
E/AndroidRuntime(18090): at android.os.Handler.handleCallback(Handler.java:942)
E/AndroidRuntime(18090): at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime(18090): at android.os.Looper.loopOnce(Looper.java:201)
E/AndroidRuntime(18090): at android.os.Looper.loop(Looper.java:288)
E/AndroidRuntime(18090): at android.app.ActivityThread.main(ActivityThread.java:7898)
E/AndroidRuntime(18090): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(18090): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
E/AndroidRuntime(18090): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
E/AndroidRuntime(18090): Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'int android.content.Context.getColor(int)' on a null object reference
E/AndroidRuntime(18090): at androidx.core.content.ContextCompat$Api23Impl.getColor(ContextCompat.java:886)
E/AndroidRuntime(18090): at androidx.core.content.ContextCompat.getColor(ContextCompat.java:539)
E/AndroidRuntime(18090): at com.folioreader.Config.(Config.java:37)
E/AndroidRuntime(18090): ... 14 more
I/Process (18090): Sending signal. PID: 18090 SIG: 9

Crash logged on crashlytics: SwiftEpubKittyPlugin.swift line 456

crash logged on crashlytics:
SwiftEpubKittyPlugin.swift line 456
SwiftEpubViewerPlugin.open(epubPath:)

Crashed: com.apple.main-thread
0 vocsy_epub_viewer 0x8dd4 SwiftEpubViewerPlugin.open(epubPath:) + 456 (SwiftEpubKittyPlugin.swift:456)
1 vocsy_epub_viewer 0x9908 specialized SwiftEpubViewerPlugin.handle(:result:) + 1668 (:1668)
2 vocsy_epub_viewer 0x8920 @objc SwiftEpubViewerPlugin.handle(
:result:) + 72 (:72)
3 Flutter 0x577e00 (Missing UUID 06c0b1046d24347198d4326e87347d68)
4 Flutter 0x43e8c (Missing UUID 06c0b1046d24347198d4326e87347d68)
5 libdispatch.dylib 0x24b4 _dispatch_call_block_and_release + 32
6 libdispatch.dylib 0x3fdc _dispatch_client_callout + 20
7 libdispatch.dylib 0x127f4 _dispatch_main_queue_drain + 928
8 libdispatch.dylib 0x12444 _dispatch_main_queue_callback_4CF + 44
9 CoreFoundation 0x9aa08 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16
10 CoreFoundation 0x7c368 __CFRunLoopRun + 2036
11 CoreFoundation 0x811e4 CFRunLoopRunSpecific + 612
12 GraphicsServices 0x1368 GSEventRunModal + 164
13 UIKitCore 0x3a2d88 -[UIApplication _run] + 888
14 UIKitCore 0x3a29ec UIApplicationMain + 340
15 Runner 0x8064 main + 16 (AppDelegate.swift:16)
16 ??? 0x1a84b1948 (Missing)

Steps for Customizing The Reader

Dear developer
Thank you very much for contributing such a great work. Currently, I would like to customize my reader, such as adding word search function, etc. Currently, I should need to modify it separately on both ends of the foloreader and then integrate it. Can you briefly explain how I should integrate it in engineering? Or is it possible for you to open source the source code that has already been customized for both ends, and then prompt how to make modifications. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.