3 ms·
Here's a semi-related question that maybe somebody can answer. Why is it that despite listening on TCP 9100, some printers will just print the source code when
by Evidlo 6y ago
Here's a semi-related question that maybe somebody can answer.
Why is it that despite listening on TCP 9100, some printers will just print the source code when you send them a PDF or Postscript file with netcat?
Is there some special PJL command to put it into Postscript mode? Are there any networked printers around nowadays that don't support Postscript?
- jagged-chisel 6y ago“...despite listening...” Yes, there’s a protocol behind that port. Just like there’s one behind port 22, 80, 443... you can’t just dump http to 443 and get a useable document in return.
- tonyedgecombe 6y agoActually that is exactly how the printers listened on port 9100. You open a connection and dump the raw print file. This "protocol" was introduced by HP with their JetDirect print servers.
- jolmg 6y ago> you can’t just dump http to 443 and get a useable document in return. Not on 443, but on 80 you basically would. You'd just have to skip the response headers.
- buckminster 6y agoA lot of printers, by default, function like an ancient teletype. They interpret incoming data as something like ASCII and print out the text. You need to send the correct escape sequence (i.e. a sequence of bytes starting with 0x1B) to switch into a more modern mode.
- jschwartzi 6y agoA lot of Postscript printers are configured to print source code when there’s a syntax error in the file. My 2017 HP laser printer has this as an optional feature.
- tonyedgecombe 6y agoA lot of printers default to PCL first which allows plain text printing. Some will auto detect the language but to be safe you would use PJL (Printer Job Language) to specify the print file format.
- tonyedgecombe 6y ago>Is there some special PJL command to put it into Postscript mode? @PJL ENTER LANGUAGE = POSTSCRIPT >Are there any networked printers around nowadays that don't support Postscript? Yes.
- jolmg 6y ago> Why is it that despite listening on TCP 9100, some printers will just print the source code when you send them a PDF or Postscript file with netcat? Not all printers interpret those languages on that port. For example, Zebra printers interpret ZPL there, and I think most Postscript would look like plain text to a ZPL interpreter. > Are there any networked printers around nowadays that don't support Postscript? I'd be somewhat surprised if most label printers and receipt printers accept Postscript. I wouldn't be surprised if there are more niche types of networked printers where it might not make sense to support Postscript.