{"id":19100215,"url":"https://github.com/artiebits/pdf-to-printer","last_synced_at":"2026-02-19T11:03:32.805Z","repository":{"id":35015018,"uuid":"196753133","full_name":"artiebits/pdf-to-printer","owner":"artiebits","description":"Print PDFs and images from Node.js and Electron","archived":false,"fork":false,"pushed_at":"2026-02-07T08:06:18.000Z","size":34472,"stargazers_count":479,"open_issues_count":1,"forks_count":149,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-02-07T17:55:53.022Z","etag":null,"topics":["electron","jpeg","nodejs","pdf","pdf-printer","png","printer","rollo-printer","silent-printing","windows","zebra-printer"],"latest_commit_sha":null,"homepage":"https://artiebits.com","language":"TypeScript","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/artiebits.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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},"funding":{"github":"artiebits","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"buy_me_a_coffee":"artiebits"}},"created_at":"2019-07-13T18:20:35.000Z","updated_at":"2026-02-07T08:06:21.000Z","dependencies_parsed_at":"2024-06-18T13:45:25.086Z","dependency_job_id":"92d7b13e-ce8c-47ff-a7f1-8cb6257cd256","html_url":"https://github.com/artiebits/pdf-to-printer","commit_stats":{"total_commits":404,"total_committers":23,"mean_commits":"17.565217391304348","dds":0.6534653465346535,"last_synced_commit":"b1e1e0776634489d6ba6bc28072e2325510880f0"},"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/artiebits/pdf-to-printer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artiebits%2Fpdf-to-printer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artiebits%2Fpdf-to-printer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artiebits%2Fpdf-to-printer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artiebits%2Fpdf-to-printer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artiebits","download_url":"https://codeload.github.com/artiebits/pdf-to-printer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artiebits%2Fpdf-to-printer/sbom","scorecard":{"id":209494,"data":{"date":"2025-08-11","repo":{"name":"github.com/artiebits/pdf-to-printer","commit":"b1e1e0776634489d6ba6bc28072e2325510880f0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":2,"reason":"Found 1/5 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/release-please.yml:1","Warn: no topLevel permission defined: .github/workflows/stale.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":9,"reason":"binaries present in source code","details":["Warn: binary detected: src/SumatraPDF-3.4.6-32.exe:1"],"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/release-please.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/artiebits/pdf-to-printer/release-please.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/artiebits/pdf-to-printer/stale.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"10 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-76p7-773f-r4q5","Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986","Warn: Project is vulnerable to: GHSA-f9xv-q969-pqx4"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T00:29:25.210Z","repository_id":35015018,"created_at":"2025-08-17T00:29:25.210Z","updated_at":"2025-08-17T00:29:25.210Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29611002,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-19T10:52:55.328Z","status":"ssl_error","status_checked_at":"2026-02-19T10:52:26.323Z","response_time":117,"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":["electron","jpeg","nodejs","pdf","pdf-printer","png","printer","rollo-printer","silent-printing","windows","zebra-printer"],"created_at":"2024-11-09T03:52:34.798Z","updated_at":"2026-02-19T11:03:32.799Z","avatar_url":"https://github.com/artiebits.png","language":"TypeScript","funding_links":["https://github.com/sponsors/artiebits","https://buymeacoffee.com/artiebits","https://www.buymeacoffee.com/artiebits"],"categories":["windows","electron"],"sub_categories":[],"readme":"# PDF to Printer\n\n[![codecov](https://codecov.io/gh/artiebits/pdf-to-printer/branch/master/graph/badge.svg)](https://codecov.io/gh/artiebits/pdf-to-printer)\n![npm](https://img.shields.io/npm/dw/pdf-to-printer)\n\nA powerful Node.js and Electron utility for printing PDFs and images to Windows printers.\n\n## Features\n\n- **Print PDFs and images** to any Windows printer\n- **Precise control** over printing options (pages, orientation, paper size, etc.)\n- **Label printer support** (Rollo, Zebra, and more)\n- **Printer discovery** - list all available printers\n- **Fast and reliable** using SumatraPDF engine\n- **TypeScript support** with full type definitions\n- **Windows only** - for Unix-like systems, see [unix-print](https://github.com/artiebits/unix-print)\n\n## Installation\n\n```bash\nnpm install pdf-to-printer\n# or\nyarn add pdf-to-printer\n```\n\n## Quick Start\n\n```typescript\nimport { print, getPrinters, getDefaultPrinter } from \"pdf-to-printer\";\n\n// Print to default printer\nawait print(\"document.pdf\");\n\n// Print with options\nawait print(\"document.pdf\", {\n  printer: \"HP LaserJet\",\n  pages: \"1-3\",\n  copies: 2,\n  paperSize: \"A4\",\n});\n\n// List available printers\nconst printers = await getPrinters();\nconsole.log(printers);\n\n// Get default printer\nconst defaultPrinter = await getDefaultPrinter();\nconsole.log(defaultPrinter?.name);\n```\n\n## Support This Project\n\nIf you rely on this package, please consider supporting it. Maintaining an open source project takes time and your support would be greatly appreciated.\n\n\u003ca href=\"https://www.buymeacoffee.com/artiebits\" target=\"_blank\"\u003e\u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height: 50px !important;width: 207px !important;\" \u003e\u003c/a\u003e\n\n## API Reference\n\n### `print(pdf, options?)`\n\nPrints a PDF file to a printer.\n\n**Parameters:**\n\n- `pdf` (string): Path to the PDF file to print\n- `options` (PrintOptions, optional): Printing configuration options\n\n**Returns:** `Promise\u003cvoid\u003e`\n\n**Throws:** `Error` if the PDF file doesn't exist, the operating system is not supported, or printing fails\n\n#### PrintOptions\n\n| Option           | Type                                                     | Description                                                  |\n| ---------------- | -------------------------------------------------------- | ------------------------------------------------------------ |\n| `printer`        | `string`                                                 | Name of the printer to use (default: system default printer) |\n| `pages`          | `string`                                                 | Pages to print (e.g., \"1-3,5\" or \"1,3,5\")                    |\n| `subset`         | `string`                                                 | Print only odd or even pages (valid: \"odd\", \"even\")          |\n| `orientation`    | `string`                                                 | Page orientation (valid: \"portrait\", \"landscape\")            |\n| `scale`          | `string`                                                 | Content scaling (valid: \"noscale\", \"shrink\", \"fit\")          |\n| `monochrome`     | `boolean`                                                | Print in black and white                                     |\n| `side`           | `string`                                                 | Duplex printing (valid: \"duplex\", \"duplexshort\", \"duplexlong\", \"simplex\") |\n| `bin`            | `string`                                                 | Paper tray/bin to use (number or name)                       |\n| `paperSize`      | `string`                                                 | Paper size (e.g., \"A4\", \"letter\", \"legal\")                   |\n| `silent`         | `boolean`                                                | Suppress error messages                                      |\n| `printDialog`    | `boolean`                                                | Show print dialog instead of printing directly               |\n| `sumatraPdfPath` | `string`                                                 | Custom path to SumatraPDF executable                         |\n| `copies`         | `number`                                                 | Number of copies to print (default: 1)                       |\n| `paperkind`      | `number`                                                 | Allow to choose custom paper size by kind                    |\n\n### `getPrinters()`\n\nGets a list of all available printers on the system.\n\n**Returns:** `Promise\u003cPrinter[]\u003e`\n\n**Throws:** `Error` if the operating system is not supported or if the command fails\n\n**Example:**\n\n```typescript\nimport { getPrinters } from \"pdf-to-printer\";\n\nconst printers = await getPrinters();\nconsole.log(printers);\n// [\n//   { deviceId: \"HP_LaserJet\", name: \"HP LaserJet Pro\", paperSizes: [\"A4\", \"Letter\"] },\n//   { deviceId: \"Canon_Pixma\", name: \"Canon PIXMA\", paperSizes: [\"A4\", \"A3\"] }\n// ]\n```\n\n### `getDefaultPrinter()`\n\nGets the default printer information.\n\n**Returns:** `Promise\u003cPrinter | null\u003e`\n\n**Throws:** `Error` if the operating system is not supported or if the command fails\n\n**Example:**\n\n```typescript\nimport { getDefaultPrinter } from \"pdf-to-printer\";\n\nconst defaultPrinter = await getDefaultPrinter();\nif (defaultPrinter) {\n  console.log(`Default printer: ${defaultPrinter.name}`);\n  console.log(`Device ID: ${defaultPrinter.deviceId}`);\n  console.log(`Paper sizes: ${defaultPrinter.paperSizes.join(\", \")}`);\n} else {\n  console.log(\"No default printer set\");\n}\n```\n\n### `Printer` Type\n\n```typescript\ntype Printer = {\n  deviceId: string; // Unique identifier for the printer device\n  name: string; // Human-readable name of the printer\n  paperSizes: string[]; // Array of supported paper sizes\n};\n```\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartiebits%2Fpdf-to-printer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartiebits%2Fpdf-to-printer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartiebits%2Fpdf-to-printer/lists"}