Help..(TPW Printing ) 
Author Message
 Help..(TPW Printing )

Quote:
>I'm using Turbo Pascal for windows 1.5.
>I've been trying to find some examples
>on how to print in windows1.5.
>I want to print the report my program generate.
>Although I know how to do it in
>turbo pascal 7. But my program is  for windows.

>Can anyone assist me on this please?



function CreateDC( drivername, devicename, output : PChar; InitData pointer ) :
HDC;

drivername - asciiz string of device driver name without .drv extension

devicename - asciiz string that lists one of the devices supported by the
driver

output - asciiz string that represents the output port e.g. 'prn:', 'com1:',...

initdata - pointer to a TDevMode record, may be used to select specific
features, to use default settings pass NIL

Use the returned HDC to print text and graphics by calling any GDI routine just
like you would to display data to the screen

You can use the Escape function to check for error codes

const
  testTxt ='a line of text';
var
  PrnDC : hdc;
  errCode : integer;

begin
  PrnDC := createdc( 'EPSON9', 'Epson 9 pin', 'LPT1:', nil );
  if PrnDC <> 0 then begin
    errCode := Escape( PrnDC, startdoc, 4, pchar('test'), nil );
    if errCode > 0 then begin
      TextOut( PrnDC, 10, 10, testTxt, StrLen( testTxt ) );
      errCode  := Escape( PrnDC, NewFrame, 0, nil, nil );
      end;
    if errCode > 0 then Escape( PrnDC, EndDoc, 0, nil, nil );
    DeleteDC( PrnDC );
    end;
end;

I haven't tested this, hope this helps

James



Wed, 18 Jun 1902 08:00:00 GMT  
 Help..(TPW Printing )
Hi,
I'm using Turbo Pascal for windows 1.5.
I've been trying to find some examples
on how to print in windows1.5.
I want to print the report my program generate.
Although I know how to do it in
turbo pascal 7. But my program is  for windows.

Can anyone assist me on this please?




Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. TPW: How to print TPW prog output ?

2. TPW: How to print TPW prog output ?

3. TPW 1.5 using LPT1 to print with LEXMARK PRINTER

4. TPW v1.5 - Printing

5. Printing and fonts in TPW

6. TPW: How to print...

7. Problem printing color bitmap on color printer wih TPW 1.5

8. Printing with TPW 1.5

9. Printing DIB files from a TPW application

10. Printing with TPW 1.5

11. TPW 1.5 Printing Fonts

12. Printing bitmaps (TPW)

 

 
Powered by phpBB® Forum Software