Autor Beitrag
Hendrik
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 324



BeitragVerfasst: Sa 29.03.03 12:54 
Hallo

Ich hab schon überall danach gesucht, aber nirgends gefunden:

Wie kann ich ein Richedit quer und mit Rand ausdrucken?
mr_data
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 31

Win XP, Win2K
D5, D6 Pers.
BeitragVerfasst: Di 01.04.03 10:34 
Hallo Hendrik,

Das Drucken auf Querformat umstellen funktioniert bei mir (D5, Win2K) über den Printersetupdialog:

ausblenden Quelltext
1:
2:
3:
4:
procedure TfrmEditor.PrinterSetup1Click(Sender: TObject);
begin
 PrinterSetupDialog1.Execute;
end;


Zum Setzen der Ränder setzt man Pagerect:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
     MyRichEdit.PageRect := SetPageMargins;
...
function TfrmEditor.SetPageMargins: TRect;
var
 LogX, LogY :integer;
 NewPageRect: TRect;
begin
 LogX := GetDeviceCaps(Printer.Handle, HORZRES);
 LogY := GetDeviceCaps(Printer.Handle, VERTRES);
 NewPageRect.Left := Round( (GMarginsLeft * LogX ) / 100);
 NewPageRect.Top := Round( (GMarginsTop * LogY ) / 100);
 NewPageRect.Right := Printer.PageWidth -
                    Round( (GMarginsRight * LogX) / 100);
 NewPageRect.Bottom := Printer.PageHeight -
                    Round( (GMarginsBottom * LogY) / 100);
 result:= NewPageRect;
end;


wobei die Variablen GMarginsxxx die gewünschten Randbreiten in % (!)
sind.

Gruß Data