章节列表 epub siegmann epublib

List of chapters epub siegmann epublib

我可以拿章节列表标题

private void logTableOfContents(List<TOCReference> tocReferences, int depth) {
    if (tocReferences == null) {
        return;
    }

    for (TOCReference tocReference : tocReferences) {
        StringBuilder tocString = new StringBuilder();

        for (int i = 0; i < depth; i++) {
            tocString.append("\t");
        }
        tocString.append(tocReference.getTitle());

        Log.i("epublib", tocString.toString());
        logTableOfContents(tocReference.getChildren(), depth + 1);

    }

}

如何移动到本章开始的资源行?

已解决!所有 epub 书籍都有带有章节 id

的标签