问个epub制作的问题 calibre正确显示了目录 但是kindle只显示了指向目录页的栏目是什么毛病

发表于:2025-9-26 12:07:35 93
[table][tr][td]RT 有个epub制作相关的问题
最近在捏epub自动生成的玩意 然后遇到个怪问题
calibre正确显示了目录(就是章节彩页那些)但是kindle只显示了指向目录页的栏目是什么毛病
谢谢各位dalao

epub文件 https://cloud.qwq2333.top/index.php/s/2MzwS97wrHMMYBR
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
收藏
送赞
分享

发表回复

评论列表(9)

[table][tr][td]首先声明本人不是专业大佬,也没有制作kindle专用版epub的经验,只是依据自己制作e书的经验发表些许拙见,若有谬误或纰漏恭请斧正。

①我在尝试用sigil打开此文件时出现了未知报错导致无法打开的情况,经calibre输入再输出后虽能够用sigil打开但出现了不支持OPF对minetype文件使用application/octet-stream媒体类型的报错,而我个人制作时并不需要对minetype定义类型,而这些epub在kindle上表现正常;

②OPF文件中的xhtml、图片、字体等文件的item id部分一般情况下带有文件后缀名,而此文件OPF中xhtml以及图片的item id不带有后缀名,个人猜测这可能导致id映射错误;

③此文件中的所有xhtml文件的xml头下均没有使用!DOCTYPE声明,这可能导致epub在不同阅读器或设备上的兼容性问题,但本人所历情况中从未遇到相关问题,故本条仅供参考。

epub人工制作费时费力,制作自动化是大势所趋,请继续加油,祝您马到成功!
2025-9-26 12:14:36 回复
春天情书 楼主
[table][tr][td]
1.给minetype赛opf是因为calibre的编辑器说最好什么杂七杂八东西都塞里边(
2 item id 应该不关事的吧 我看了下标准也没说要后缀名 id带后缀名一个是习惯问题 不过我也试试吧
3. 第一次知道 之前因为dom4j解析的时候带DOCTYPE属性会报错 所以直接在模板那里删了
感谢大佬回答www
2025-9-26 12:22:39 回复
春天情书 楼主
[table][tr][td]

那個 epub 3 的版本嗎??
目錄讀取的方式不同

另外請問 , 轉至kindle是用calibre??

ToC沒有登錄到 OPF  , 我是覺得應該是v2 v3版本問題
因為 v3 這樣目錄是由contents.xhtml指定
2025-9-26 12:37:15 回复
春天情书 楼主
[table][tr][td]
不清楚 我doctype写的version2 转kindle确实是直接用calibre的发送到设备处理的
2025-9-26 13:00:49 回复
春天情书 楼主
[table][tr][td]解决了 文件编码问题 calibre读的应该是gbk或者其他什么鬼东西 然后我编辑和输出的是utf8 Windows害人不浅 感谢各位大佬
2025-9-26 13:02:31 回复
春天情书 楼主
[table][tr][td]

用epubcheck顯示錯誤:
ERROR(PKG-006): Downloads/test.epub(-1,-1): 找不到 mimetype 檔案,或者不是卷宗中的第一個檔案。
FATAL(RSC-002): Downloads/test.epub(-1,-1): 找不到必須的 META-INF/container.xml 資源。
ERROR(RSC-001): Downloads/test.epub(-1,-1): 找不到檔案「META-INF/container.xml」。

另外我把後綴改成zip打開,發現裡面的路徑分隔符是反斜線而不是斜線,可能是錯誤的原因?
2025-9-26 13:25:32 回复
春天情书 楼主
[table][tr][td]

https://github.com/qwq233/epub-g ... l/FileUtils.kt#L157

要把zipEntry的反斜線取代成斜線之後打開就不會報錯了,可以參考https://stackoverflow.com/a/58844652/3926429
var zipEntry = ZipEntry(pp.relativize(path).toString().replace("\\","/"))

epubcheck還是有一些錯誤(翻譯有點問題,改成英文版):
$ LANG=C epubcheck Documents/Demo2.epub
Validating using EPUB version 2.0.1 rules.
ERROR(PKG-006): Documents/Demo2.epub(-1,-1): Mimetype file entry is missing or is not the first file in the archive.
ERROR(PKG-007): Documents/Demo2.epub/mimetype(-1,-1): Mimetype file should only contain the string "application/epub+zip" and should not be compressed.
ERROR(RSC-005): Documents/Demo2.epub/OEBPS/content.opf(11,15): Error while parsing file: element "language" not allowed anywhere; expected element "dc:contributor", "dc:coverage", "dc:creator", "dc:date", "dc:description", "dc:format", "dc:identifier", "dc:language", "dc:publisher", "dc:relation", "dc:rights", "dc:source", "dc:subject", "dc:title", "dc:type" or "meta" or an element from another namespace
ERROR(RSC-005): Documents/Demo2.epub/OEBPS/content.opf(17,14): Error while parsing file: element "metadata" incomplete; missing required element "dc:language"
ERROR(RSC-005): Documents/Demo2.epub/OEBPS/toc.ncx(34,45): Error while parsing file: different playOrder values for navPoint/navTarget/pageTarget that refer to same target
ERROR(RSC-005): Documents/Demo2.epub/OEBPS/toc.ncx(39,47): Error while parsing file: different playOrder values for navPoint/navTarget/pageTarget that refer to same target

Check finished with errors
Messages: 0 fatals / 6 errors / 0 warnings / 0 infos

EPUBCheck completed
2025-9-26 13:36:05 回复
[table][tr][td]


这个反斜线应该是按照系统环境确认的 windows都是\而Linux是/ 应该没关系的toc.ncx都是写死的用“/”

playOrder修成从0开始了 晕死 我以为从1开始的 我是抄现成epub的没照模板(((
2025-9-26 13:45:04 回复
[table][tr][td]
啧 有点破烂 可能得再找找zip打包的现成轮子 java自带的总感觉有点问题
2025-9-26 14:10:04 回复