TPlusMemoPrinter component
PlusMemo Help Send comments on this topic.
TPlusMemoPrinter component

Glossary Item Box

 

 TPlusMemoPrinter component


 Unit

pmprint

 

Declaration (partial)

type

    TPlusMemoPrinter = class(TComponent);

 

Description

TPlusMemoPrinter is a non-visual component to help printing the content of a TPlusMemo with programmable margins, header, footer, line spacing and number of columns.  It can also show a screen preview, which includes the user interface elements for setting margins print range and number of columns.

 

To use this component, place a TPlusMemoPrinter on your form, set its property MemoToPrint to a TPlusMemo instance, set the margins in inches (either at design time or at runtime) and call method Print or Preview from your application.  The line spacing can be set in inches (positive values of LineSpacing property) or in line height units (negative values, for example -2.0 means double interline).  The preview, as well as the printout, can be made multicolumn through properties GutterWidth and Columns.

 

A page break character (#12) at the start of a paragraph will produce a page break in the printout.  It is possible for the user to enter such a page break character by typing Ctrl-P.

 

Key properties

  Run-time only

  Columns Determines the number of columns in the printout;
  CurrentPage A read only property that returns the page number being currently printed;
  Footer A string property for the footer text;
  FooterAlign Controls the horizontal alignment of the footer;
  FooterFont Selects the font for the footer;
  FooterYPos Controls the vertical position of the footer;
  GutterWidth Controls the horizontal spacing between columns in inches;
  Header A string property for the header text;
  HeaderAlign The horizontal alignment of the header;
  HeaderFont The header's font;
  HeaderYPos The header's vertical position;
  LineNumbers Controls whether line numbers are printed at the left of each line;
  LineSpacing Controls the line spacing in the printout;
  MarginBottom The printout bottom margin;
  MarginLeft The printout left margin;
  MarginRight The printout right margin;
  MarginTop The printout top margin;
  MemoToPrint The TPlusMemo component whose content we want to print;
  PageCount The number of pages in the printout;
  PageHeight The printed page height in pixels;
  PageWidth The printed page width in pixels;
  ParagraphNumbers Controls if paragraph numbers are printed at the left of each paragraph;
  PlainText When set to True, prints plain text only, without dynamic or static formatting;
  PreviewTitle The title of the preview window;
  PrintStartPage The number of the first page that was printed in the last print job;
  PrintTitle The name of the print job;
  StartingLineNumber The starting line number to print if LineNumbers is True;
  StartingPageNumber The number to print on the first page of the printout;
  WordWrap Controls whether paragraphs are wrapped on consecutive lines or truncated, when they don't fit in the horizontal extent defined by the margins.

 

 

Key methods

  AbortPrint Abort the printing in progress;
  FormatPrint Format the printout in advance, to know the number of pages;
  Preview Shows a WYSIWYG of the printout;
  Print Print all pages;
  PrintFromDialog Print with the settings recorded in a TPrintDialog component;
  PrintRange Print a range of pages;
  PrintSelection Print only what is currently selected in the TPlusMemo component.

 

 

Key events

  OnFormatPrint Triggered whenever the TPlusMemoPrinter starts a printout formatting operation;
  OnPreview Occurs right after calling Preview, letting your application change the preview form properties before it is displayed;
  OnProgress Occurs during printing, once for each printed page.