feat: add eBook to PDF converter - #213
Conversation
|
@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. |
|
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! |
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
fflatelibrary to unpack the archive, readscontainer.xmland 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
Checklist
fflateandpdf-libdependencies.htmlToBlocksandrenderBlocksToPdfutilities.npx eslintpasses.npm test— 40/40 tests passed.npm run build— passed.Manual testing
Tested with real public-domain ebook files:
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.