Skip to content

Instantly share code, notes, and snippets.

@wehlutyk
Last active July 2, 2018 13:21
Show Gist options
  • Save wehlutyk/90836084cf85e3c98ca71556d1f03968 to your computer and use it in GitHub Desktop.
Save wehlutyk/90836084cf85e3c98ca71556d1f03968 to your computer and use it in GitHub Desktop.
lopdf + xml-rs → wasm
[package]
name = "infuse-explorations"
version = "0.1.0"
authors = ["Sébastien Lerique <sl@mehho.net>"]
[lib]
crate-type = ["cdylib"]
[dependencies]
wasm-bindgen = "0.2"
lopdf = { path = "../lopdf", features = ["rust_backend"], default-features = false }
xml-rs = "0.8"
#![feature(proc_macro, wasm_custom_section, wasm_import_module)]
extern crate wasm_bindgen;
use wasm_bindgen::prelude::*;
#[wasm_bindgen]
extern {
#[wasm_bindgen(js_namespace = console)]
fn log(s: &str);
}
#[wasm_bindgen]
pub fn greet(name: &str) {
log(&format!("Hello, {}!", name));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment