4 ms·
Fun With C# and HP Laserjets
- henning 16y agoBoy it's a bummer when people post code online without attaching a license to it.
- jrockway 16y agoYeah, writing 1 line of text to a TCP connection is pretty hard, so if you can't use this code freely, your app is ruined...
- chopsueyar 16y agoI found this written in Ruby several years ago. My two favorites were, "INSERT COIN" and "ADD WATER". Of course, this is only really effective when large groups use the same printer. It was mentioned somewhere as an IT prank for April Fools day.
- chopsueyar 16y agoIt was in the comments section... #!/usr/bin/env ruby # Simple HP Printer Hacker # Written in Ruby by Erik Gregg # 6/9/06 # Status Usage: hp-message.rb <host> status # Message Usage: hp-message.rb <host> message "<message>" require 'net/telnet' begin if ARGV[0].nil? puts "Read the script. Status Usage: hp-message.rb <host> status Message Usage: hp-message.rb <host> message \"<message>\"" exit end host = Net::Telnet::new("Host" => ARGV[0], "Port" => 9100, "Timeout" => 5, "Prompt" => /\b/n) if ARGV[1] == "status" host.cmd("@PJL INFO STATUS") { |c| print c } elsif ARGV[1] == "message" host.cmd("@PJL RDYMSG DISPLAY=\""+ARGV[2]+"\"") else puts "Oh Cmon. Look at the syntax inside me." exit end host.close rescue Timeout::Error puts "Time to go now!" exit 1 end
- jrockway 16y agoSigh, it's "OUT OF WATER", not "ADD WATER". Only very new printers tell you how to resolve the problem ("Add Letter paper to tray 1"); old printers just tell you what the problem is. ("PC LOAD LETTER? What the fuck does that mean?") And for the OP, it's "INSERT COIN" not "INSERT QUARTER".
- joezydeco 16y agoHey, give 'em a break. He's probably too young to have ever seen a real arcade game.
- graywh 16y agoAnd I've seen one written in Perl that does the current weather. EDIT: http://miscellany.kovaya.com/2007/10/get-weather-on-your-hp-4200.html http://miscellany.kovaya.com/2007/10/get-weather-on-your-hp-...
- spuz 16y agoThis prank was also on TDWTF and I think my favourite message was "OUT OF CHEESE!"
- joe_bleau 16y agoI did this years ago with an HP-48 calculator (serial port connected to laserjet): not only did I fool with the LCD panel, I generated postscript and printed, too. Here at work I've found that many of the newer all-in-one laser photocopy/scan/print machines support this HP PJL feature. I drive it from a cron job to give a countdown to major events (trade shows, holidays, etc.) The best part is when the copier dude comes in to service the machine: "how does the copier know when your trade show is?"