{"id":45991479,"url":"https://github.com/talesluna/rust-printers","last_synced_at":"2026-02-28T20:42:51.281Z","repository":{"id":57780183,"uuid":"495376980","full_name":"talesluna/rust-printers","owner":"talesluna","description":"A rust library to printing APIs implementation for unix (cups) and windows (winspool).","archived":false,"fork":false,"pushed_at":"2026-02-25T23:13:48.000Z","size":200,"stargazers_count":96,"open_issues_count":0,"forks_count":36,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-02-26T01:39:09.125Z","etag":null,"topics":["cups","list-printers","print-file","printers","rust","rust-lang","rust-library","winspool"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/printers","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/talesluna.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-05-23T11:14:53.000Z","updated_at":"2026-02-25T23:13:52.000Z","dependencies_parsed_at":"2024-11-18T05:19:20.992Z","dependency_job_id":"5ac5a68d-da74-4d11-98ec-f4c9ba9f3e19","html_url":"https://github.com/talesluna/rust-printers","commit_stats":{"total_commits":17,"total_committers":1,"mean_commits":17.0,"dds":0.0,"last_synced_commit":"6cc0c5e77b2af2a5c451567c6255a11a5dc0f7a5"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/talesluna/rust-printers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talesluna%2Frust-printers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talesluna%2Frust-printers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talesluna%2Frust-printers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talesluna%2Frust-printers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/talesluna","download_url":"https://codeload.github.com/talesluna/rust-printers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/talesluna%2Frust-printers/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29951659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-28T18:42:55.706Z","status":"ssl_error","status_checked_at":"2026-02-28T18:42:48.811Z","response_time":90,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cups","list-printers","print-file","printers","rust","rust-lang","rust-library","winspool"],"created_at":"2026-02-28T20:42:50.825Z","updated_at":"2026-02-28T20:42:51.273Z","avatar_url":"https://github.com/talesluna.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Printers](https://crates.io/crates/printers): A printing APIs implementation for unix *(cups)* and windows *(winspool)*.\n\nProvides all system printers, create and manage print jobs.\n\n![Build and tests](https://img.shields.io/github/actions/workflow/status/talesluna/rust-printers/ci.yml?label=build%20%26%20tests)\n![Crates.io Version](https://img.shields.io/crates/v/printers)\n![Crates.io License](https://img.shields.io/crates/l/printers)\n![docs.rs](https://img.shields.io/docsrs/printers)\n![Crates.io Downloads (recent)](https://img.shields.io/crates/dr/printers)\n\n## Documentation\nSee the references in [docs.rs](https://docs.rs/printers).\n\n## 🛠️ Features\n\n| Feature                                                | Status |\n| :----------------------------------------------------- | :----: |\n| List available printers                                | ✅     |\n| List printer jobs                                      | ✅     |\n| Manage printer jobs (pause, resume, cancel, restart)   | ✅     |\n| Print plain text                                       | ✅     |\n| Print PDF, images etc... (*1)                          | ✅     |\n| Converters (Ghostscript)                               | ✅     |\n| DOCx / XLS / PPTx converter                            | ⏳     |\n| Converter pipeline (doc -\u003e pdf -\u003e ps)                  | ⏳     |\n\n\u003e *1 If necessary, you can raster the file using converters supported by the lib, such as Ghostscript. See the examples below.\n\n## 🔄 Ghostscript Converter\n\nThe Ghostscript converter allows you to raster or transform files (PDFs, PostScript, images) into different output formats before sending them to a printer. This is useful when a printer does not natively support a given file format, or when you need to control the output resolution and format.\n\n### How it works\n\nThe converter spawns Ghostscript as a child process, pipes the file content via stdin, and reads the converted output from stdout. This means it works efficiently without creating temporary files on disk.\n\n### Supported output devices\n\n| Convenience method                                       | Ghostscript device | Description               |\n| :------------------------------------------------------- | :----------------- | :------------------------ |\n| `GhostscriptConverterOptions::ps2write()`                | `ps2write`         | PostScript output         |\n| `GhostscriptConverterOptions::png16m()`                  | `png16m`           | 24-bit color PNG          |\n| `GhostscriptConverterOptions::pngmono()`                 | `pngmono`          | Monochrome PNG            |\n| `GhostscriptConverterOptions::tiffg4()`                  | `tiffg4`           | TIFF G4 fax encoding      |\n| `GhostscriptConverterOptions::from_device(\"...\")`        | any                | Custom Ghostscript device |\n\nYou can also configure the output DPI (default: 500) and a custom path to the Ghostscript executable via `GhostscriptConverterOptions`.\n\n### Host dependency required\n\nThe Ghostscript converter requires the Ghostscript executable to be installed on the host operating system. It is **not** bundled with this library. The library invokes `gs` on Unix (Linux/macOS) or `gswin64c.exe` on Windows as an external process. If Ghostscript is not installed or not in your PATH, the converter will return a `PrintersError`.\n\n**Installation by platform:**\n\n| Platform              | Install command                                                                                  | Executable used |\n| :-------------------- | :----------------------------------------------------------------------------------------------- | :-------------- |\n| Linux (Debian/Ubuntu) | `sudo apt-get install ghostscript`                                                               | `gs`            |\n| macOS                 | `brew install ghostscript`                                                                       | `gs`            |\n| Windows               | Install from [ghostscript.com](https://www.ghostscript.com/releases/gsdnld.html) and add to PATH | `gswin64c.exe`  |\n\nIf Ghostscript is installed in a non-standard location, you can specify the path via the `command` option:\n\n```rust\nlet options = GhostscriptConverterOptions {\n    command: Some(\"/usr/local/bin/gs\"),\n    dpi: Some(300),\n    device: Some(\"ps2write\"),\n};\n```\n\n## 👇 Examples\n\n**Get all available printers**\n\n```rust\nlet printers = get_printers();\n// Vec\u003cPrinter\u003e\n``` \n\n**Create print job of an byte array**\n\n```rust\nlet job_id = printer.print(\"42\".as_bytes(), PrinterJobOptions::none());\n// Result\u003cu64, PrintersError\u003e\n```\n\n**Create print job of an file**\n\n```rust\nlet job_id = printer.print_file(\"my_file/example/path.pdf\", PrinterJobOptions {\n    name: Some(\"My print job\"),\n    raw_properties: \u0026[\n        (\"copies\", \"2\"),\n        (\"document-format\", \"RAW\"),\n    ],\n    converter: Converter::Ghostscript(GhostscriptConverterOptions::ps2write()),\n});\n// Result\u003cu64, PrintersError\u003e\n```\n\n**Get a printer by name**\n\n```rust\nlet my_printer = get_printer_by_name(\"my_printer\");\n// Option\u003cPrinter\u003e\n```\n\n**Get the default printer**\n\n```rust\nlet printer = get_default_printer();\n// Option\u003cPrinter\u003e\n```\n\n**Manage state of printer job**\n\n```rust\n// Pause\nprinter.pause_job(123);\n\n// Resume\nprinter.resume_job(123);\n\n// Restart\nprinter.restart_job(123);\n\n// Cancel\nprinter.cancel_job(123)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalesluna%2Frust-printers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftalesluna%2Frust-printers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftalesluna%2Frust-printers/lists"}