Skip to content

feat: add eBook to PDF converter - #213

Merged
mithun-srinivas merged 1 commit into
mithun-srinivas:mainfrom
Pawankumar3210:feature/ebook-to-pdf
Sep 3, 2026
Merged

feat: add eBook to PDF converter#213
mithun-srinivas merged 1 commit into
mithun-srinivas:mainfrom
Pawankumar3210:feature/ebook-to-pdf

Conversation

@Pawankumar3210

Copy link
Copy Markdown
Contributor

Which issue does this close?

Closes #206

What changed

Added a new eBook to PDF operation at src/operations/ebook-to-pdf/.

The tool converts EPUB, TXT, and HTML files into paginated PDFs entirely in the browser.

For EPUB files, it uses the existing fflate library to unpack the archive, reads container.xml and the package document, follows the EPUB spine order, extracts XHTML chapters, and converts the content into the existing DoxDock PDF block/layout pipeline.

TXT and HTML inputs are also supported using the existing DoxDock content and PDF rendering utilities.

Acceptance criteria

  • A simple EPUB exports a readable, paginated PDF in spine order.
  • TXT files are supported.
  • HTML files are supported.
  • Runs fully offline with no external network calls.

Checklist

  • 100% client-side.
  • Uses existing fflate and pdf-lib dependencies.
  • Follows the self-contained plugin pattern.
  • Reuses existing htmlToBlocks and renderBlocksToPdf utilities.
  • No new dependencies added.
  • npx eslint passes.
  • npm test — 40/40 tests passed.
  • npm run build — passed.

Manual testing

Tested with real public-domain ebook files:

  • EPUB → PDF ✅
  • TXT → PDF ✅
  • HTML → PDF ✅

The EPUB conversion was verified with a real EPUB and confirmed readable PDF output.

The implementation also documents layout-fidelity limitations for complex CSS, fonts, interactive content, and embedded resources.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

@Pawankumar3210 is attempting to deploy a commit to the Mithun Srinivas' projects Team on Vercel.

A member of the Team first needs to authorize it.

@mithun-srinivas

Copy link
Copy Markdown
Owner

Lovely work @Pawankumar3210, and thanks for reusing what we already have. Unpacking the EPUB with fflate, walking container.xml to the package document, and following the spine order through the existing htmlToBlocks and renderBlocksToPdf pipeline is exactly the right approach, no new dependency needed. TXT and HTML support come along cleanly, and the notes are honest about the layout-fidelity limits.

All checks are green including the zero-external-network E2E, and it meets every criterion on #206. Merging now.

Tiny thing for a future pass, not blocking: the meta order (17) is shared with the Stamp PDF tool, so a different value would tidy the sort order. Thanks, and this is the first of the new competitor-gap tools to land!

@mithun-srinivas
mithun-srinivas merged commit 652524d into mithun-srinivas:main Sep 3, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eBook (EPUB) to PDF

2 participants