├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── index.js ├── ipp-printer.gif ├── package.json └── scripts └── osx.sh /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - '5' 4 | - '4' 5 | - '0.12' 6 | - '0.10' 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Thomas Watson Steen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # printbin 2 | 3 | Print anything to [printb.in](http://printb.in) - totally not safe btw! 4 | 5 | [![Build status](https://travis-ci.org/watson/printbin.svg?branch=master)](https://travis-ci.org/watson/printbin) 6 | [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) 7 | 8 | ## Installation 9 | 10 | ### OS X 11 | 12 | To install the printbin printer on OS X, simply run the following 13 | command from your terminal: 14 | 15 | ``` 16 | curl -s https://raw.githubusercontent.com/watson/printbin/master/scripts/osx.sh | sh 17 | ``` 18 | 19 | #### Alternative installation 20 | 21 | You can also install the printbin printer as a Bonjour printer. This 22 | requires that the printer is advertised on your local network. To do 23 | this, simply follow these steps: 24 | 25 | Install the printbin module globally: 26 | 27 | ``` 28 | npm install printbin -g 29 | ``` 30 | 31 | Start the printbin bonjour daemon: 32 | 33 | ``` 34 | printbin 35 | ``` 36 | 37 | Find and install the printbin printer: 38 | 39 | ![ipp-printer](https://raw.githubusercontent.com/watson/printbin/master/ipp-printer.gif) 40 | 41 | 42 | ### Windows 43 | 44 | Windows doesn't support Bonjour/Zeroconf by default, so for now just 45 | follow this guide to add the printer manually: 46 | http://www.zedt.eu/tech/windows/installing-an-ipp-printer-in-windows-10/ 47 | 48 | The printer URL is: 49 | 50 | ``` 51 | ipp://ipp.printb.in:80 52 | ``` 53 | 54 | ## Links 55 | 56 | - [printb.in repo](https://github.com/watson/printb.in) - The source code for the [printb.in](http://printb.in) website 57 | - [printbin-printer repo](https://github.com/watson/printbin-printer) - The source code for the printbin print server 58 | 59 | ## License 60 | 61 | MIT 62 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 'use strict' 3 | 4 | console.log('Now advertising the printbin printer on your local network.') 5 | 6 | require('bonjour')().tcp.publish({ type: 'ipp', host: 'ipp.printb.in', port: 80, name: 'printbin' }) 7 | -------------------------------------------------------------------------------- /ipp-printer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/watson/printbin/0c242a0795b9311889f88d142ed4f2880e15b931/ipp-printer.gif -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "printbin", 3 | "version": "1.0.3", 4 | "description": "A network printer for printing ot http://printb.in", 5 | "bin": "index.js", 6 | "dependencies": { 7 | "bonjour": "^2.0.0" 8 | }, 9 | "devDependencies": { 10 | "standard": "^5.4.1" 11 | }, 12 | "scripts": { 13 | "test": "standard" 14 | }, 15 | "repository": { 16 | "type": "git", 17 | "url": "git+https://github.com/watson/printbin.git" 18 | }, 19 | "keywords": [ 20 | "ipp", 21 | "printer", 22 | "print", 23 | "printing", 24 | "network", 25 | "bonjour", 26 | "zeroconf" 27 | ], 28 | "author": "Thomas Watson Steen (https://twitter.com/wa7son)", 29 | "license": "MIT", 30 | "bugs": { 31 | "url": "https://github.com/watson/printbin/issues" 32 | }, 33 | "homepage": "https://github.com/watson/printbin#readme", 34 | "coordinates": [ 35 | 55.6878045, 36 | 12.595432 37 | ] 38 | } 39 | -------------------------------------------------------------------------------- /scripts/osx.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | install () { 4 | lpstat -p | grep printbin > /dev/null 5 | 6 | rc=$?; if [[ $rc = 0 ]]; then 7 | echo printbin printer already added - aborting... 8 | exit 1 9 | else 10 | echo Adding printbin printer... 11 | lpadmin -p printbin -E -v ipp://ipp.printb.in:80 -P /System/Library/Frameworks/ApplicationServices.framework/Frameworks/PrintCore.framework/Resources/Generic.ppd -o printer-is-shared=false 12 | rc=$?; if [[ $rc = 0 ]]; then 13 | echo printbin printer have been successfully added to OS X 14 | exit 0 15 | else 16 | echo printbin printer could not be added 17 | exit 1 18 | fi 19 | fi 20 | } 21 | 22 | install 23 | --------------------------------------------------------------------------------