Printers: A printing APIs implementation for unix (cups) and windows (winspool).
Provides all system printers, create and get print jobs.
Documentation
See the references in docs.rs.
Features
| Target | API | List printers | List jobs | Print bytes and text files | Print PDF,images, etc... |
|---|---|---|---|---|---|
| Unix | cups | ✅ | ✅ | ✅ | ✅ |
| Windows | winspool | ✅ | ✅ | ✅ | 🤔** |
** On Windows this lib use RAW datatype to process printing. Expected output depends of printer firmware.
Examples
Get all available printers
let printers = get_printers;
// Vec<Printer>
Create print job of an byte array
printer.print;
// Result<(), &'static str>
Create print job of an file
printer.print_file;
// Result<(), &'static str>
Get a printer by name
let my_printer = get_printer_by_name;
// Option<Printer>
Get the default printer
let printer = get_default_printer;
// Option<Printer>
Simple compilation
use ;