-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for other file formats like epub, xps, cbz, mobi, fb2, svg #115
Comments
This is related to the file size of the WASM library and to try to keep it as small as possible, due to file size concerns, see: https://github.com/ArtifexSoftware/mupdf.js/blob/master/BUILDING.md#building - "In order to keep it as small as possible, it is built with a minimal feature set that excludes the more refined CJK fonts, PDF scripting, XPS format, and EPUB format support." |
In order to support epub, we'd need to include harfbuzz into the compilation. This would be the first library to be included that uses C++, albeit in the least impactfull way possible. I wouldn't be 100% sure that including C++ wouldn't cause problems with wasm. It might be fine, but such is the immaturity of the wasm eco-system that I wouldn't want to bet either way without trying. |
PyMuPDF uses loads of C++ these days, and works fine on Pyodide, so things might work ok? |
I don't know much about WASM, so just out of my curiosity, is there any disadvantage of large WASM files? (Like browser support etc.) except the potential network bandwidth? If there is none, I could try to compile MuPDF.js with epub support (or better Artifex provides us a "full-variant", like
I share the same doubt, but as someone with no experience with WASM, I will leave it to the experts 😅. |
Why we don't ship everything is mainly a matter of deployment size affecting bandwidth and startup time for loading and compiling the wasm bytecode to native code. Changing the build scripts to enable other components such as XPS and EPUB should just work. However, dealing with multiple build configurations and deployments in NPM is a nightmare I'd very much like to avoid. |
Hii
First of all, thanks for
mupdf.js
(and that too WASM), it is super cool!I come from
PyMuPDF
background, there we could load epub, xps, cbz, mobi, fb2, svg file formats and work with them just like PDF documents. Doesmupdf.js
also work the same way? Can one load other formats except PDF?I tried using https://github.com/ArtifexSoftware/mupdf.js/blob/master/examples/simple-viewer/index.html and modified the
input
element to accept epub files too. But when an epub file is opened, I get this error from console:Perhaps, I'm missing something, and I need to modify the script used to make it support epub?
Thanks!
(Sorry if it is duplicate, I searched for epub in issues and it did not bring up anything).
The text was updated successfully, but these errors were encountered: