I could suggest one thing to make your life easier, install a generic text printer driver (this comes as standard) and set that to the LPT1 port. Then you can simply open 'LPT1' and send escape code sequences to specify font type (bold/italic), emphasized, font pitch etc. I don't know if the resources would be required. But I would imagine it would be something like this:
System.IO.StreamWriter sr = new System.IO.StreamWriter(@"\.LPT1");
sr.Write(0x1b); sr.Write('k'); sr.Write('1'); sr.Write("Hello"); // print in Sans Serif
sr.WriteLine();
sr.Flush();
sr.Close();
Resources:
- Printing to a zebra printer using VB.NET (This can be easily translated to C# or compile it to a DLL and reference it in your C# project)
- An article on MSDN on how to interface to LPT1
- Here is an extensive list of info pertaining to Parallel Port. (look further down near the section titled 'Programming Tools for Port I/O and Interrupts'), discussing the usage of this DLL called inpout32.
- Here is another article on MSDN that shows how to do raw printing.
Edited @ 2017-07-12: Updated the Parallel Port link to use the Wayback Archive Machine.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…