473,398 Members | 2,389 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,398 software developers and data experts.

Print in text mode

I read some messages in the group about printing in text mode.
The PrintDocument class didn't solve my problem, because it prints in
graphic mode.
I have a matrix printer, and printing in text mode is too much
faster...

What options I have to print in text mode in C# ???

Thanks.

Junior.

May 22 '06 #1
1 2907
I was once created application (in .NET v1.1) using CreateFile() API to open
"LPT1" and pass the handle(System.IntPtr in v1.1,
Microsoft.Win32.SafeFileHandle in v2.0) to new FileStream(). Than you can
write strings to it with TextWriter object.

However, with this way you need to find out how to initialize the printer
for Text printing first. In my case I once have to open notepad and print a
few string first or it'll start printing garbage characters. (Use this as
backup plan if you're in urgent and cannot find out the following
information quickly)

For the escape sequence to be used to initalize printer, please refer to the
appendix of your printer's manual (not always available, through). Since the
sequence varies with brands and model, I cannot give you a general
instruction on how to do this.

Note that if you need to change the font name, font size, line spacing, page
feed, etc. You'll have to use escape sequence command too.

"osmarjunior" <os*********@gmail.com>
???????:11*********************@u72g2000cwu.google groups.com...
I read some messages in the group about printing in text mode.
The PrintDocument class didn't solve my problem, because it prints in
graphic mode.
I have a matrix printer, and printing in text mode is too much
faster...

What options I have to print in text mode in C# ???

Thanks.

Junior.

May 23 '06 #2

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

Similar topics

30
by: Martin Bless | last post by:
Why can't we have an additional 'print' statement, that behaves exactly like 'print' but doesn't insert that damn blank between two arguments? Could be called 'printn' or 'prin1' or 'prinn'...
14
by: Marcin Ciura | last post by:
Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version:...
4
by: Julie Siebel | last post by:
Apologies...I'm sure this has been asked before, but I can't seem to come up with the correct Google search terms. While my problem is with stylesheets, the errors are being caused by my...
8
by: geotso | last post by:
Hi I'm trying to hide from printing a specific element of a page but I don't know how (and if) I could. Here is an example of what I'm trying to do: <h1>Hidden in print mode</h1> <p>Also...
0
by: BlueSky | last post by:
Hi, I want to print in Landscape format from an aspx page (when ever the user chooses print from the browser or a print button on the form). I load aspx controls dynamically on the page. I used...
13
by: damonwischik | last post by:
I'd like to print out a unicode string. I'm running Python inside Emacs, which understands utf-8, so I want to force Python to send utf-8 to sys.stdout. From what I've googled, I think I need...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
0
by: praveenhathwar | last post by:
Hi, I have a flexgrid with few data. Now I want that to be print in DOS Mode (To be print on Notepad), Preview it for the user and prevent the user from modifying the data in it. Is there any...
2
by: dmorand | last post by:
When I try to print a 'print version' of my page it looks fine in IE 7, but when I print in IE 6 the margins are all screwed up. The page itself looks the same in both browsers, it's just when I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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,...
0
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...
0
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,...

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.