我正在尝试开发一个iPhone应用程序来读取ePub文件.有没有可用于开发此框架的框架?我不知道如何阅读这种文件格式.我尝试使用NSXML Parser解析扩展名为.epub的示例文件,但是失败了.
我有一个epub文件.我需要解压缩并解析epub文件并在Webview中呈现它.某处是否有分步教程.
我找到了一个使用epublib在android中阅读epub书籍的解决方案.我能够阅读这本书的字幕.但我没有找到一种方法来逐行阅读内容.我该如何实现这一目标?
获取图书标题的示例代码是
private void logTableOfContents(List<TOCReference> tocReferences, int depth) {
if (tocReferences == null) {
return;
}
for (TOCReference tocReference : tocReferences) {
StringBuilder tocString = new StringBuilder();
StringBuilder tocHref=new StringBuilder();
for (int i = 0; i < depth; i++) {
tocString.append("\t");
tocHref.append("\t");
}
tocString.append(tocReference.getTitle());
tocHref.append(tocReference.getCompleteHref());
Log.e("Sub Titles", tocString.toString());
Log.e("Complete href",tocHref.toString());
//logTableOfContents(tocReference.getChildren(), depth + 1);
}
}
Run Code Online (Sandbox Code Playgroud)
从http://www.siegmann.nl/epublib/android获得此代码
我怎样才能得到这本书的故事......