How to change margins from the second page

  • 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 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

  • 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