Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Besides opening PDFs (and despite the project's name), MuPDF can also read EPUBs, but currently this WASM viewer can't open them. They must have had to reduce functionality of the library to port faster to WASM.

But I wonder if there are any intrinsic issues with displaying EPUBs using WASM?



Since EPUBs are just zipped HTML files, I guess rendering can be done more efficiently by the browser itself rather than by custom rendering on an HTML canvas.


I wrote an epub reader a few years ago and this is false.

most epubs are just zipped html, but not all.

There are different versions to this file format and some need to be parsed as xml. The chapter files will mostly adhere to html with caveats wrt anchor tags, image sources and similar as well as metadata wont be parsed/work with html parsers.


Can't you preprocess them with a custom parser and then hand over a conformant HTML to the browser?


Yes, but while thatd be a lot easier for epub (vs PDF), you can fundamentally do that for any other format too.

You could even - technically - take a picture as an input and then render it via background color rgb() using divs pixel-by-pixel. thatd still fall under that description.


You're right. In that case you could implement the unzipping and metadata parsing in WASM and just hand the HTML to the browser to be rendered.

It's still useful since browsers don't come with built-in EPUB support.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: