
(*
 Delphi Object and Component Reference
# {bmc bm18.BMP} {bmc bm9.BMP} PageNumber example
This example uses a button on a form. When the user clicks the button, one line of text is printed on six separate pages. As each page is printed, a message indicating the number of the page being printed appears on the status bar.
To run this example successfully, add  #include <Printers.h> to your unit and set the SimplePanel property of the status bar to true.
*) 
void __fastcall TForm1::Button1Click(TObject Sender*)
{
  Printer()->BeginDoc();
  for (int i = 1;i < 7;i++) 
  {
    Printer()->Canvas->TextOut(100, 100, "C++Builder rules!");
    StatusBar1->SimpleText = AnsiString("Printing page ") + Printer()->PageNumber);
    Printer()->NewPage();
  }
  Printer()->EndDoc();
} 
