Delphi/CB
•  Greatis •  Security •  AppDatabase •  Utilities •  Visual Basic • .NET •  just4fun
Delphi / C++ Builder
Components, utilities and tips for Delphi and C++ Builder developers
More info
Print Suite FAQ
Print Suite Home
Delphi Components
See also
Products
Form Designer
Object Inspector
Runtime Fusion
Commented Image
Image Editor  new!
Delphi Toys
Ultimate Pack  hot!

FAQs
Form Designer FAQ
Object Inspector FAQ
Image Editor FAQ

Links
Software for .NET
Software for VB 6
Delphi Tips & Tricks

Services
Outsourcing
Texts printing
There are two text-oriented print jobs: TStringsPrintJob and TRichEditPrintJob. TStringsPrintJob prints the plain text from the Strings property, so, for instance, to print the TMemo contents, just copy the text from the memo into the Strings property and call the Print method.
procedure TForm1.PrintButtonClick(Sender: TObject);
begin
  with StringsPrintJob1 do
  begin
    Strings:=Memo1.Lines;
    Print;
  end;
end;
TStringsPrintJob draws only page area itself, so you can draw any additional information in the header and footer area using the OnDraw event.
procedure TForm1.StringsPrintJob1Draw(Sender: TObject; 
  TheCanvas: TCanvas; PageIndex: Integer; TheRect: TRect; 
  Area: TDrawArea; Target: TDrawTarget);
begin
  with TheCanvas do
    case Area of
      daHeader: DrawText(Handle,'The header',-1,TheRect,0);
      daFooter: DrawText(Handle,PChar('Page '+IntToStr(PageIndex)),
        -1,TheRect,DT_RIGHT or DT_SINGLELINE or DT_BOTTOM);
    end;
end;
Do not forget to enable the header and footer in the Options property and set the needed size of the header and footer areas.

The rich text (RTF) can be printed by the TRichEditPrintJob component. Just drop the component onto your form and link it with TRichEdit component using the RichEdit property. The header and footer areas can be customized too.


Greatis Software Greatis | Security | AppDatabase | Utilities | Delphi/CB | Visual Basic | .NET | just4fun

Contacts | Add to Favorites | Recommend to a Friend | Privacy Policy | Copyright © 1998-2008 Greatis Software