{"id":18098504,"url":"https://github.com/danieloneill/jsicupsprint","last_synced_at":"2025-08-31T10:40:12.351Z","repository":{"id":89578087,"uuid":"186317987","full_name":"danieloneill/jsicupsprint","owner":"danieloneill","description":"A very simple JSI module to print an image/PS/PDF in Base64 encoding via CUPS","archived":false,"fork":false,"pushed_at":"2019-05-13T05:03:46.000Z","size":285,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T04:17:50.155Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/danieloneill.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-05-13T00:13:22.000Z","updated_at":"2019-05-13T05:03:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"035dc7b1-0ea9-46d1-a78f-993f86f477ea","html_url":"https://github.com/danieloneill/jsicupsprint","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/danieloneill/jsicupsprint","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fjsicupsprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fjsicupsprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fjsicupsprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fjsicupsprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danieloneill","download_url":"https://codeload.github.com/danieloneill/jsicupsprint/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danieloneill%2Fjsicupsprint/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272971417,"owners_count":25024093,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-31T20:11:30.310Z","updated_at":"2025-08-31T10:40:12.327Z","avatar_url":"https://github.com/danieloneill.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jsicupsprint\nA very simple JSI module to print an image/PS/PDF in Base64 encoding via CUPS\n\nYou'll need the CUPS headers and libraries and junk, GraphicsMagick libraries and headers and whatever, and JSI.\n\nIf you don't know what CUPS or JSI are, this isn't for you.\n\nYou can edit the Makefile to point it to your jsish location.\n\nOnce built, copy the **cups.so** file to **/usr/local/lib/jsi/cups.so**\n\nYou may need to create that directory.\n\nUsing it is as simple as pie:\n\n```\nrequire('cups');\nvar b64content = File.read('test.b64'); // \u003c- this is base64 encoded. you can use a PNG, JPG, PDF, whatever GraphicsMagick can read.\ncups.print('My Printer', b64content, 203, 719);\n```\n\nThe parameters are: __[printer name], [base64 encoded content], [resolution in dpi], [page width in mm]__\n\nI know.. I know... dots per inch, width in mm, but that's how the Citizen CT-S310 I use is specced, so that's how I wrote it.\n\nThis doesn't ask for page height because it's made to print to a thermal printer. You know, a receipt printer. For a store, see?\n\nDon't like it?! Well... hack the code. It's super simple. The glue is in *cups.jsc* and the meat is in *cupsinc.c*. Dogspeed.\n\nWhat else does this pile do? Well, get a list of printers and whatever:\n```\nrequire('cups');\nvar myarray = cups.printerlist();\n```\n\nCool, but let's figure out the dimensions of thin wooden slices this machine is capable of spraying crushed insect juice onto:\n```\nvar details = cups.printerinfo('My Printer');\n```\n\nAnd ... that's about all it can do.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fjsicupsprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanieloneill%2Fjsicupsprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanieloneill%2Fjsicupsprint/lists"}