# librevenge for the web (johnmcm.com) The WebAssembly module behind johnmcm.com's Publisher viewer (/pub-viewer) and CorelDRAW viewer (/cdr-viewer): libmspub and libcdr, with librevenge, built with Emscripten into one module, `revenge.wasm`, and its loader `revenge.mjs`, served from /vendor/local/revenge@1/. It reads a .pub, .cdr or .cmx file in the browser and returns the drawing as JSON (shapes, text boxes, tables and pictures, in points); the site lays the text out and draws the pages as SVG itself. ## What is here | File | What it is | |---|---| | `Dockerfile` | The whole build. The Emscripten image is pinned by digest and every source tarball by SHA-256. | | `build.ps1` | Runs the Docker build and copies the result into `frontend/vendor/local/revenge@1/`. | | `src/binding.cpp` | The functions the page calls (embind). | | `src/JSONDrawingGenerator.*` | A librevenge drawing interface that writes the calls as JSON. | | `src/compile.sh` | Compiles and links the module. | | `icu/make-icudata.sh` | Builds the small ICU data file with the codepage converters the libraries need. | | `patches/libmspub/` | Three fixes to libmspub 0.1.5 (see each patch's header). | `binding.cpp`, `JSONDrawingGenerator.*`, `compile.sh`, `make-icudata.sh` and the patches come from the OpenImprenta libmspub-wasm spike by Ricardo Nigrelli (https://github.com/RicardoNigrelli/libmspub-wasm, MPL-2.0); this version adds libcdr and lcms2 and chooses the reader by a format argument. ## The libraries and their source The module contains these libraries, unmodified except for the patches above. Their source is the release tarball named in the Dockerfile, from the project's own download location, with the SHA-256 checksum given there: | Library | Version | Licence | Source | |---|---|---|---| | librevenge | 0.0.5 | MPL-2.0 (or LGPL-2.1+) | https://dev-www.libreoffice.org/src/librevenge-0.0.5.tar.bz2 | | libmspub | 0.1.5 + patches | MPL-2.0 | https://dev-www.libreoffice.org/src/libmspub/libmspub-0.1.5.tar.xz | | libcdr | 0.1.9 | MPL-2.0 | https://dev-www.libreoffice.org/src/libcdr/libcdr-0.1.9.tar.xz | | Little CMS (lcms2) | 2.19.1 | MIT | https://github.com/mm2/Little-CMS/releases/download/lcms2.19.1/lcms2-2.19.1.tar.gz | | ICU (Emscripten port) | 68.2 | Unicode-DFS-2016 | https://github.com/unicode-org/icu/releases/tag/release-68-2 | | zlib (Emscripten port) | 1.3 | Zlib | https://zlib.net/ | | Boost headers (Emscripten port) | 1.83 | BSL-1.0 | https://www.boost.org/ | The files in this folder are MPL-2.0 (LICENSE-MPL-2.0.txt).