#1 mORMot 1 » [GDIPages] Page of Total Pages » 2015-08-28 07:14:07

ice1
Replies: 4

I have a report code . I want to add in the footer information on the number of pages

procedure TForm5.Button3Click(Sender: TObject);
var i: integer;
begin
  with TGDIPages.Create(self) do
  try
  Orientation :=  poPortrait ;
    Caption := self.Caption;
    BeginDoc;
    AddTextToHeader('Wydruk za rok 2015');
    SaveLayout;
    Font.Style := [fsItalic];
    TextAlign := taRight;
    AddTextToFooter('http://synopse.info/');
    RestoreSavedLayout;
    AddTextToFooter('Data wydruku'+DateTimeToStr(Now));
    AddTextToFooterAt(PAGENUMBER,RightMarginPos); // Page of Total Pages
    // main content (automaticaly split on next pages)
    AddColumns([5,15,50]);
    AddColumnHeaders(['#','Two','Three'],true,true);
    WordWrapLeftCols := true;
    for i := 1 to 100 do
       if(i mod 2 = 0) then
            DrawTextAcrossCols([IntToStr(i),'Column '+IntToStr(i),'bardzo dlugi tekst i tak dalej dgdjh dfjgjdf djgfgdj dfjgdfjfd djdfj djfgfjdf ala ma kota kot ma ale oda do młodości'])
        else
            DrawTextAcrossCols([IntToStr(i),'Column '+IntToStr(i),'krótki tekst']);

    NewLine;
    DrawTitle('This is your text:');
    DrawText(mmo1.Text);
    EndDoc;
    ExportPDF('zaas.pdf',False,true);
  finally
    Free;
  end;
end;

Board footer

Powered by FluxBB