pub fn parse(document: &str) -> Result<PrintRequest, DialectError>Expand description
Parses a request document. Elements and attribute values the manual does not define are an error.
use hardless_http_dialects::webprnt;
let req = webprnt::parse(r#"<root><alignment position="center"/>
<text emphasis="true">Hello\x0a</text><cutpaper type="partial" feed="true"/></root>"#).unwrap();
assert_eq!(req.escpos, b"\x1b@\x1ba\x01\x1bE\x01Hello\n\x1dVB\x00");