您的电子书文件没问题。是 Kobo 报错了。该怪 Adobe。
Your ePub Is fine

原始链接: https://andreklein.net/your-epub-is-fine-kobo-disagrees-blame-adobe/

作者指出,一个通过了行业标准“epubcheck”验证、完全合规的 EPUB 文件,却无法在 Kobo 设备上打开,这令人十分沮丧。 经过深入排查,作者发现了罪魁祸首:Kobo 使用的是 Adobe 的专有渲染引擎 RMSDK。该引擎已严重过时,所使用的 CSS 解析器仍停留在 2013 年左右。当引擎遇到现代 CSS 函数(如 `min()`)时,它不会忽略该代码,而是直接静默崩溃,导致整本书被判定为“损坏”,且不提供任何错误反馈。 作者认为,数字出版行业将限制性的 DRM 技术置于现代功能标准之上。因此,即便电子书符合官方规则,作者若不在 Adobe 笨重而陈旧的 Adobe Digital Editions(作者戏称为“碎木机”)中进行测试,也无法保证文件的兼容性。这篇文章对出版商而言是一个警示:在一个痴迷于知识产权保护的生态系统中,代码“合法”并不能保证书本能在所有设备上正常打开。

这篇 Hacker News 讨论聚焦于电子书格式 ePub 在 Kobo 设备上渲染异常的挫败感,这通常是由 Adobe 的渲染引擎所导致的。 用户们探讨了这些兼容性问题的根本原因。一些人认为 ePub 标准缺乏严格的 CSS 版本要求,导致现代网页标准与优先考虑向后兼容的旧版渲染引擎之间产生了碎片化。持批评意见者则建议,开发者应专注于“优雅降级”,而非盲目追求最新的、不受支持的特性。 讨论中有很大一部分集中在 ePub 的技术本质上——它们本质上是经过 ZIP 压缩的 HTML 文件。爱好者们称赞这种结构简单且易于编辑(特别是在使用 Calibre 等软件时),并将其与 PDF 文件“克苏鲁式”的复杂性进行了对比。归根结底,尽管 ePub 是一种更优越、更灵活的数字阅读格式,但由于不同硬件和软件生态系统对其支持的不一致,用户体验常常受到影响。
相关文章

原文

“You shall not pass!”

[drop_cap]A[/drop_cap]dobe isn’t exactly a beloved company these days. People begrudgingly use their stuff, because the Creative Suite is an industry standard (read: monopoly) or there are simply no worthwhile alternatives, not because anyone is genuinely excited about these tools.

I’m happy to report that I (mostly) make do without Adobeware these days (shoutout to Photopea), and yet, my disdain of Adobe just reached a completely new level.

Let me explain.

A while back I published a new book. As always I gave readers direct access to DRM-free EPUB files, which go through a gauntlet of processes until they pass all epubcheck … err … checks.

If you’re not familiar with epubcheck, it is basically the gold standard for well-formed ebooks. It can be very annoying at first, because it’s more pedantic than a nun on Ash Wednesday. If your manifest doesn’t meticulously account for every snippet and image in your book, your epub shall not pass. If you use html elements out of order, if your document diverges in the slightest from the holy set of rules decreed by the International Digital Publishing Forum, you won’t pass.

So yeah. Getting an epub to 100% epubcheck is no small feat for beginners. When I started out, I dreaded the moment when I hit the validate button on my finished book after months of work, because it would always find something to cry about.

These days however, I’m a big fan of epubcheck. Why? It’s the closest thing us publisher-types have to a ‘type-linter’ or formal testing suite. In other words, if your book passes epubcheck you are guaranteed that the book will work on any EPUB-compatible reader or app.

Or at least, that’s the idea.

I recently received a message from one of my readers that my new book, which passed epubcheck ruleset 3.3 with flying colors, was “corrupted”.

Backwards compatibility perhaps? So I gave them an EPUB2 version, also fully rule-compliant. And yet the same issue occurred. They told me the book wouldn’t open on any of their Kobo devices from various generations.

So what do you do when the pedantic gold standard of epubcheck says your book is fine, when it works without issue on Amazon Kindle, Apple Books, Thorium and everywhere else and yet Kobo says it’s “corrupted”?

I dug into this matter and found out that Kobo uses RMSDK, “Reader Mobile Software Development Kit”, Adobe’s proprietary ebook rendering engine.

Perhaps you see where this is going …

RMSDK is the guts of Adobe Digital Editions (that bloated pinnacle of software that is 80% about DRM, 20% about the reading experience), the engine on various Kobo devices and older Sony/Nook devices. Originally built around 2010 (!) for EPUB2, it was lightly updated for EPUB3 but never modernized.

While that realization didn’t solve the issue for me (epubcheck still said “yay” while Kobo said “nay”), it at least gave me a path towards debugging.

And so I threw my book into Adobe Digital Editions. As expected, it failed to load. But how! Without an error message, without the slightest whimper. The book just wouldn’t load. The only sign that it had even tried was that when loading it again ADE told me: “you can’t import that book, you already added it”. While showing a white screen.

Classic Adobe.

So I started ripping my book apart, creating a dozen different variations, always making sure that epubcheck still passed. I rearranged folder structures, gutted metadata, nuked language attributes, generated epubs with fresh UUIDs, flattened directories, renamed extensions, rebuilt the zip from scratch a dozen times, and shook up my manifest.

And it failed. And failed. And failed.

While I had almost given up it occurred to me to disable the stylesheet. And eureka, suddenly it loaded!

Once the stylesheet was identified as the source of my woes, I could finally drill down to find which specific line was causing the issue. After creating a dozen more variations with different subsets of my stylesheet I eventually identified the culprit. It was this line:

.copyright img {
    max-width: min(150px, 30vw);
}

Once I changed it to the more old fashioned max-width: 150px; ADE opened it just fine.

But what is the problem here? The above code is perfectly valid CSS level 4, it’s just not supported by RMSDK, because its CSS parser is frozen in approximately 2013 — no flexbox, no grid, no math functions, no custom properties. Just good old float, bad font handling, and silent crashes when it sees anything it doesn’t recognize.

So why didn’t epubcheck catch it?

Epubcheck does basic CSS checking of course, but it can’t validate CSS against a renderer which is fundamentally broken!

So there you have it.

It’s the year 2026. Thanks to the horrendous RMSDK which Kobo decided to use as their backbone for all book rendering (probably for DRM reasons), a single line of perfectly valid CSS turns a perfectly valid EPUB file into a “corrupted file” on Kobo and just drops the whole book. No clear error message, no fallback. Just a massive fail.

I’ve since published a new version so none of my readers have to ever stumble over this issue again.

In a perfect world, RMSDK would just stop living in the CSS stone-ages or at least provide some kind of error handling instead of dropping the whole book, but I’m not holding my breath.

The digital publishing world is more obsessed with restricting access than giving users the best possible reading experience.

And until that changes, which it won’t, if you want to make sure that your book is Kobo-compatible, relying on epubcheck is unfortunately not enough. Gotta chuck it into Adobe’s woodchipper first.

Either it will work, or it will fail silently. In which case, you probably used some forbidden new-fangled CSS.

Anyway, just throwing this out there as a post-mortem, in case anyone else is stumbling over it.

EPUB is an amazing open standard for ebooks, and yet so many implementations of it are just fundamentally flawed, all in the name of keeping IP lawyers happy.

联系我们 contact @ memedata.com