GithubHelp home page GithubHelp logo

Comments (9)

troyeguo avatar troyeguo commented on August 27, 2024

您好,mobi格式用到了这个文件 https://github.com/troyeguo/koodo-reader/blob/master/src/utils/mobiUtil.js
首先用这个文件提取文字,解析成txt格式,再将txt格式转化为epub格式,再用epub.js展示图书内容

from koodo-reader.

mrmarktyy avatar mrmarktyy commented on August 27, 2024

@troyeguo https://imclient.herokuapp.com/mobiviewer/
这个插件可以直接读取本地mobi,我不知道它是怎么实现的
你可以看下是不是有什么启发

from koodo-reader.

troyeguo avatar troyeguo commented on August 27, 2024

@troyeguo https://imclient.herokuapp.com/mobiviewer/
这个插件可以直接读取本地mobi,我不知道它是怎么实现的
你可以看下是不是有什么启发

感谢您的建议,其实解析mobi的这个文件我也是直接从类似的项目中直接复制过来的,但最难的不是展示mobi文件,而是记录阅读位置,进度跳转,解析目录,这些功能还是只能借助epub.js来实现,目前比较棘手的问题是mobi文件到epub文件的转换过程中,如何保留图片。

from koodo-reader.

mrmarktyy avatar mrmarktyy commented on August 27, 2024

谢谢回答。我也有点理解这个问题了。
我正在尝试做个mobi/epub的读书app(用RN实现)

正在研究怎么做mobi文件的翻页功能。。

from koodo-reader.

troyeguo avatar troyeguo commented on August 27, 2024

谢谢回答。我也有点理解这个问题了。
我正在尝试做个mobi/epub的读书app(用RN实现)

正在研究怎么做mobi文件的翻页功能。。

我之前也打算用RN和expo开发Koodo Reader的移动版,设计稿已经画好了,App的模板也已经开发完成了,但我发现epub.js的RN版不支持在expo的managed workflow下运行,但eject之后又无法使用expo publish来生成安装包,所以就作罢了。请问你的app是怎么解析epub文件的?

from koodo-reader.

mrmarktyy avatar mrmarktyy commented on August 27, 2024

我打算都用WebView来对付了,对epub和mobi的展现都用浏览器里实现。
从app里读取文件系统文件后也可以传送给webview

但我发现epub.js的RN版不支持在expo的managed workflow下运行,但eject之后又无法使用expo publish来生成安装包

嗯 感觉需要针对RN重写epubjs里的render logic把,

from koodo-reader.

troyeguo avatar troyeguo commented on August 27, 2024

我打算都用WebView来对付了,对epub和mobi的展现都用浏览器里实现。
从app里读取文件系统文件后也可以传送给webview

但我发现epub.js的RN版不支持在expo的managed workflow下运行,但eject之后又无法使用expo publish来生成安装包

嗯 感觉需要针对RN重写epubjs里的render logic把,

我找到了一个类似的项目,也是用webview和epubjs来实现的,https://github.com/farshed/duofolio 但它也需要修改安卓文件夹下的gradle文件,才能实现webview打开指定的html文件,你的项目是在原生react native 环境下开发的吗?

from koodo-reader.

mrmarktyy avatar mrmarktyy commented on August 27, 2024

我目前还是用Expo,确实在特定需求中很受限。

因为webview和rn是互通的,不知道能不能把html发送给webview, 然后webview里再通过innerHTML之类的方法来render

from koodo-reader.

mumujj avatar mumujj commented on August 27, 2024

问一下mobi格式的目录和内容中的图片怎么读取的呢?

from koodo-reader.

Related Issues (20)

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.