Board index » delphi » Printing Text

Printing Text

I want to keep a physical log.  Just send three or four lines to a printer
each time something happens in my program.  I am currently using the
following method :

AssignPrn(PrintMsg);
Rewrite(PrintMsg);
Writeln(PrintMsg, ('Some Text'));
Writeln(PrintMsg, ('Some More Text'));
System.CloseFile(PrintMsg);

After Closing the printer object, the printer goes to the top of the next
page.  Is there any way to stop this.

Thanks in advance

Glenn Jones

 

Re:Printing Text


Quote
Glenn Jones wrote:

> I want to keep a physical log.  Just send three or four lines to a printer
> each time something happens in my program.  I am currently using the
> following method :

> AssignPrn(PrintMsg);
> Rewrite(PrintMsg);
> Writeln(PrintMsg, ('Some Text'));
> Writeln(PrintMsg, ('Some More Text'));
> System.CloseFile(PrintMsg);

> After Closing the printer object, the printer goes to the top of the next
> page.  Is there any way to stop this.

> Thanks in advance

> Glenn Jones

This is driver dependent. When you close the print file, a page
is ejected to close the print job.

--
Joe C. Hecht
Borland Delphi Developer Support Group
http://www.borland.com

Re:Printing Text


On 26 Feb 1997 20:59:31 GMT, "Glenn Jones" <g...@logicworld.com.au>
wrote:

Bad luck Glenn. You have to change the papersize of your printer. To
do this the easy way, get a copy of the component EDSPrint. I seem to
remeber the URL to be http://www.onedomain.com.

Quote
>I want to keep a physical log.  Just send three or four lines to a printer
>each time something happens in my program.  I am currently using the
>following method :

>AssignPrn(PrintMsg);
>Rewrite(PrintMsg);
>Writeln(PrintMsg, ('Some Text'));
>Writeln(PrintMsg, ('Some More Text'));
>System.CloseFile(PrintMsg);

>After Closing the printer object, the printer goes to the top of the next
>page.  Is there any way to stop this.

>Thanks in advance

>Glenn Jones

Re:Printing Text


Glenn,

You might want to consider using the following technique:

AssignFile( PrnFile : 'LPT1' );
WriteLn( PrnFile, YourTextStr );
CloseFile( PrnFile );

This will let you send text to the printer just like in the
days of DOS.  Sounds like that is what you want to do.

Quote
Glenn Jones wrote:
>I want to keep a physical log.  Just send three or four lines to a printer
>each time something happens in my program.  I am currently using the
>following method :

>AssignPrn(PrintMsg);
>Rewrite(PrintMsg);
>Writeln(PrintMsg, ('Some Text'));
>Writeln(PrintMsg, ('Some More Text'));
>System.CloseFile(PrintMsg);

>After Closing the printer object, the printer goes to the top of the next
>page.  Is there any way to stop this.

>Thanks in advance

>Glenn Jones

Other Threads