Board index » delphi » PrintOut Problems...

PrintOut Problems...

In Delphi 3..
When I printout with my old printer (Citizien ProJet) it's all ok.
On my friends PC with a HP DeskJet , the space between
the lines is different.
I use this procedure in Sourcecode :
Printer.BeginDoc;
Printer.Canvas.TextOut(100,200,'Text'');
Printer.EndDoc;

Please HELP me.

 

Re:PrintOut Problems...


you must set the Font Size and type ect in the printer canvas..
you cac use the Canvas.TextSize to determine the space needed for th e
next line..

mich <m...@pt.lu> wrote in article <6olr1m$7v...@news.pt.lu>...

Quote
> In Delphi 3..
> When I printout with my old printer (Citizien ProJet) it's all ok.
> On my friends PC with a HP DeskJet , the space between
> the lines is different.
> I use this procedure in Sourcecode :
> Printer.BeginDoc;
> Printer.Canvas.TextOut(100,200,'Text'');
> Printer.EndDoc;

> Please HELP me.

Re:PrintOut Problems...


Quote
mich wrote in message <6olr1m$7v...@news.pt.lu>...
>In Delphi 3..
>When I printout with my old printer (Citizien ProJet) it's all ok.
>On my friends PC with a HP DeskJet , the space between
>the lines is different.
>I use this procedure in Sourcecode :
>Printer.BeginDoc;
>Printer.Canvas.TextOut(100,200,'Text'');
>Printer.EndDoc;

You can have 72 dots/inch or 1440 dots/inch on some printers.  You've got to
take steps to make sure text or graphics are scaled correctly.

Take a look at the Printer Demo #1 or #2 on the Printer Projects page in my
Computer Lab (start in "Other Projects."  These examples should help you.

efg
_________________________________________
efg's Computer Lab:  http://infomaster.net/external/efg

Earl F. Glynn                 E-Mail:  EarlGl...@att.net
MedTech Research Corporation, Lenexa, KS  USA

Re:PrintOut Problems...


Ok, Ok, there is not a problem here.

You say the printer to write at 100,100 and printer do it.

Why diferent on diferent printers?

The coordenates are given on device units, the coordinate 100,100 on is
retalive to the resolution of the printer.

If you want to write at the same position with any device you must work in
logical units.

Here is the good code

Quote
>Printer.BeginDoc;
>SetMapMode(Printer.canvas.handle,MM_TWIPS);
>Printer.Canvas.TextOut(1440,1440,'Text'');
>Printer.EndDoc;

This code writes the text at one inch top, one inch left, from the printable
paper area of the paper.

The position is nearly the same in two diferent printers, if you want to be
exactly the same position, you must consider the non printable area with
GetDeviceCaps.

I hope this explanation can help you.

Excuse me for my bad english.

Bye

mich escribi en mensaje <6olr1m$7v...@news.pt.lu>...

Quote
>In Delphi 3..
>When I printout with my old printer (Citizien ProJet) it's all ok.
>On my friends PC with a HP DeskJet , the space between
>the lines is different.
>I use this procedure in Sourcecode :
>Printer.BeginDoc;
>Printer.Canvas.TextOut(100,200,'Text'');
>Printer.EndDoc;

>Please HELP me.

Other Threads