Printing to port 9100 with PJL and Python
问题 I believe this code should work to print a PDF directly to most printers on port 9100. This source and this one among others seems to agree on the details. My printer wakes up and seems to "spool a job" for a moment, but then just goes quiet again. The socket code is very crude of course, but still.. Maybe it's just my particular printer *. Grateful if somebody could test this or point out any errors or improvements. import socket job = [ b'\x1b%-12345X@PJL JOB NAME = "My Print Job Name"\r\n'