EPUB Troubleshooting: Making Kindle Downloads Apple-Compatible
A DRM-free EPUB downloaded from Amazon’s Content & Devices page (the “Download & transfer via USB” export) may fail to open in Apple Books on iOS and macOS, even though it opens fine in other readers. This is a standards-validation mismatch, not a corrupted file — and it’s fixable in a few minutes.
epub:type attribute in the EPUB3 navigation document. Verify and repair with the official epubcheck validator below.Symptoms
- Apple Books refuses the file during import with a generic error (“This book cannot be opened” or similar), on both iOS and macOS
- The same file opens fine in desktop readers (Calibre, KOReader) and passes zip integrity checks
- The file itself is DRM-free and downloads successfully from Amazon
Root Cause
The EPUB 3 specification requires epub:type attribute values to be at least one XML NMTOKEN. The Amazon conversion pipeline emits a landmark entry with an empty value:
<a epub:type="" href="...">Title Page</a>Apple Books validates epub:type strictly and rejects the book at import time. The official validator reports this as:
ERROR(RSC-005): nav.xhtml(49,74): value of attribute "epub:type" is invalid;
must be a list of XML NMTOKENS with length at least 1 (actual length was 0)Diagnostic Steps
Download the official validator (IDPF/W3C reference implementation):
curl -sL https://github.com/w3c/epubcheck/releases/download/v5.2.1/epubcheck-5.2.1.zip -o /tmp/epubcheck.zip cd /tmp && unzip -oq epubcheck.zipRun it against the EPUB (requires Java):
java -jar /tmp/epubcheck-5.2.1/epubcheck.jar path/to/book.epubRead the report — the error line names the file and the exact row/column of every violation.
Repair Steps
Extract the archive:
mkdir -p /tmp/book && unzip -q path/to/book.epub -d /tmp/bookOpen
OEBPS/nav.xhtmland replace the empty attribute with the valid landmark type:<!-- before --> <a epub:type="" href="xhtml/xhtml-0-1.xhtml#aid_355">Title Page</a> <!-- after --> <a epub:type="titlepage" href="xhtml/xhtml-0-1.xhtml#aid_355">Title Page</a>Rebuild the EPUB with the correct ZIP layout —
mimetypemust be the first entry and uncompressed (STORED), everything else deflated:cd /tmp/book rm -f /tmp/book-fixed.epub zip -X0 /tmp/book-fixed.epub mimetype zip -Xr9D /tmp/book-fixed.epub META-INF OEBPSRe-validate — expect a fully clean report:
No errors or warnings detected. Messages: 0 fatals / 0 errors / 0 warnings / 0 infosConfirm the ZIP layout is correct:
unzip -v /tmp/book-fixed.epub | head # mimetype must appear first, Method = Stored
Verification on Apple Platforms
- Send the repaired file to the iPhone/iPad (AirDrop, or save to Files and tap → Open in Books)
- Import should now succeed; TOC, landmarks and cover all render from the untouched content
Notes
- Only the navigation document was repaired — content, images, and table of contents are byte-identical after rebuild.
- If Apple Books still refuses after a clean epubcheck run, the remaining culprits are rarer (missing
dcterms:modified, malformedMETA-INF/container.xml, or a non-UTF8mimetypefirst entry) — inspect those before rewriting anything. - Keep the original download as a backup; the repaired copy is a derivative for personal use.