News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

printing directly from a file without open notepad

Started by lucy67, April 07, 2005, 05:12:11 PM

Previous topic - Next topic

lucy67

Hello everybody
How can i print the text of a file that i created without openning the file in notepad?. I did a program that takes input from keyboard and output it in a file but in order to print the context of the file i have to open it using notepad. Does someone know how to make a direct call to the printer?
Thank you so much.

farrier

lucy67,

What kind of printer are you using?  If you are using a Dot Matrix or OLD laser or ink jet you can send the characters directly to the printer, and they will be printed in the default font.  If you're using a modern printer, most will not let you send raw characters to the printer.  Windows printers don't print characters, they print dots which end up making the image you expect.  That's what notepad does for you.

A little more info and maybe I can help you!

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

pbrennick

lucy67,
You should be able to create a buffer that you can also store the characters that you are writing to a file.  Once the buffer has been built, you can then use one of many print subroutines that are available (you can get this from my editor or Ewayne's, for example, there are others) to print the contents of the buffer.  All of this can be done as a background process (no editor showing, I mean).

Paul

doomsday

ShellExec( "copy foo.txt prn")  ??

regards,
-Brent

pbrennick

It figures, the simplest way never occurs to me. <g>

Thanks, Brent

Paul