Problem : How to send PJL or PCL Command to network printer in c#

Problem : How to send PJL or PCL Command to network printer in c#

How to print Test Page using PJL Command in C#?. Could tell me some steps to connect network printer and how to send PJL Command to network printer for finding the document name and current printed page in c#?

Solution : How to send PJL or PCL Command to network printer in c#

Many modern LaserJet printers (except, presumably,  for the cheap ‘host-based’ ones) will probably support the PJL DMINFO mechanism, which enables Printer Management Language (PML) commands to be sent to the device  and (in some cases) replies to be read.

An example, which causes some printers (like the LJ4200 and CLJ4700) to print configuration page(s), is:

\x1B%-12345X@PJL DMINFO ASCIIHEX = “04000401010502040103”\x0D\x0A\x1B%-12345X

Another example, which causes some printers to print PCL Typeface List page(s), is:

\x1B%-12345X@PJL DMINFO ASCIIHEX = “040004010105020402015E”\x0D\x0A\x1B%-12345X

I’ve attached the above within some binary files (given .TXT extensions to allow them to be posted).

It’s not easy getting details about the DMINFO strings; they are encapsulated PML commands (again, difficult to get much information on PML), where the subject (OID) of some of the commands depends on a knowledge of the (different?) MIBs supported by different models of printer.

I have no idea if there is any way in which this mechanism can be used to request information regarding the current job, and its progress.