473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Printing with Dot Matrix Printer by C#?

Hi,

Anyone knows how to print with dot matrix printer ? I want to print text
with some formatting such as bold, underlined font, and landscape document
etc... How can i do this with C#? Thanks...
Dec 16 '06 #1
3 6219
"Adam Right" <ad**@right.comwrote in message news:e2**************@TK2MSFTNGP03.phx.gbl...
Hi,

Anyone knows how to print with dot matrix printer ? I want to print text with some
formatting such as bold, underlined font, and landscape document etc... How can i do this
with C#? Thanks...
One option is to bypass the spooler and printer driver, that means you have to open the raw
device (say lpt1:) using CreateFile (through PInvoke) and the System.IO classes to write
directly to the device, don't forget that you are in charge of all the initialization stuff
otherwise done by the driver.

Willy.
Dec 16 '06 #2
JR
You could attach it to a com port and use the SerialPort. No p/invoke.

The printer documentation will explain how to control the printer - fonts,
bold, etc.

JR

"Willy Denoyette [MVP]" <wi*************@telenet.bewrote in message
news:Ot**************@TK2MSFTNGP03.phx.gbl...
"Adam Right" <ad**@right.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
>Hi,

Anyone knows how to print with dot matrix printer ? I want to print text
with some formatting such as bold, underlined font, and landscape
document etc... How can i do this with C#? Thanks...

One option is to bypass the spooler and printer driver, that means you
have to open the raw device (say lpt1:) using CreateFile (through PInvoke)
and the System.IO classes to write directly to the device, don't forget
that you are in charge of all the initialization stuff otherwise done by
the driver.

Willy.


Dec 16 '06 #3
"Adam Right" <ad**@right.comwrote in message
news:e2**************@TK2MSFTNGP03.phx.gbl...
Hi,

Anyone knows how to print with dot matrix printer ? I want to print text
with some formatting such as bold, underlined font, and landscape document
etc... How can i do this with C#? Thanks...
Note that many dot-matrix printers are supported by a Windows driver, and
can be printed to in exactly the same way as any other printer. This
includes being able to print whatever font you want, with bold or
underlining, as well as choosing paper orientation.

Before you head off messing around with essentially reinventing a relatively
limited wheel, you might double-check to make sure there's no Windows
printer driver you can use for the printer you want to print on (and also
note that since early dot-matrix printers often shared a graphical command
language, you may even be able to use a generic printer driver that supports
the printer you have mind).

Pete
Dec 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Aditya | last post by:
Hi, I am working on a Web based Intranet application and one of the requirements of the project is to print to a dot matrix printer. The users access the application through a web browser (IE)...
2
by: Marc Champagne | last post by:
Hi folks, I wish to print on pre-printed continuous forms on a dot matrix printer. My initial intent was to access to printer directly (in raw mode, somehow) in order to send whatever is...
2
by: Ryan Gregg | last post by:
I'm working on a project where I need to be able to print a single line at a time to a dot matrix printer. Essentially we have a log printer and each time an event occurs on the system I need to...
7
by: DazedAndConfused | last post by:
I have a 8.5 x 11 landscape document with about 1/4 inch of space on the left and right where there is no print. The document displays perfect in print preview, but when I print it, about 1/2 inch...
1
by: Paul H | last post by:
I am developing a database where some reports need to print to a laser and some need to print to a dot matrix printer. I am not interested in how to do this programmatically, I will let the user...
2
by: Kevin | last post by:
In my VB2005 Windows Forms program I want to be able to click a button and have my Dot Matrix printer print one 15/16 x 3 1/2 address label from continuous forms. I'm trying to use a...
3
by: Rich Kayton | last post by:
I have an application that is currently a DBASE/Clipper application. We print out a variety of custom labels on Epson DOT matrix printers. I would like to be able to print these labels. I am...
9
by: Gurbinder Kaur | last post by:
Hi, i have made a project for printing fee receipt. Using Windows-XP, VBasic 6.0 & Ms-Access-97. i have designed a form for prinring receipts. m paper-size is 5x10. Two copies of bills in this...
1
by: amcgary | last post by:
Hello, I am trying to print a System.Drawing.Printing.PrintDocument to a dot matrix printer using C# .NET. I have created an instance of the PrintDocument and create a event handler for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.