DOS Printing refers to writing the contents of the print to a text document along with some of the commands that the printer understands,some are given below.For example,
StreamWriter objStream;
objStream = File.CreateText("\\Bill.txt");
objStream.WriteLine(Convert.ToChar(14)+"Heading of Bill in Double Width"+Convert.ToChar(18));
String strCmd = Environment.GetEnvironmentVariable("COMSPEC");
string strPrinterName = ">prn";
Process.Start(strCmd, "/C type \\Bill.txt > " +
strPrinterName);
The following are some of the commands that are self explanatory:
prnALIGHN_LEFT = Chr(27) & Chr(97) & Chr(0)
prnALIGHN_CENTER = Chr(27) & Chr(97) & Chr(1)
prnALIGHN_RIGHT = Chr(27) & Chr(97) & Chr(2)
prnALIGHN_JUSTIFIED = Chr(27) & Chr(97) & Chr(3)
prnCONDENSED_MODE = Chr(15)
prnCONDENSED_MODE_CANCEL = Chr(20)
prnDOUBLE_WIDTH = Chr(14)
prnDOUBLE_WIDTH_CANCEL = Chr(18)
prnDOUBLE_WIDTH_CONDENSED_MODE = Chr(15) & Chr(14)
prnDOUBLE_WIDTH_CANCEL_SAME_LINE = Chr(20)
prnMODE_GRAPHICS = Chr(27) & "t" & "1"
prnFONT_DRAFT = Chr(18)
prnDOUBLE_STRIKE_MODE = Chr(27) & Chr(71)
prnDOUBLE_STRIKE_MODE_CANCEL = Chr(27) & Chr(72)
prn12CPI = Chr(27) & Chr(77)
prn10CPI = Chr(27) & Chr(80)
prnPAGE_LENGTH = Chr(27) & Chr(67)
prnPAGE_EJECT = Chr(12)