6 stable releases
Uses new Rust 2024
| 2.2.1 | Nov 19, 2025 |
|---|---|
| 2.2.0 | Jun 29, 2025 |
| 2.1.3 | May 1, 2025 |
| 2.1.2 | Jan 18, 2025 |
| 1.0.2 |
|
#37 in Windows APIs
698 downloads per month
Used in rmcp-printers
54KB
1.5K
SLoC
Printers: A printing APIs implementation for unix (cups) and windows (winspool).
Provides all system printers, create and manage 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 by default. Expected output depends of printer firmware.
👇 Examples
Get all available printers
let printers = get_printers();
// Vec<Printer>
Create print job of an byte array
let job_id = printer.print("42".as_bytes(), PrinterJobOptions::none());
// Result<u64, &'static str>
Create print job of an file
let job_id = printer.print_file("my_file/example/path.txt", PrinterJobOptions {
name: Some("My print job"),
raw_properties: &[
("copies", "2"),
("document-format", "XPS"),
],
});
// Result<u64, &'static str>
Get a printer by name
let my_printer = get_printer_by_name("my_printer");
// Option<Printer>
Get the default printer
let printer = get_default_printer();
// Option<Printer>
Manage state of printer job
// Pause
printer.pause_job(123);
// Resume
printer.resume_job(123);
// Restart
printer.restart_job(123);
// Cancel
printer.cancel_job(123)
⏳ Future
- GhostScript option conversion support
Dependencies
~42KB