trichview.com

trichview.support




Re: Printing Page numbers


Return to index


Author

Message

Sergey Tkachenko

Posted: 11/15/2003 16:28:36


Your code seems to be correct, and it should draw page numbers on all pages.

Please look at the demo

Demos\CBuilder\Assorted\Printing\Printing\


It uses the code:


void __fastcall TForm1::RVPrint1PagePrepaint(TRVPrint *Sender, int PageNo,

    TCanvas *Canvas, bool Preview, TRect &PageRect, TRect &PrintAreaRect)

{


  AnsiString s = Format ("-- Page %d of %d --", ARRAYOFCONST((PageNo,

Sender->PagesCount)));

  Canvas->Brush->Style = bsClear;

  Canvas->Font->Assign(RVStyle1->TextStyles->Items[0]);

  int w = Canvas->TextWidth(s);

  int h = Canvas->TextHeight(s);

  TextOut(Canvas->Handle, (PrintAreaRect.Right+PrintAreaRect.Left-w) / 2,

          PrintAreaRect.Top - h - 10, s.c_str(), s.Length());

}


And it is printed on all pages





Powered by ABC Amber Outlook Express Converter