{"id":14960933,"url":"https://github.com/gimchuang/unityprintingtool","last_synced_at":"2025-10-24T20:30:41.039Z","repository":{"id":116766224,"uuid":"164979678","full_name":"GimChuang/UnityPrintingTool","owner":"GimChuang","description":"Simple scripts to control printers in Unity. 🖨","archived":false,"fork":false,"pushed_at":"2019-07-02T16:19:46.000Z","size":43,"stargazers_count":24,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T03:54:10.894Z","etag":null,"topics":["interactive","printer","printing","unity","unity-scripts","unity3d","unity3d-plugin"],"latest_commit_sha":null,"homepage":"","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/GimChuang.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-01-10T03:04:16.000Z","updated_at":"2024-10-31T06:30:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"81a1fea1-b129-40af-9e6f-6eb6ffb1cbc2","html_url":"https://github.com/GimChuang/UnityPrintingTool","commit_stats":{"total_commits":18,"total_committers":2,"mean_commits":9.0,"dds":0.2222222222222222,"last_synced_commit":"99ef5e9c8c7c72689f4999016a57f371428cdf85"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GimChuang%2FUnityPrintingTool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GimChuang%2FUnityPrintingTool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GimChuang%2FUnityPrintingTool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GimChuang%2FUnityPrintingTool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GimChuang","download_url":"https://codeload.github.com/GimChuang/UnityPrintingTool/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238030288,"owners_count":19404859,"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","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":["interactive","printer","printing","unity","unity-scripts","unity3d","unity3d-plugin"],"created_at":"2024-09-24T13:23:28.696Z","updated_at":"2025-10-24T20:30:40.667Z","avatar_url":"https://github.com/GimChuang.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnityPrintingTool\nSimple scripts to control printers with Unity. 🖨\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://media.giphy.com/media/vKzZQTj2BoCAw/giphy.gif\"\u003e\n\u003cbr\u003e\u003cb\u003e( just an impatient printer user from \u003ca href=\"https://media.giphy.com/media/vKzZQTj2BoCAw/giphy.gif\"\u003eGiphy\u003c/a\u003e )\u003c/b\u003e\n\u003c/p\u003e\n\nHow to Use\n---\n- Add **PrintTool.cs** to a gameobject in your scene.\n- In the inspector, type in the name of your printer (you can find it from Contol Panel - Devices and Printers)\n- (Optional) Type in the interval (in seconds). This will be used to check if the printing is done.\n- Then you can get access to the **PrintTool** class and call methods as mentioned below. Also there is an example scene **Test_PrintingTool.unity** in this project.\n\nScripting Interface\n---\n`CmdPrintThreaded(string _filePath)` asks for path of the file which you want to print. It opens cmd.exe and calls `rundll32 C:\\WINDOWS\\system32\\shimgvw.dll,ImageView_PrintTo \"c:\\MyDir\\MyPicture.png\" \"My Printer\"` to print your file!\n(e.g. rundll32 C:\\WINDOWS\\system32\\shimgvw.dll,ImageView_PrintTo \"C:\\Users\\Gim\\Desktop\\Test.png\" \"Canon TS8100 series\")\n\n`StartCheckIsPrintingDone()` starts a coroutine. It opens cmd.exe, calls [prnjobs.vbs -l](http://www.windowscommandline.com/prnjobs-vbs/) and checks the number of print jobs. The coroutine does this check every `interval_checkIsPrintingDone` seconds. If the print job count becomes bigger than 0 and returns back to 0 again, we assume the print job is done and the coroutine will stop.\n\n**You should adjust the check interval, or figure out another appropriate way for you to check if the printing is done because every printer's performance and behavior vary. Of course if you have a better idea please share it :)**\n\nNote\n---\nOnly tested on Windows 10.\n\nTo do\n---\nImplement threading.\n\nReference\n---\n[How to get the output of a System.Diagnostics.Process?](https://stackoverflow.com/questions/1390559/how-to-get-the-output-of-a-system-diagnostics-process)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimchuang%2Funityprintingtool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgimchuang%2Funityprintingtool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimchuang%2Funityprintingtool/lists"}