This crate implements minimal conversion from HTML to PDF.
ToDo: Proper parsing of tag attibutes. Font sizing, html tables. A whole lot more.
Test example
use pdf_min::*;
let source = format!("
!
Hello something bold ok
Hi italic test
Hi bold italic test ok
Hi sup test ok
Hi sub text ok
{}
","Some words to cause Line and Page wrapping ".repeat(200));
let mut w = Writer::default();
w.b.nocomp = true;
w.line_pad = 8; // Other Writer default values could be adjusted here.
html(&mut w, source.as_bytes());
w.finish();
use std::fs::File;
use std::io::prelude::*;
let mut file = File::create("test.pdf").unwrap();
file.write_all(&w.b.b).unwrap();
Rust is Great
Important Notice