TPlusMemoPrinter Printing methods
PlusMemo Help Send comments on this topic.
TPlusMemoPrinter Printing methods

Glossary Item Box

Print, PrintFromDialog, PrintRange, PrintSelection methods


 

Applies to

TPlusMemoPrinter component

 

Declaration

procedure Print;

procedure PrintFromDialog(PrintDialog: TPrintDialog);

procedure PrintRange(StartPage, StopPage: Integer);

procedure PrintSelection;

 

Description

These methods are used to produce a printout.

 

Use method Print to print the entire content of the TPlusMemo component specified by property MemoToPrint.

 

Use method PrintFromDialog to produce a printout by taking account of the PrintDialog options, which are normally set by the user.  In particular, the range of pages printed is specified by PrintDialog.PrintRange properties.  Typical use of this method entails creating a Delphi TPrintDialog component at design time or at runtime, calling its Execute method, then calling PrintFromDialog like this:

 

if PrintDialog1.Execute then 

    PlusMemoPrinter1.PrintFromDialog(PrintDialog1);

 

Use method PrintRange if you already know the range of pages that you want printed.  Use FormatPrint, then read property PageCount if you need to know the possible range of pages.  StartPage and StopPage indicate the inclusive range of pages to print.  They are zero based, meaning that the first page is numbered zero.

 

Use method PrintSelection to only print the selected text in MemoToPrint.

 

For all these methods, an OnProgress event is triggered before starting the printing of each page.  Also, FormatPrint is called internally to prepare the printout if it is not already done.