<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>epub &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/epub/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Tue, 14 Apr 2026 21:38:14 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>epub &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Would adding Brotli Compression help shrink ePubs?]]></title>
		<link>https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/</link>
					<comments>https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 26 Jul 2025 11:34:35 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[compression]]></category>
		<category><![CDATA[epub]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=62085</guid>

					<description><![CDATA[The ePub format is the cross-platform way to package an eBook. At its heart, an ePub is just a bundled webpage with extra metadata - that makes it extremely easy to build workflows to create them and apps to read them.  Once you&#039;ve finished authoring your ePub, you&#039;ve got a folder full of HTML, CSS, metadata documents, and other resources.  The result is then stored in a standard Zip file and is…]]></description>
										<content:encoded><![CDATA[<p>The ePub format is the cross-platform way to package an eBook. At its heart, an ePub is just a bundled webpage with extra metadata - that makes it extremely easy to build workflows to create them and apps to read them.</p>

<p>Once you've finished authoring your ePub, you've got a folder full of HTML<sup id="fnref:x"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fn:x" class="footnote-ref" title="OK! It is actually XHTML, but let's not quibble." role="doc-noteref">0</a></sup>, CSS, metadata documents, and other resources.  The result is then stored in a standard Zip file and is then renamed to <code>.epub</code>.  This is known as the <a href="https://www.w3.org/TR/epub-33/#sec-ocf">Open Container Format</a> (OCF).</p>

<p>There are actually a few different compression schemes for Zip files, but <a href="https://www.w3.org/TR/epub-33/#sec-zip-container-zipreqs">the specification says</a>:</p>

<blockquote><p>OCF ZIP containers MUST include only stored (uncompressed) and Deflate-compressed ZIP entries within the ZIP archive.</p></blockquote>

<p>The Deflate algorithm is venerable<sup id="fnref:old"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fn:old" class="footnote-ref" title="That's a fancy way of saying &quot;old&quot;." role="doc-noteref">1</a></sup> and, while incredible for its time, has been superseded by more modern compression schemes. For example, <a href="https://brotli.org/">Brotli</a>.</p>

<p>What happens if we unzip an ePub and then recompress it with Brotli?  Will that dramatically reduce the file size?</p>

<h2 id="steps"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#steps">Steps</a></h2>

<ul>
<li>Unzip the book

<ul>
<li><code>unzip book.epub -d book/</code></li>
</ul></li>
<li>Brotli files can't contain directories, so tar the directory without any compression

<ul>
<li><code>tar -cvf book.tar book/</code></li>
</ul></li>
<li>Create a Zip file with maximum compression

<ul>
<li><code>zip -9 book.tar.zip book.tar</code></li>
</ul></li>
<li>Create a Brotli file with maximum compression

<ul>
<li><code>brotli -k -q 11 book.tar</code></li>
</ul></li>
</ul>

<h2 id="results"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#results">Results</a></h2>

<p>I took a random(ish) sample from <a href="https://standardebooks.org/">Standard eBooks</a> and a few from my personal stash<sup id="fnref:auto"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fn:auto" class="footnote-ref" title="I couldn't be bothered automating this. Go ahead a run it on every ePub if you want something more representative." role="doc-noteref">2</a></sup>.</p>

<table>
<thead>
<tr>
  <th align="right"></th>
  <th align="right">Book 1</th>
  <th align="right">Book 2</th>
  <th align="right">Book 3</th>
  <th align="right">Book 4</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="right">Contents</td>
  <td align="right">768KB</td>
  <td align="right">911KB</td>
  <td align="right">389KB</td>
  <td align="right">594KB</td>
</tr>
<tr>
  <td align="right">Deflate</td>
  <td align="right">250KB</td>
  <td align="right">248KB</td>
  <td align="right">103KB</td>
  <td align="right">175KB</td>
</tr>
<tr>
  <td align="right">Brotli</td>
  <td align="right">190KB</td>
  <td align="right">187KB</td>
  <td align="right">82KB</td>
  <td align="right">137KB</td>
</tr>
</tbody>
</table>

<p>The good news is that ePubs compress pretty well already! That isn't much of a surprise - compression algorithms love the repetitious nature of HTML and human-readable text.  Obviously Brotli is better but, on the file sizes we're talking about, not <em>dramatically</em> better. Saving 60KB is OK - but in a world of terabyte sized SD cards does it matter?</p>

<p>Brotli is also computationally harder to decompress, which makes it slightly less attractive for low-powered eReaders.</p>

<p>It's also possible to make a small saving by reducing the complexity and verbosity of the CSS and HTML.</p>

<p>However, that's not the <em>real</em> problem.</p>

<h2 id="i-lied-to-you"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#i-lied-to-you">I lied to you</a></h2>

<p>An ePub contains more than just text and text-based metadata. It can contain web fonts, images, even music.  The above books had all their fonts and media stripped out.  Let's run the experiment again but, this time, including <em>everything</em> in the original book.</p>

<table>
<thead>
<tr>
  <th align="right"></th>
  <th align="right">Book 1</th>
  <th align="right">Book 2</th>
  <th align="right">Book 3</th>
  <th align="right">Book 4</th>
</tr>
</thead>
<tbody>
<tr>
  <td align="right">Contents</td>
  <td align="right">23MB</td>
  <td align="right">3.8MB</td>
  <td align="right">0.76MB</td>
  <td align="right">0.93MB</td>
</tr>
<tr>
  <td align="right">Deflate</td>
  <td align="right">22MB</td>
  <td align="right">1.7MB</td>
  <td align="right">0.46MB</td>
  <td align="right">0.51MB</td>
</tr>
<tr>
  <td align="right">Brotli</td>
  <td align="right">22MB</td>
  <td align="right">1.5MB</td>
  <td align="right">0.43MB</td>
  <td align="right">0.47MB</td>
</tr>
</tbody>
</table>

<p>All of a sudden, Brotli makes next to no difference. Yes, the textual compression is still there, but it is overshadowed by the huge cost of the media files.</p>

<h2 id="mixed-media"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#mixed-media">Mixed Media</a></h2>

<p>The <a href="https://www.w3.org/TR/epub-33/#sec-core-media-types">ePub 3.3 specification lays out which multimedia formats are acceptable</a>. As well as the older formats like gif, png, and jpeg - newer formats like WebP are acceptable. Similarly, TTF fonts are listed in the standard along with WOFF2.</p>

<p>Modern image and font formats have better compression than their ancestors. Indeed, WOFF2 uses Brotli as its compression scheme.</p>

<p>The biggest filesize saving in ePubs comes from properly compressing images and fonts.</p>

<h2 id="can-you-picture-that"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#can-you-picture-that">Can You Picture That?</a></h2>

<p>It is a matter of opinion as to what resolution is best suited to an ePub. Most modern eReaders have, at best, 300ppi resolution. They're also normally monochrome. But eBooks aren't always read on low-resolution, black and white eInk screens - so it probably makes sense to have high-resolution colour images in order to future-proof books.</p>

<p>But the <em>compression</em> of those images is <em>not</em> a matter of opinion. Lossless compression algorithms are well supported for legacy and modern image formats.</p>

<p>Let's take a specific example.  <a href="https://standardebooks.org/ebooks/jane-addams/twenty-years-at-hull-house/downloads/jane-addams_twenty-years-at-hull-house_advanced.epub">Twenty Years at Hull House</a> is the 22MB book above. Less than a MB of that is for text, the rest is images.</p>

<p>The largest illustration in the book is a 1937x1971, transparent PNG weighing in at 1MB.  Increasing the lossless compression level takes it down to 840KB. Reducing the palette to something more suitable takes it to 640KB. If you were releasing this as an ePub 3.3 file, using WebP would take the image to a hair over 600KB.</p>

<p>Basically, a 20%-40% filesize reduction with no loss of fidelity.</p>

<p>Across all the PNG images in the ePub, I was able to easily get the filesize from 20MB to 16MB.</p>

<p>Converting to lossless WebP got it down to 13MB.</p>

<h2 id="what-the-font"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#what-the-font">What The Font?</a></h2>

<p>Fonts can be shrunk in a number of ways.  The most obvious way is to compress to WOFF2 which, as described above, uses Brotli compression.</p>

<p>Based on my quick tests, a typical ePub's TTF will see about a 50% reduction in font size. For typical "English" language fonts, that's a reduction from 30KB to 15KB. So big relative compression, but small absolute compression.</p>

<p>Complex decorative fonts can go from 800KB to 80KB. But it is rare for a font to exceed a megabyte.</p>

<p>If it does, that usually means that it has more glyphs than strictly necessary.  If your book is written entirely in the Latin alphabet, do you really need all those fancy accents, Chinese ideographs, and emoji? Probably not.</p>

<p>I've previously written about <a href="https://shkspr.mobi/blog/2013/05/subsetting-chinese-fonts/">Subsetting Fonts</a> and the perils of <a href="https://shkspr.mobi/blog/2015/11/premature-subsetting-of-web-fonts/">excessive trimming</a>.</p>

<h2 id="back-to-basics"><a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#back-to-basics">Back to Basics</a></h2>

<p>Brotli is magic - but changing the compression algorithm for the ePub standard is probably a false economy. The text portion of modern eBooks is already fairly small and compresses with reasonable efficiency.</p>

<p>The best compression gains come from either using next-generation image and font formats or, if legacy compatibility is necessary, using the most aggressive compression settings for traditional images.</p>

<div id="footnotes" role="doc-endnotes">
<hr aria-label="Footnotes">
<ol start="0">

<li id="fn:x">
<p>OK! It is actually <strong>X</strong>HTML, but let's not quibble.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fnref:x" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:old">
<p>That's a fancy way of saying "old".&nbsp;<a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fnref:old" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

<li id="fn:auto">
<p>I couldn't be bothered automating this. Go ahead a run it on every ePub if you want something more representative.&nbsp;<a href="https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/#fnref:auto" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

</ol>
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=62085&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/07/would-adding-brotli-compression-help-shrink-epubs/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Extracting content from an LCP "protected" ePub]]></title>
		<link>https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/</link>
					<comments>https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 16 Mar 2025 12:34:57 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[ebooks]]></category>
		<category><![CDATA[epub]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=58843</guid>

					<description><![CDATA[As Cory Doctorow once said &#34;Any time that someone puts a lock on something that belongs to you but won&#039;t give you the key, that lock&#039;s not there for you.&#34;  But here&#039;s the thing with the LCP DRM scheme; they do give you the key! As I&#039;ve written about previously, LCP mostly relies on the user entering their password (the key) when they want to read the book. Oh, there&#039;s some deep cryptographic…]]></description>
										<content:encoded><![CDATA[<p>As Cory Doctorow once said "<a href="https://www.bbc.co.uk/news/business-12701664">Any time that someone puts a lock on something that belongs to you but won't give you the key, that lock's not there for you.</a>"</p>

<p>But here's the thing with the LCP DRM scheme; they <em>do</em> give you the key! As <a href="https://shkspr.mobi/blog/2025/03/some-thoughts-on-lcp-ebook-drm/">I've written about previously</a>, LCP mostly relies on the user entering their password (the key) when they want to read the book. Oh, there's some deep cryptographic magic in the background but, ultimately, the key is sat on your computer waiting to be found.  Of course, cryptography is Very Hard™ which make retrieving the key almost impossible - so perhaps we can use a different technique to extract the unencrypted content?</p>

<p>One popular LCP app is <a href="https://thorium.edrlab.org/en/">Thorium</a>. It is an <a href="https://www.electronjs.org/">Electron Web App</a>. That means it is a bundled browser running JavaScript. That also means it can trivially be debugged. The code is running on your own computer, it doesn't touch anyone else's machine. There's no reverse engineering. No cracking of cryptographic secrets. No circumvention of any technical control. It doesn't reveal any <a href="https://en.wikipedia.org/wiki/Illegal_number">illegal numbers</a>. It doesn't jailbreak anything. We simply ask the reader to give us the content we've paid for - and it agrees.</p>

<h2 id="here-be-dragons"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#here-be-dragons">Here Be Dragons</a></h2>

<p>This is a manual, error-prone, and tiresome process.  This cannot be used to automatically remove DRM.  I've only tested this on Linux. It must only be used on books that you have legally acquired. I am using it for research and private study.</p>

<p>This uses <a href="https://github.com/edrlab/thorium-reader/releases/tag/v3.1.0">Thorium 3.1.0 AppImage</a>.</p>

<p>First, extract the application:</p>

<pre><code class="language-bash">./Thorium-3.1.0.AppImage --appimage-extract
</code></pre>

<p>That creates a directory called <code>squashfs-root</code> which contains all the app's code.</p>

<p>The Thorium app can be run with remote debugging enabled by using:</p>

<pre><code class="language-bash">./squashfs-root/thorium --remote-debugging-port=9223 --remote-allow-origins=*
</code></pre>

<p>Within the Thorium app, open up the book you want to read.</p>

<p>Open up Chrome and go to <code>http://localhost:9223/</code> - you will see a list of Thorium windows. Click on the link which relates to your book.</p>

<p>In the Thorium book window, navigate through your book. In the debug window, you should see the text and images pop up.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2025/03/debug-fs8.png" alt="Chrome debug screen." width="800" height="298" class="aligncenter size-full wp-image-58845">

<p>In the debug window's "Content" tab, you'll be able to see the images and HTML that the eBook contains.</p>

<h2 id="images"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#images">Images</a></h2>

<p>The images are the full resolution files decrypted from your ePub. They can be right-clicked and saved from the developer tools.</p>

<h2 id="files"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#files">Files</a></h2>

<p>An ePub file is just a zipped collection of files. Get a copy of your ePub and rename it to <code>whatever.zip</code> then extract it. You will now be able to see the names of all the files - images, css, fonts, text, etc - but their contents will be encrypted, so you can't open them.</p>

<p>You can, however, give their filenames to the Electron app and it will read them for you.</p>

<h2 id="images"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#images">Images</a></h2>

<p>To get a Base64 encoded version of an image, run this command in the debug console:</p>

<pre><code class="language-js">fetch("httpsr2://...--/xthoriumhttps/ip0.0.0.0/p/OEBPS/image/whatever.jpg") .then(response =&gt; response.arrayBuffer())
  .then(buffer =&gt; {
    let base64 = btoa(
      new Uint8Array(buffer).reduce((data, byte) =&gt; data + String.fromCharCode(byte), '')
    );
    console.log(`data:image/jpeg;base64,${base64}`);
  });
</code></pre>

<p><a href="https://github.com/w3c/epub-specs/issues/1888#issuecomment-958439051">Thorium uses the <code>httpsr2</code> URl scheme</a> - you can find the exact URl by looking at the content tab.</p>

<h2 id="css"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#css">CSS</a></h2>

<p>The CSS can be read directly and printed to the console:</p>

<pre><code class="language-js">fetch("httpsr2://....--/xthoriumhttps/ip0.0.0.0/p/OEBPS/css/styles.css").then(response =&gt; response.text())
  .then(cssText =&gt; console.log(cssText));
</code></pre>

<p>However, it is <em>much</em> larger than the original CSS - presumably because Thorium has injected its own directives in there.</p>

<h2 id="metadata"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#metadata">Metadata</a></h2>

<p>Metadata like the <a href="https://wiki.mobileread.com/wiki/NCX">NCX</a> and the <a href="https://opensource.com/article/22/8/epub-file">OPF</a> can also be decrypted without problem:</p>

<pre><code class="language-js">fetch("httpsr2://....--/xthoriumhttps/ip0.0.0.0/p/OEBPS/content.opf").then(response =&gt; response.text())
  .then(metadata =&gt; console.log(metadata));
</code></pre>

<p>They have roughly the same filesize as their encrypted counterparts - so I don't think anything is missing from them.</p>

<h2 id="fonts"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#fonts">Fonts</a></h2>

<p>If a font has been used in the document, it should be available. It can be grabbed as Base64 encoded text to the console using:</p>

<pre><code class="language-js">fetch("httpsr2://....--/xthoriumhttps/ip0.0.0.0/p/OEBPS/font/Whatever.ttf") .then(response =&gt; response.arrayBuffer())
  .then(buffer =&gt; {
    let base64 = btoa(
      new Uint8Array(buffer).reduce((data, byte) =&gt; data + String.fromCharCode(byte), '')
    );
    console.log(`${base64}`);
  });
</code></pre>

<p>From there it can be copied into a new file and then decoded.</p>

<h2 id="text"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#text">Text</a></h2>

<p>The HTML of the book is also visible on the Content tab. It is <em>not</em> the original content from the ePub. It has a bunch of CSS and JS added to it. But, once you get to the body, you'll see something like:</p>

<pre><code class="language-html">&lt;body&gt;
    &lt;section epub:type="chapter" role="doc-chapter"&gt;
        &lt;h2 id="_idParaDest-7" class="ct"&gt;&lt;a id="_idTextAnchor007"&gt;&lt;/a&gt;&lt;span id="page75" role="doc-pagebreak" aria-label="75" epub:type="pagebreak"&gt;&lt;/span&gt;Book Title&lt;/h2&gt;
        &lt;div class="_idGenObjectLayout-1"&gt;
            &lt;figure class="Full-Cover-White"&gt;
                &lt;img class="_idGenObjectAttribute-1" src="image/cover.jpg" alt="" /&gt;
            &lt;/figure&gt;
        &lt;/div&gt;
        &lt;div id="page76" role="doc-pagebreak" aria-label="76" epub:type="pagebreak" /&gt;
        &lt;section class="summary"&gt;&lt;h3 class="summary"&gt;&lt;span class="border"&gt;SUMMARY&lt;/span&gt;&lt;/h3&gt; 
        &lt;p class="BT-Sans-left-align---p1"&gt;Lorem ipsum etc.&lt;/p&gt;
    &lt;/section&gt;
</code></pre>

<p>Which looks like plain old ePub to me.  You can use the <code>fetch</code> command as above, but you'll still get the verbose version of the xHTML.</p>

<h2 id="putting-it-all-together"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#putting-it-all-together">Putting it all together</a></h2>

<p>If you've unzipped the original ePub, you'll see the internal directory structure. It should look something like this:</p>

<pre><code class="language-_">├── META-INF
│&nbsp;&nbsp; └── container.xml
├── mimetype
└── OEBPS
    ├── content.opf
    ├── images
    │&nbsp;&nbsp; ├── cover.jpg
    │&nbsp;&nbsp; ├── image1.jpg
    │&nbsp;&nbsp; └── image2.png
    ├── styles
    │&nbsp;&nbsp; └── styles.css
    ├── content
    │&nbsp;&nbsp; ├── 001-cover.xhtml
    │&nbsp;&nbsp; ├── 002-about.xhtml
    │&nbsp;&nbsp; ├── 003-title.xhtml
    │&nbsp;&nbsp; ├── 004-chapter_01.xhtml
    │&nbsp;&nbsp; ├── 005-chapter_02.xhtml
    │&nbsp;&nbsp; └── 006-chapter_03.xhtml
    └── toc.ncx
</code></pre>

<p>Add the extracted files into that exact structure. Then zip them. Rename the .zip to .epub. That's it. You now have a DRM-free copy of the book that you purchased.</p>

<h2 id="bonus-pdf-extraction"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#bonus-pdf-extraction">BONUS! PDF Extraction</a></h2>

<p>LCP 2.0 PDFs are also extractable. Again, you'll need to open your purchased PDF in Thorium with debug mode active. In the debugger, you should be able to find the URl for the decrypted PDF.</p>

<p>It can be fetched with:</p>

<pre><code class="language-js">fetch("thoriumhttps://0.0.0.0/pub/..../publication.pdf") .then(response =&gt; response.arrayBuffer())
  .then(buffer =&gt; {
    let base64 = btoa(
      new Uint8Array(buffer).reduce((data, byte) =&gt; data + String.fromCharCode(byte), '')
    );
    const blob = new Blob([buffer], { type: "application/pdf" });
    const link = document.createElement("a");
    link.href = URL.createObjectURL(blob);
    link.download = "publication.pdf"; // filename for saving
    link.click();
    URL.revokeObjectURL(link.href);
  });
</code></pre>

<p>Copy the output and Base64 decode it. You'll have an unencumbered PDF.</p>

<h2 id="next-steps"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#next-steps">Next Steps</a></h2>

<p>That's probably about as far as I am competent to take this.</p>

<p>But, for now, <a href="https://proofwiki.org/wiki/ProofWiki:Jokes/Physicist_Mathematician_and_Engineer_Jokes/Burning_Hotel#Variant_1">a solution exists</a>. If I ever buy an ePub with LCP Profile 2.0 encryption, I'll be able to manually extract what I need from it - without reverse engineering the encryption scheme.</p>

<h2 id="ethics"><a href="https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/#ethics">Ethics</a></h2>

<p>Before I published this blog post, <a href="https://mastodon.social/@Edent/114155981621627317">I publicised my findings on Mastodon</a>.  Shortly afterwards, I received a LinkedIn message from someone senior in the Readium consortium - the body which has created the LCP DRM.</p>

<p>They said:</p>

<blockquote><p>Hi Terence, You've found a way to hack LCP using Thorium. Bravo!
</p><p>We certainly didn't sufficiently protect the system, we are already working on that.
</p><p>From your Mastodon messages, you want to post your solution on your blog. This is what triggers my message. 
</p><p>From a manual solution, others will create a one-click solution. As you say, LCP is a "reasonably inoffensive" protection. We managed to convince publishers (even big US publishers) to adopt a solution that is flexible for readers and appreciated by public libraries and booksellers. 
</p><p>Our gains are re-injected in open-source software and open standards (work on EPUB and Web Publications). 
</p><p>If the DRM does not succeed, harder DRMs (for users) will be tested.
</p><p>I let you think about that aspect</p></blockquote>

<p>I did indeed think about that aspect. A day later I replied, saying:</p>

<blockquote><p>Thank you for your message.

</p><p>Because Readium doesn't freely licence its DRM, it has an adverse effect on me and other readers like me.
</p><ul>    <li>My eReader hardware is out of support from the manufacturer - it will never receive an update for LCP support.</li>
    <li>My reading software (KOReader) have publicly stated that they cannot afford the fees you charge and will not be certified by you.</li>

    <li>Kobo hardware cannot read LCP protected books.</li>

    <li>There is no guarantee that LCP compatible software will be released for future platforms.</li></ul>
<p>In short, I want to read my books on <em>my</em> choice of hardware and software; not yours.

</p><p>I believe that everyone deserves the right to read on their platform of choice without having to seek permission from a 3rd party.

</p><p>The technique I have discovered is basic. It is an unsophisticated use of your app's built-in debugging functionality. I have not reverse engineered your code, nor have I decrypted your secret keys. I will not be publishing any of your intellectual property.

</p><p>In the spirit of openness, I intend to publish my research this week, alongside our correspondence.
</p></blockquote>

<p>Their reply, shortly before publication, contained what I consider to be a crude attempt at emotional manipulation.</p>

<blockquote><p>Obviously, we are on different sides of the channel on the subject of DRMs. 

</p><p>I agree there should be many more LCP-compliant apps and devices; one hundred is insufficient. KOReader never contacted us: I don't think they know how low the certification fee would be (pricing is visible on the EDRLab website). FBReader, another open-source reading app, supports LCP on its downloadable version. Kobo support is coming. Also, too few people know that certification is free for specialised devices (e.g. braille and audio devices from Hims or Humanware). 
</p><p>We were planning to now focus on new accessibility features on our open-source Thorium Reader, better access to annotations for blind users and an advanced reading mode for dyslexic people. Too bad; disturbances around LCP will force us to focus on a new round of security measures, ensuring the technology stays useful for ebook lending (stop reading after some time) and as a protection against oversharing. 
</p><p>You can, for sure, publish information relative to your discoveries to the extent UK laws allow. After study, we'll do our best to make the technology more robust. If your discourse represents a circumvention of this technical protection measure, we'll command a take-down as a standard procedure. </p></blockquote>

<p>A bit of a self-own to admit that they failed to properly prioritise accessibility!</p>

<p>Rather than rebut all their points, I decided to keep my reply succinct.</p>

<blockquote><p>As you have raised the possibility of legal action, I think it is best that we terminate this conversation.</p></blockquote>

<p>I sincerely believe that this post is a legitimate attempt to educate people about the deficiencies in Readium's DRM scheme. Both readers and publishers need to be aware that their Thorium app easily allows access to unprotected content.</p>

<p>I will, of course, publish any further correspondence related to this issue.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=58843&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2025/03/towards-extracting-content-from-an-lcp-protected-epub/feed/</wfw:commentRss>
			<slash:comments>19</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Stop treating eBooks like paper books]]></title>
		<link>https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/</link>
					<comments>https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 14 Apr 2023 11:34:31 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[rant]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45470</guid>

					<description><![CDATA[As part of my never-ending quest to banish this skeuomorph from the world…  I was reading a fascinating eBook recently which was, sadly, designed to mimic a legacy / paper book. To the point where the authoring software had hard-coded in page numbers and forced them to be displayed.  Here&#039;s what it looked like:    There are two abominations here. There&#039;s no need to interrupt the reading e…]]></description>
										<content:encoded><![CDATA[<p>As part of my never-ending quest to banish this skeuomorph from the world…</p>

<p>I was reading a fascinating eBook recently which was, sadly, designed to mimic a legacy / paper book. To the point where the authoring software had hard-coded in page numbers and forced them to be displayed.</p>

<p>Here's what it looked like:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/03/ebook-pages.png" alt="Screenshot of a page of an eBook. The page number splits the page in half. Footnotes are visible at the bottom of the bisected page." width="1091" height="520" class="aligncenter size-full wp-image-45499">

<p>There are two abominations here. There's no need to interrupt the reading experience by bisecting a page and displaying the page numbers. And there's no need to put footnotes at the actual foot of the artificial page.</p>

<p>The whole point of an eBook is to free the reader from the tyranny of the publisher's choices. If the reader wants to justify the text, change the font, hide all footnotes, or has strong opinions about <a href="https://www.indesignskills.com/tutorials/widows-and-orphans/">widows and orphans</a> - they can choose a reading experience which suits their needs.</p>

<p>Let's take a look at the code behind the page and how it <em>should</em> been written.</p>

<h2 id="page-numbers"><a href="https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#page-numbers">Page numbers</a></h2>

<p>The HTML the book uses to show the page numbers is:</p>

<pre><code class="language-html">   ...
   &lt;div class="page-break"&gt;end p.16&lt;/div&gt;
   &lt;div id="page_16"&gt;&nbsp;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="page-bounds"&gt;
   &lt;div id="acprof-0195171276-div1-8c"&gt;
      &lt;div class="para"&gt;
         ...
</code></pre>

<p>The CSS is:</p>

<pre><code class="language-css">div.page-break {
    text-align: right;
    line-height: 1px;
    font-size: 10px;
    color: #aca368;
    border-bottom: 1px solid #706650;
    padding: 3px 4px 8px 0px;
    margin: 0px 2px 10px 0px;
}
</code></pre>

<p>So, what <em>should</em> it be?  I've previously <a href="https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/">written about the support ePub has for page numbers</a>. And the answer is well documented in the specification.</p>

<p>It's simply this:</p>

<pre><code class="language-html">&lt;span epub:type="pagebreak" id="page_123_a" title="123" /&gt;
</code></pre>

<p>That inserts an invisible pagebreak. The reader can <em>choose</em> to render one page per physical screen. Or they can <em>choose</em> to display a page number. Or they can <em>choose</em> to ignore the suggestion.</p>

<h2 id="html-footnotes"><a href="https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#html-footnotes">HTML Footnotes</a></h2>

<p>Here's the code as presented in the ePub:</p>

<pre><code class="language-html">   &lt;div class="para"&gt;Not only was that result in disagreement with the other trials made by the committee but also it was the direct opposite of the observations by Adams and De Luc, &lt;/div&gt;
&lt;/div&gt;
&lt;div class="footnote-inline"&gt;
   &lt;div&gt;15. See &lt;span id="xref-acprof-0195171276-bibItem-84c"&gt;&lt;a href="content9.html#acprof-0195171276-bibItem-84"&gt;De Luc 1772&lt;/a&gt;&lt;/span&gt;, 1:219-221, §408.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="footnote-inline"&gt;
   &lt;div&gt;16. See ...&lt;/div&gt;
&lt;/div&gt;
&lt;div class="page-break"&gt;end p.16&lt;/div&gt;
...
</code></pre>

<p>There's no need to put footnotes <em>alongside</em> the text. If you do that, you're basically telling the reader that you know better than them how they want to read the book.  Most eReaders will pop-up a footnote, making it easy to read and easy to close:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2023/04/footnote-popup.jpg" alt="Product photo of a Kindle showing the popup." width="900" height="650" class="aligncenter size-full wp-image-45500">

<p>The footnote link should have a specific ePub type, and the footnote itself is semantically represented as an <code>&lt;aside&gt;</code> with it's own type:</p>

<pre><code class="language-html">&lt;p&gt;The use of dilithium crystals was discouraged&lt;a epub:type="noteref" href="https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#n1" id="fn1"&gt;1&lt;/a&gt;.&lt;/p&gt;

&lt;aside epub:type="footnote" id="n1"&gt;
    &lt;p&gt;&lt;a epub:type="noteref" href="https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#fn1"&gt;1.&lt;/a&gt; Scott, M (2257).&lt;/p&gt;
&lt;/aside&gt;
</code></pre>

<p>The footnote text can be placed at the end of the chapter or the end of the book. No need to force it into the reader's eyeline.</p>

<p>There's also <a href="https://kdp.amazon.com/en_US/help/topic/GH4DRT75GWWAGBTU#footnote_guideline">similar advice from Kindle</a>.</p>

<h2 id="what-have-we-learned-today"><a href="https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/#what-have-we-learned-today">What have we learned today</a></h2>

<p>Books are magical. And, in my humble opinion, eBooks are <em>better</em> than legacy paper books. I can boost the font size of my eBook rather than having to buy an expensive large-print version. I can navigate by searching, or by semantic features, rather than grubbing around with page numbers. And I can choose to follow a footnote or ignore it as the whim strikes me.</p>

<p>But all that requires the publishers actually understanding how to take advantage of the format.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45470&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/04/stop-treating-ebooks-like-paper-books/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[How do you raise a software bug with a book publisher?]]></title>
		<link>https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/</link>
					<comments>https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 23 Nov 2020 12:26:12 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[publishing]]></category>
		<category><![CDATA[standards]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=37325</guid>

					<description><![CDATA[Recently, I bought an eBook which has a bug. I&#039;d like to explain what the bug is, why it is a problem, and how I&#039;m trying to get it corrected.  Amazon sells eBooks in KF8 format. That is an ePub with some proprietary extras. ePub is a standard based off HTML5. You can read the ePub 3 specification but, basically, it is a .zip of HTML files.  If you unzip an eBook, you can read the source code…]]></description>
										<content:encoded><![CDATA[<p>Recently, I bought an eBook which has a bug. I'd like to explain what the bug is, why it is a problem, and how I'm trying to get it corrected.</p>

<p>Amazon sells eBooks in <a href="https://wiki.mobileread.com/wiki/KF8">KF8 format</a>. That is an ePub with some proprietary extras. ePub is a standard based off HTML5. You can <a href="https://www.w3.org/publishing/epub3/epub-overview.html">read the ePub 3 specification</a> but, basically, it is a .zip of HTML files.  If you unzip an eBook, you can read the source code behind it.</p>

<p>When trying to read a Kindle book on a non-Kindle device, I noticed a bug. Some words were not displaying.  I took a look at the underlying source code, and found this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2020/11/Screenshot-from-2020-11-19-09-20-27.png" alt="HTML code - a span wraps the first letter of a word." width="931" height="65" class="aligncenter size-full wp-image-37328">

<img src="https://shkspr.mobi/blog/wp-content/uploads/2020/11/Screenshot-from-2020-11-19-09-19-56.png" alt="HTML code - a span wraps the first word of a sentence.." width="680" height="65" class="aligncenter size-full wp-image-37329">

<p>Sometimes words and letters were wrapped with a <code>pagebreak</code> span like this:</p>

<pre><code class="language-html">&lt;span id="pg5" epub:type="pagebreak"&gt;‘But&lt;/span&gt; of course!’
</code></pre>

<p>When I tried to read the book using <a href="https://koreader.rocks/">KOReader</a> the word "‘But" didn't appear. Why?  Let's take a look at the <a href="https://idpf.github.io/epub-vocabs/structure/#pagination">ePub3 specification concerning page breaks</a>:</p>

<blockquote> <strong>pagebreak</strong>
<ul><li>  A separator denoting the position before which a break occurs between two contiguous pages in a statically paginated version of the content.
</li><li>  HTML usage context: phrasing and flow content, where the value of the carrying elements title attribute takes precedence over element content for the purposes of representing the pagebreak value</li></ul></blockquote>

<p>Here's the problem - eBooks can have page numbers. Despite "<a href="https://shkspr.mobi/blog/2011/02/quoting-page-numbers-from-ebooks-considered-harmful/">Page Numbers in eBooks Considered Harmful</a>" lots of publishers still use them. I guess it is <em>kind of</em> useful if you want to refer to something on a printed page - but eReaders allow you to change font size and line spacing, so the concept of a page is somewhat nebulous.</p>

<p>The way the spec is written, means that you can write something like:</p>

<pre><code class="language-html">&lt;span epub:type="pagebreak" id="page_123_a" title="123"&gt;123&lt;/span&gt;
</code></pre>

<p>You use the <code>id</code> for internal linking and the <code>title</code> attribute for the value.</p>

<p>Because of this, most eReaders do not display the physical page number inside the span. It has no semantic content for the reader, and breaks flow. If they did display it, you might end up reading text like this:</p>

<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean vel</p>

<p>9</p>

<p>risus at metus molestie tincidunt. Donec aliquet aliquam lorem, ...</p></blockquote>

<p>So KOReader <em>deliberately</em> ignores any text which is wrapped with <code>epub:type="pagebreak"</code>.</p>

<p>If you look at <a href="https://github.com/IDPF/epub3-samples/search?l=HTML&amp;q=pagebreak">the example ePubs provided by the International Digital Publishing Forum</a>, you'll see that the majority of their spans are self-closing.</p>

<pre><code class="language-html">&lt;span epub:type="pagebreak" id="p123-a" title="123"/&gt;
</code></pre>

<p>Very occasionally, you see something which has just a page number in it:</p>

<p><a href="https://github.com/IDPF/epub3-samples/blob/68ba020fe5c99625d45dd50a94c4b202c5f220e1/30/childrens-literature/EPUB/s04.xhtml#L11"><code>&lt;span epub:type="pagebreak" title="169" id="Page_169"&gt;169&lt;/span&gt;</code></a></p>

<p>I checked with <a href="https://github.com/koreader/koreader/issues/6894">KOReader</a> and they confirmed that they were following the spec. I agree with them. There's no reason to wrap readable content in a metadata span like that.</p>

<p>I've checked several other books from different publishers. None of them abuse <code>pagebreaks</code> this way.  I think Penguin Random House are doing it wrong and I would like to correct them.</p>

<h2 id="reporting-it"><a href="https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/#reporting-it">Reporting it</a></h2>

<p>I've previously <a href="https://shkspr.mobi/blog/2011/03/how-do-you-upgrade-an-ebook/">reported buggy ebooks to vendors</a>. But because the Kindle app doesn't exhibit this problem, I thought it was futile going via Amazon. So I thought I'd try going directly to the publisher.</p>

<p>Sadly, <a href="https://github.com/puk">Penguin UK's GitHub repo is dead</a>. Their dedicated digital publishing team <a href="https://mobile.twitter.com/PRHDigital">haven't tweeted in 2 years</a>.</p>

<p>Their <a href="https://www.penguin.co.uk/company/about-us/notices/faqs.html">contact page</a> has a suggestion for what to do if there is an error in an eBook:</p>

<blockquote><p>It is best if you return the book to the original bookshop from which it was purchased; they should be happy to exchange it for a perfect copy. If you have any difficulty with this then please return the cover and title page of the book to us.</p></blockquote>

<p>Hmmm....</p>

<p>I dropped them an email, and got back this very reasonable reply:</p>

<blockquote><p>Thank you for reaching out and bringing this to our attention. The distinction you’ve made is already a part of our specification; this was an oversight which we’re looking into as a result of your input—it bypassed checks both because it validates and also passes visual checks on all the major platforms we screen for. This isn’t reflective of our entire library and should be limited to specific titles which we’re currently investigating.</p></blockquote>

<p>That's fair enough. The rendering quirk is specification compliant - but hard to spot because of the Kindle monoculture.</p>

<h2 id="change-the-spec-change-the-world"><a href="https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/#change-the-spec-change-the-world">Change the spec, change the world</a></h2>

<p>I've made <a href="https://github.com/w3c/epub-specs/issues/1437">a suggestion on GitHub that the spec should be clarified</a>. I don't think it's particularly obvious that content in a <code>pagebreak</code> may not be displayed.</p>

<p>Most resources agree that the content of a <code>pagebreak</code> should either be blank, or be the page number.</p>

<blockquote><p>If you include the page numbers as text content within a <code>span</code> or <code>div</code>, the pages will be more easily accessible to both sighted users and users using assistive technologies. This method has been employed in previous DAISY standards. The potential downside, however, is that mainstream user agents will not provide equivalent functionality to turn off unwanted content, forcing users to hear and view the page numbers.</p>

<p><a href="https://kb.daisy.org/publishing/docs/navigation/pagelist.html#faq">Digital Accessible Information System (DAISY)</a></p></blockquote>

<h2 id="whose-fault-is-it-anyway"><a href="https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/#whose-fault-is-it-anyway">Whose fault is it anyway?</a></h2>

<p>This is a tricky one. I think Penguin have undoubtedly made a mistake with the way they publish ePubs. But, so far, KOReader is the only rendering engine I've found which suppresses the content of <code>pagebreak</code>s by default.</p>

<p>Generally speaking, a user wouldn't want to display page numbers on an eBook. Software could have a user defined toggle to switch them on or off. Luckily, KOReader has a variety of style-sheets for rendering eBooks - so I picked one which displayed <code>pagebreak</code> content.</p>

<p>Software is hard.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=37325&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2020/11/how-do-you-raise-a-software-bug-with-a-book-publisher/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[If The Kindle is Sold at Break-Even, Why Doesn't Amazon Sell ePub?]]></title>
		<link>https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/</link>
					<comments>https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 15 Nov 2012 07:10:11 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[.mobi]]></category>
		<category><![CDATA[Amazon]]></category>
		<category><![CDATA[drm]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[epub]]></category>
		<category><![CDATA[kindle]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=6399</guid>

					<description><![CDATA[Amazon claims that it makes no money from the sale of Kindle eReader hardware.  Looking at the prices of eink devices at wholesalers, this looks broadly accurate.  They do seem to be selling at around wholesale cost - customers also get Amazon&#039;s fabulous support, free software updates, and high quality manufacturing.  Yet there is a curious anomaly. Why aren&#039;t Amazon selling ePub books? …]]></description>
										<content:encoded><![CDATA[<p>Amazon claims that <a href="http://www.forbes.com/sites/kellyclay/2012/10/12/amazon-confirms-it-makes-no-profit-on-kindles/">it makes no money from the sale of Kindle eReader hardware</a>.</p>

<p>Looking at <a href="http://www.alibaba.com/showroom/e--ink.html">the prices of eink devices at wholesalers</a>, this looks broadly accurate.  They do seem to be selling at around wholesale cost - customers also get Amazon's fabulous support, free software updates, and high quality manufacturing.</p>

<p>Yet there is a curious anomaly. Why aren't Amazon selling ePub books?</p>

<h2 id="terminology"><a href="https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#terminology">Terminology</a></h2>

<p>A quick diversion into the terminology used in this article.</p>

<ul>
    <li>eReader - the physical hardware. Kindle, Kobo, nook, etc.</li>
    <li>eBook - the electronic file containing the words &amp; pictures. ePub, Mobi, PDF, etc.</li>
</ul>

<h2 id="background"><a href="https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#background">Background</a></h2>

<p>There are, broadly speaking, two main formats for ebook - ePub and MobiPocket.  Think of them like the difference between 8-Tracks and cassette tapes - they both hold music, but play on different system.</p>

<p>ePub works on just about every eReader on the planet - with the notable exception of the Kindle.</p>

<p>MobiPocket (or Mobi, for short) only works on the Kindle<sup id="fnref:mobi"><a href="https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#fn:mobi" class="footnote-ref" title="I'm talking specifically about the DRM'd form of Mobi which is sold by Amazon." role="doc-noteref">0</a></sup>.</p>

<p>Wikipedia has a fairly comprehensive <a href="http://en.wikipedia.org/wiki/Comparison_of_e-book_readers#File_format_support">comparison of which device can handle which format</a>.</p>

<p>So, we have a problem.  The books you buy from Amazon can't be read on your Sony, Kobo, Nook, or Generic eReader.  Well, they can, but you have to <a href="http://www.wired.com/2011/01/how-to-strip-drm-from-kindle-e-books-and-others/">remove the DRM</a>, covert the book to the ePub, and hope that everything works ok.</p>

<p>What a pain in the arse.</p>

<h2 id="what-would-happen-if"><a href="https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#what-would-happen-if">What Would Happen If...</a></h2>

<p>Now, I'm not suggesting that the Kindle should be able to read ePub books.  Obviously, it's technically capable of doing so - but it would mean that Amazon customers could compare prices with other retailers and start to leave the Amazon ecosystem.</p>

<p>What I'm suggesting is that Amazon should say "Buy this ebook for your Kobo" and deliver an ePub to those poor, unfortunate souls who haven't been blessed with a Kindle.</p>

<p>There are lots of <a href="http://pinterest.com/bwmbooks/ebook-ereader-stats-and-charts/">statistics regarding eReader share</a>.  Some suggest that <a href="https://socialmediachimps.com/2012/04/infographic-ebook-readers-book-publishing-industry/">Amazon have a ~47% share of the eReader market in the US</a> whereas the <a href="http://en.wikipedia.org/wiki/Kobo_eReader#Market_share">Kobo eReader has a 46% share in Canada, and 50% share in France</a>.</p>

<p>Let's say that the Kindle has a worldwide share of 50%.  Amazon has two options:</p>

<ol><li>It can aggressively pursue that market share by producing more innovative, cheaper hardware, and hope to convert users to the Amazon flock</li>
<li>It can accept that some people don't want its hardware and start selling books directly to those users</li>
</ol>

<p>Amazon claims that it makes more money from eBook sales than hardware. So why doesn't it expand its market to the 50% of eReaders which are currently not served by its store?</p>

<p>At the moment, customers with Kobo, nook, and other eReaders can compare prices across a number of eBook stores.  What would happen if they could add Amazon to the list of shops they could compare with?</p>

<div id="footnotes" role="doc-endnotes">
<hr aria-label="Footnotes">
<ol start="0">

<li id="fn:mobi">
<p>I'm talking specifically about the DRM'd form of Mobi which is sold by Amazon.&nbsp;<a href="https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/#fnref:mobi" class="footnote-backref" role="doc-backlink">↩︎</a></p>
</li>

</ol>
</div>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=6399&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2012/11/if-the-kindle-is-sold-at-break-even-why-doesnt-amazon-sell-epub/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
	</channel>
</rss>
