<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Deepthi M on Medium]]></title>
        <description><![CDATA[Stories by Deepthi M on Medium]]></description>
        <link>https://medium.com/@deepthi.m_81259?source=rss-9c418f7e8c7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*zp9tcVqpxfawYq2aknnc5g.png</url>
            <title>Stories by Deepthi M on Medium</title>
            <link>https://medium.com/@deepthi.m_81259?source=rss-9c418f7e8c7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 09:30:28 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepthi.m_81259/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a universal reader with ePub.js]]></title>
            <link>https://medium.com/impelsys/building-a-universal-ebook-reader-with-epub-js-1ac32ca6265e?source=rss-9c418f7e8c7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/1ac32ca6265e</guid>
            <category><![CDATA[renderhtml]]></category>
            <category><![CDATA[epub]]></category>
            <category><![CDATA[ebook-reader]]></category>
            <dc:creator><![CDATA[Deepthi M]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 08:58:23 GMT</pubDate>
            <atom:updated>2026-03-24T09:06:01.877Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Browsers can render HTML, but they don’t know how to read books.</em></p><h3>Introduction:</h3><p>Many platforms rely on EPUB to deliver long-form content, but building a reliable reading experience in the browser comes with its own challenges. Maintaining a consistent reader across multiple platforms often becomes complex and difficult to scale.</p><p>Instead of continuing to patch an existing solution, we chose to rebuild the reader from the ground up.</p><p>If you are planning to rethink the entire reading experience — modernizing the interface, improving performance, and introducing features that work seamlessly across platforms, ePub.js can be a practical solution.</p><h3>Problem Statement:</h3><p>Many platforms deliver long-form content in EPUB format, including textbooks, course materials, and reference documents. However, building a consistent and reliable reading experience across devices introduces several challenges.</p><p>Maintaining separate implementations for web and mobile platforms often leads to duplicated effort, inconsistent user experiences, and increased maintenance overhead.</p><p>To address this, we chose to rethink the reader from the ground up.</p><p>Our objectives were clear:</p><ul><li>Modernize the reading interface</li><li>Improve performance and responsiveness</li><li>Support both online and offline reading</li><li>Ensure a consistent experience across platforms</li></ul><p>A key design decision was to build a shared reader architecture. With a unified core, a single code change can propagate across platforms, reducing the need for platform-specific implementations and simplifying long-term maintenance.</p><p>One of the biggest challenges in this approach was ensuring the reader behaved consistently across different environments while adapting to platform-specific interaction patterns.</p><p>For mobile apps, books can be downloaded and cached locally, allowing users to continue reading even without an internet connection.</p><p>For web users, books are loaded dynamically from our platform.</p><p>The challenge was creating a single reader experience that worked across all these environments.</p><p>Why Browsers Can’t Just Open EPUB Files?</p><p>Although EPUB uses HTML and CSS internally, browsers cannot open EPUB files directly.</p><p>Browsers can render HTML, but they do not understand:</p><ul><li>EPUB packaging</li><li>Reading order (spine)</li><li>Navigation structure</li><li>Pagination for reflowable text</li></ul><p>Opening an EPUB file directly in a browser usually results in nothing happening.</p><p>To support reading inside our platform, we needed a client-side EPUB renderer.</p><p>This is where ePub.js became an important part of our solution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pMNRZNTi0fs9qSizSHa-dA.png" /><figcaption>Figure 1: Interactive eBook reader platform breakdown</figcaption></figure><h3>What is .epub?</h3><p>An .epub file is essentially a packaged digital publication.</p><p>Under the hood, it is a ZIP archive that contains:</p><ul><li>HTML pages</li><li>CSS stylesheets</li><li>Images and media assets</li><li>Metadata defining the reading order</li></ul><p>In many ways, an EPUB file behaves like a small website packaged as a book.</p><p>ePub.js handles the complex parts of EPUB rendering.</p><p>Internally it:</p><ul><li>Decompresses the EPUB archive</li><li>Parses the OPF manifest</li><li>Builds the reading spine</li><li>Renders chapters inside sandboxed iframes</li></ul><p>Despite the complexity behind the scenes, the API is very simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Xup0I2h5bJRwkB8sxCVM3A.png" /><figcaption>Figure 2: EPUB file structure infographic</figcaption></figure><h3>Key Benefits of Using ePub.js:</h3><h4>1. Fast to Integrate</h4><p>A working prototype can be built within a few days.</p><h4>2. Full UI Ownership</h4><p>Provides full control over navigation, themes, layout, and platform-specific features.</p><h4>3. Precise Bookmarking</h4><p>CFI identifiers allow us to restore reading positions exactly.</p><h4>4. Cross-Platform Compatibility</h4><p>The reader works across mobile apps and web environments.</p><h4>5. BSD License</h4><p>Safe for commercial use.</p><h4>6. Flexible Page Rendering Options</h4><p>ePub.js provides multiple rendering modes that can be adapted depending on the reading experience required. For example:</p><ul><li>Swipe-based navigation for mobile readers</li><li>Spread layout for tablet or desktop viewing</li><li>Scroll mode for continuous reading</li><li>Continuous scrolling for long-form content</li></ul><p>This flexibility will allow you to tailor the reading experience for different screen sizes and user preferences.</p><h4>7. Built-in Reader Features</h4><p>Using ePub.js along with a custom UI layer, you can get support from several important reader features:</p><ul><li>Themes such as light and dark modes for better readability</li><li>Font customization to improve accessibility</li><li>Text highlights for marking important sections</li><li>Bookmarks using CFI identifiers to restore exact reading positions</li><li>Table of Contents (TOC) for quick chapter navigation</li><li>Seek bar navigation to move quickly across sections of the book</li></ul><p>These features can help in creating a full reading experience rather than just a basic EPUB viewer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wcAAdD3TCDsZWSBbVodKdg.png" /><figcaption>Figure 3: eBook reader features in action</figcaption></figure><h3>Limitations of ePub.js:</h3><h4>1. No Active Maintenance Since 2020</h4><p>The last release was published in 2020, and many issues remain open.</p><h4>2. Scripted EPUB Content Is Sandboxed</h4><p>Interactive JavaScript content requires enabling allowScriptedContent, which has security implications.</p><h4>3. Large Books Are Slow to Open</h4><p>Large textbooks may take 3–5 seconds to load due to client-side decompression.</p><h4>4. No DRM Support</h4><p>DRM support must be implemented separately.</p><h4>5. No Migration Support</h4><p>ePub.js itself does not provide built-in tools for migrating from older reader implementations or managing reader state transitions. When rebuilding our reader, we had to handle data migration and compatibility with existing reading positions based on CFI.</p><p><strong>Real observations</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OrqmPz0Kvo6wzzCDWxghng.png" /><figcaption>Figure 5: Real load time observations in eBooks</figcaption></figure><p>Optimizing images and caching will improve performance.</p><h3>Solution:</h3><p>Building a browser reader involves more than rendering HTML.</p><p>Key points:</p><ul><li>EPUB structure is more complex than it appears</li><li>Performance optimization matters for large books</li><li>A good reading experience depends on UI and navigation</li><li>Consistency across devices is easy</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*JEkLSUV105qmUapAxEyXzg.png" /><figcaption>Figure 4: <em>Architecture overview of a browser-based EPUB reader integrated into a learning platform</em></figcaption></figure><p>While building the reader, it is important to balance flexibility, performance, and long-term maintainability.</p><p>Using ePub.js will enable rapid development and allow the same reader logic to be reused across multiple platforms. However, this also introduced trade-offs, such as handling certain EPUB edge cases and optimizing performance for larger books.</p><p>Another key consideration was deciding how responsibilities should be split between the rendering layer and the platform. The core EPUB rendering was handled by ePub.js, while platform-specific features such as themes, navigation controls, and analytics can be managed in the UI layer.</p><p>This separation can keep the architecture modular and easier to maintain, while still allowing the reader to be extended with platform-specific capabilities when needed.</p><p>A minimal reader can be created with just three lines:</p><pre>import ePub from &quot;epubjs&quot;;<br><br>const book = ePub(&quot;book.epub&quot;);<br>const rendition = book.renderTo(&quot;reader&quot;, {<br>  width: &quot;100%&quot;,<br>  height: &quot;100%&quot;<br>});<br><br>rendition.display();</pre><p>This example shows how simple bookmarking works.</p><pre>rendition.on(&quot;relocated&quot;, (location) =&gt; {<br>  localStorage.setItem(&quot;lastPosition&quot;, location.start.cfi);<br>});<br>const savedPosition = localStorage.getItem(&quot;lastPosition&quot;);<br>if (savedPosition) {<br>  rendition.display(savedPosition);<br>}</pre><p>One feature that enabled easier extension of the reader was Hooks.</p><p>Hooks allow developers to inject custom logic during different stages of the rendering pipeline.</p><p>You can use them to apply platform styling and store reading position.</p><pre>rendition.hooks.content.register(function(contents) {<br>  contents.addStylesheet(&quot;/reader/theme.css&quot;);<br>});<br><br>rendition.on(&quot;relocated&quot;, (location) =&gt; {<br>  localStorage.setItem(&quot;readPosition&quot;, location.start.cfi);<br>});<br><br>const saved = localStorage.getItem(&quot;readPosition&quot;);<br>rendition.display(saved || undefined);</pre><h3>Conclusion:</h3><h4>ePub.js: A Strong Foundation, Not a Silver Bullet</h4><p>Building a reader from scratch makes it possible to deliver a modern, consistent reading experience across platforms, including support for both online and offline usage.</p><p>ePub.js serves as a reliable rendering engine with enough flexibility to build a fully customized reader.</p><p>That said, the lack of active maintenance and the need to handle EPUB edge cases or large files should be taken into consideration.</p><p>In practice, ePub.js is best used as a rendering layer, with the surrounding reader experience designed and managed by the platform.</p><p><strong>Reference Link</strong></p><p><a href="https://github.com/futurepress/epub.js">https://github.com/futurepress/epub.js</a></p><p><a href="http://epubjs.org/documentation/0.3/">http://epubjs.org/documentation/0.3/</a></p><p><a href="https://www.npmjs.com/package/epubjs">https://www.npmjs.com/package/epubjs</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1ac32ca6265e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/impelsys/building-a-universal-ebook-reader-with-epub-js-1ac32ca6265e">Building a universal reader with ePub.js</a> was originally published in <a href="https://medium.com/impelsys">Impelsys</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Blank one]]></title>
            <link>https://medium.com/@deepthi.m_81259/blank-one-d5a271f54982?source=rss-9c418f7e8c7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/d5a271f54982</guid>
            <dc:creator><![CDATA[Deepthi M]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 08:29:17 GMT</pubDate>
            <atom:updated>2026-03-24T08:29:17.808Z</atom:updated>
            <content:encoded><![CDATA[<img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d5a271f54982" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>