Ways to physically print in Rust using native dialogs

I've spent a while figuring out how to print a document in Rust using native dialogs. In case anyone else has been trying, the best method I found was using fltk and something like this:

let app = app::App::default();
    let mut wind = Window::default();
    wind.end();
    wind.show();
    wind.hide();

    let mut printer = printer::Printer::default();
    if printer.begin_job(1).is_ok() {
        printer.begin_page().ok();
        let (width, height) = printer.printable_rect();

        // Thing to print goes here        

        printer.set_origin(width / 2, height / 2);
        printer.end_page().ok();
        printer.end_job();
    }

    app.run().unwrap();

Hope this helps someone out, and if there's a better way to do this, I'd love to hear about it in the comments of this post.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.