473,569 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6263
"Adam Right" <ad**@right.com wrote in message news:e2******** ******@TK2MSFTN GP03.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.bewro te in message
news:Ot******** ******@TK2MSFTN GP03.phx.gbl...
"Adam Right" <ad**@right.com wrote in message
news:e2******** ******@TK2MSFTN GP03.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.com wrote in message
news:e2******** ******@TK2MSFTN GP03.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
2937
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) and submit data forms of various types like Sales Invoices etc. Once they create a document like a Sales Invoice, they need to print the document...
2
3697
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 necessary to do the job. I had to try... but FileOpen does not permit opening LPT1.
2
4074
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 have the printer print a line that relates to what the event was. From what I can see of the printer model in .Net, it's mostly document based. Is...
7
2471
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 on the right is not printed (leaving about 3/4 inch empty margin on the right side of the page). The left side starts about 1/4 inch in and prints...
1
2857
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 manually select the printer for each report, my question is..... Is printing to a dot matrix printer the same (as far as Access in concerned) as...
2
4214
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 PrintDocument, but don't know how to set up the page size to be only one label.
3
3667
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 somewhat familiar with using the commercially available labels but I don't know if I can print my custom designed labels. By custom designed I mean...
9
7822
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 size. one for student and other for fee clerk. while printing on dot-matrix, form get printed, but size is A4. My problem is * how to change size to...
1
5381
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 PrintPage property of the PrintDocument. PrintDocument document = new PrintDocument(); document.PrintPage += new...
0
7700
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7676
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5513
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.