Board index » delphi » Different output on different printer ???

Different output on different printer ???

{This programs produces a different (much smaller) print when printed
on a HP Deskjet compared with a STAR LC 10 ?

What am I doing wrong ???

Quote
}

uses
  WinPrn, WinCrt;

var
  LST : Text;
  OudeFont : Hfont;
  ALogFont : TLogFont;

begin
  Writeln('Printing..')
  AssignDefPrn(LST);{ Open a file to the default printer }
  TitlePrn(LST,'ZWANGERSCHAPSDOSSIER');
  Rewrite(LST);
  Writeln(Lst);
  Writeln(LST,'ZWANGERSCHAPSDOSSIER');
  {Writeln(LST,CharStr('-',80));}
  FillChar(ALogFont, SizeOf(TLogFont), #0);
  with ALogFont do
  begin
    lfHeight        := 13;
    lfWeight        := 400;    
    lfItalic        := 0;    
    lfUnderline     := 0;
    lfOutPrecision  := Out_Stroke_Precis;
    lfClipPrecision := Clip_Stroke_Precis;
    lfQuality       := Default_Quality;
    lfPitchAndFamily:= Fixed_Pitch;
    StrCopy(lfFaceName, 'Courier New');
  end;
  OudeFont := SetPrnFont(LST,CreateFontIndirect(ALogFont));
  Writeln(LST,'Datum      Weken    Gewicht     BD Urine   KB   HT
Fundus Ligging    Indal  Cervix');
  DeleteObject(SetPrnFont(LST, OudeFont));
  Close(LST);
end.
Francis Pauwelyn
Francis.Pauwe...@ping.be
100572....@compuserve.com
Http://ourworld.compuserve.com/homepages/Francis_Pauwelyn
----------
If you want it World, and you want it Wide, don't forget that Netscape's not the only ride...

 

Re:Different output on different printer ???


Quote
Francis.Pauwe...@ping.be (Francis Pauwelyn) wrote:
>{This programs produces a different (much smaller) print when printed
>on a HP Deskjet compared with a STAR LC 10 ?
>What am I doing wrong ???
>}

The DPI of these printers are very different I am sure.

I have a program that I had to get the Metrics of the printer because
it must print on Dot Matrix, Lasers and Ink Jet printers on a
preprinted form.

This is the only was to ensure that this occurs.  
(it is kind of a real pain in the *ss too)

Re:Different output on different printer ???


Quote
Francis.Pauwe...@ping.be (Francis Pauwelyn) wrote:
>{This programs produces a different (much smaller) print when printed
>on a HP Deskjet compared with a STAR LC 10 ?
>What am I doing wrong ???
>}

Found the solution already...

Added following code to the WinPrn unit : (also in interface section)

function PrnDc(var F: Text): HDC;
begin
  PrnDC := PrnRec(TTextRec(F).UserData).DC;
end;

Then choose font using following code

       FillChar(ALogFont, SizeOf(TLogFont), #0);
       with ALogFont do
       begin
         lfHeight        := -( 10 * (GetDeviceCaps(PrnDC(LST),
LogPixelsY)) div 72);
...

Francis Pauwelyn
Francis.Pauwe...@ping.be
100572....@compuserve.com
Http://ourworld.compuserve.com/homepages/Francis_Pauwelyn
----------
If you want it World, and you want it Wide, don't forget that Netscape's not the only ride...

Re:Different output on different printer ???


Quote
On Thu, 22 Feb 1996, CAM Moorman wrote:
> Francis.Pauwe...@ping.be (Francis Pauwelyn) wrote:
> >{This programs produces a different (much smaller) print when printed
> >on a HP Deskjet compared with a STAR LC 10 ?
> >What am I doing wrong ???
> >}
> The DPI of these printers are very different I am sure.
> I have a program that I had to get the Metrics of the printer because
> it must print on Dot Matrix, Lasers and Ink Jet printers on a
> preprinted form.

Does anyone know the equations to set the printer.canvas.size well
according with the font.size of my forms?
I really have a tought day ... and still five different scaled result
from five different printer resolutions
Thanks in advance...
I'm designing a Wysywyg appl.
dum...@jsp.umontreal.ca

Other Threads