DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Pascal and Delphi (http://www.daniweb.com/forums/forum124.html)
-   -   help needed to print from turbo pascal (http://www.daniweb.com/forums/thread21883.html)

mpx10 Apr 13th, 2005 5:36 pm
help needed to print from turbo pascal
 
im still struggling to print an invoice that i have made in pascal to a usb port printer. any help please. i have tried using various inbuilt function but have had no luck probably because im coding it wrong. thanks in advance

Jackrabbit Apr 13th, 2005 6:10 pm
Re: help needed to print from turbo pascal
 
Quote:

Originally Posted by mpx10
im still struggling to print an invoice that i have made in pascal to a usb port printer. any help please. i have tried using various inbuilt function but have had no luck probably because im coding it wrong. thanks in advance

This works in Delphi 7 / WinXP:

program ptest;

{$APPTYPE CONSOLE}

uses
  SysUtils,
  Printers;

begin
  Printer.BeginDoc;
  Printer.Canvas.TextOut(200,200,'Hello, world!');
  printer.EndDoc;
end.

I don't have/use Turbo Pascal so can't say if it works there as well...

mpx10 Apr 14th, 2005 2:50 pm
Re: help needed to print from turbo pascal
 
tried it in turbo pascal but it doesnt work its says cannot find file 'sysutils.tpu' thanks for your help though!! any other ideas please.

Jackrabbit Apr 15th, 2005 11:45 am
Re: help needed to print from turbo pascal
 
About the only thing I could suggest would be to write the information to a file the use the Exec function (in DOS unit -- at least it is in Free Pascal) to launch NotePad or WordPad and print from there.

If you're running Windows, you could also move up to Delphi. I've also had pretty good luck with Lazarus (although I haven't used it much). It's an open source IDE for Free Pascal similar to Delphi.


All times are GMT -4. The time now is 3:32 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC