printers-2.1.0-rc2 has been yanked.
Printers
Printers is a simple lib to call printers apis for unix (cups) and windows (winspool) systems.
Printers can provide a list of printers available on the system and send print jobs to them
Behavior
Return a vector of all available printers
let printers = get_printers; // -> Vec<Printer>
Create print job of an byte array
let data = "42".as_bytes;
printer.print; // -> Result<(), &'static str>
Create print job of an file
let path = "my_file/example/path.txt";
printer.print_file; // -> Result<(), &'static str>
Find printer by the name
let my_printer = get_printer_by_name; // -> Option<Printer>
Get the default printer
let printer = get_default_printer; // -> Option<Printer>
Example
use ;
System Requirements
Windows
For Windows printers will be use winspool apis to retrive printers and create jobs with RAW datatypes
Note: For some reasons, printing for complex files like PDF, DOCx and others can`t works as well in many printers. If you want collaborate to implement winspool for printing documents, your contribution will be greatly appreciated
Unix
For Unix is necessary cups service installed