/wasm-pdf-demo

A Demo WASM program in Rust which creates a PDF file. Also includes example clients which run the WASM file.

Primary LanguageElixirMIT LicenseMIT

WASM PDF Demo

This is a demo of WASM and how it integrates into different environments. We take invoice generation as an example. The idea is to have a WASM program which can generate (fake) invoice PDF files which is then used by different clients:

  • A web browser uses the WASM PDF generator to create and download PDF files without the need for a backend
  • An Elixir application uses the same WASM PDF generator to create a (fake) invoice and save it to disk

This repository contains of multiple parts, each in its own directory:

  • wasm_invoice - The invoice generation code implemented in Rust
  • browser_example - An HTML page which generates the invoice and offers it as a download
  • elixir_example - A fake Elixir backend which generates an invoice and saves it to disk

Each directory has it's own README. Please refer to those for details on the subprojects.

Running the demos

To be able to run the demos, the WASM file needs to be compiled first. Please refer to the wasm_invoice README on how to do this. When the WASM file was compiled, feel free to run any of the other demos - again, refer to their respective README files for details.

License

The entire project is under the MIT License. Please read the LICENSE file.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you shall be licensed as above, without any additional terms or conditions.