Hi,
how can i use a different top margin from the 2. page. E.g. on the first page i need 50 mm top margin, form the 2. to the rest i need only 25 mm top margin.
Everey advice is very appreciated!
Thanks
G. Weber
Hi,
how can i use a different top margin from the 2. page. E.g. on the first page i need 50 mm top margin, form the 2. to the rest i need only 25 mm top margin.
Everey advice is very appreciated!
Thanks
G. Weber
Hi,
Use the OnMeasurePage event. For top/bottom moargin this works ok in V4.
In V5 you could also change page size and left/right margins.
Julian
Hi Julian,
this is what i tried, but it doesn't work. Here the part of my program:
procedure TformMain.WPRichText1MeasurePage(Sender: TObject;
PageNr: Integer; var PageH, MargT, MargB: Integer);
begin
if (PageNr > 0) and (theIni.ReadInteger('Settings', 'TxtTopMargin2', 0) > 0) then
begin
MargT := theIni.ReadInteger('Settings', 'TxtTopMargin2', 0);
end
end;
Can you tell me what's wrong?
Greetings
Gerhard
That code does not appear to be ideal. Please read the INI values somewher in your form where you read it just once, in Form.OnCreate for example. That event is triggered very often.
Assign the value to a variable - then you can place a breakpoint in this event to see if it ever gets there and if the valiue is correct.
Julian
Julian,
i tried what you sad and initialized 2 variables in the OnCreate Event of the main frm, but it still doesn't work. I added a Listbox to "debug" the values of MargT and i could see that the values are different for Page1 and the rest, but it did not take any effect when printing. Here my actual verison of source code:
if PageNr = 0 then
MargT := iTopMargin2
else
MargT := iTopMargin;
lbDebug.Items.Add('Page ' + IntToStr(PageNr) + ', MTop ' + IntToStr(MargT));
Please help.
Gerhard
Does the control which does the printing use the same event? If it is in a TPreviewDlg it will only if ScreenResMode = rm1440!