提问人:DingleberrySmith 提问时间:7/27/2023 更新时间:7/27/2023 访问量:108
如何在React Native中解析epub中的文本内容?
How to parse text content from epub in React Native?
问:
我正在尝试找出一种从 .epub 文件中提取文本的方法,但我不确定如何做到这一点。
我能得到的最接近的是 epubjs-react-native,我至少可以让 epub 文件显示在屏幕上。
import * as React from 'react';
import { SafeAreaView, useWindowDimensions } from 'react-native';
import { Reader, ReaderProvider } from '@epubjs-react-native/core';
import { useFileSystem } from '@epubjs-react-native/expo-file-system';
export default function App() {
const { width, height } = useWindowDimensions();
return (
<SafeAreaView>
<ReaderProvider>
<Reader
src="https://s3.amazonaws.com/moby-dick/OPS/package.opf"
width={width}
height={height}
fileSystem={useFileSystem}
/>
</ReaderProvider>
</SafeAreaView>
);
}
但我看不出有任何方法可以解析文本。我愿意使用另一个包而不是这个包,但这就是我迄今为止发现的所有没有过时的包。
答: 暂无答案
评论