TPrintPreview v1.1 for all versions of Delphi
---------------------------------------------

Author: Kambiz R. Khojasteh
Mail: khojasteh@www.dci.co.ir
Web: http://www.crosswinds.net/~khojasteh/
   

H O W  T O  U S E
-----------------

TPrintPreview is a decendent of TCustomPanel. Drop it on your form and instead of
using Printer object use PrintPreview. To print the preview on the printer just call
Print method of TPrintPreview.


K E Y  P R O P E R T I E S
--------------------------

* Aborted: Boolean (ReadOnly)
  If sets to True, an user abort occurred.

* Canvas: TCanvas (ReadOnly)
  The PrintPreview canvas

* CurrentPage: Integer
  Determines the current visible page

* MarginLeft: Integer
  Determines the left margin of paper in logical unit.

* MarginTop: Integer
  Determines the top margin of paper in logical unit.

* MarginRight: Integer
  Determines the Right margin of paper in logical unit.

* MarginBottom: Integer
  Determines the bottom margin of paper in logical unit.

* Orientation: TPrinterOrientation
  TPrinterOrientation = (poPortrait, poLanscape)
  Determines the paper orientation

* PageRect: TRect (ReadOnly)
  Determines the page boundary in logical unit and according to page margins.

* PageHeight: Integer (ReadOnly)
  Determines the available vertical size of page in logical unit and according 
  to page margins.

* PageWidth: Integer (ReadOnly)
  Determines the available horizontal size of page in logical unit and according 
  to page margins.
  
* Pages[PageNo: Integer]: TMetaFile (ReadOnly)
  This property provides an access to printered pages

* PaperWidth: Integer
  Determines physical width of paper in logical unit.

* PaperHeight: Integer
  Determines physical height of paper in logical unit.

* PrintJobTitle: String
  Determines title of document

* State: TPreviewState (ReadOnly)
  TPreviewState = (psReady, psCreating, psPrinting);
  Determines the state of component

* TotalPages: Integer (ReadOnly)
  Determines the number of available pages

* Resulotion: TBorderWidth
  Determines the resulotion of print if UsePrinterRes property sets to False.

* UsePrinterRes: Boolean
  Determines the resulotion of print according to printer resulotion.

* Units: TUnits
  TUnits = (mmPixel, mmLoMetric, mmHiMetric, mmLoEnglish, mmHiEnglish, mmTWIPS)
  Determines the mapping mode of canvas. By changing of this property all
  measurement values change to new logical unit (for example: PageRect, Margins,
  Font.Size, Canvas.Pen.Size, ...).

* ZoomState: TSoomState
  TZoomState = (zsZoomOther, zsZoomToWidth, zsZoomToHeight, zsZoomToFit)
  Determines the state of zoom. If sets to zsZoomOther, PrintPreview use Zoom property.

* Zoom: Integer
  Determines the zoom factor of PrintPreview in  precent. If sets the ZoomState will
  change to zsZoomOther.


K E Y  E V E N T S
------------------

* OnBeginDoc: TNotifyEvent
  This event is triggered just after BeginDoc method called.

* OnEndDoc: TNotifyEvent
  This event is triggered just after EndDoc method called.

* OnNewPage: TNotifyEvent
  This event will trigger on every new page creation.

* OnAbort: TNotifyEvent
  This event will trigger when user abort the PrintPreview operation.

* OnChange: TNotifyEvent
  Every change to PrintPreview trigger this event (for example: change to
  CurrentPage, adding new page, ...)

* OnBeforePrint: TNotifyEvent
  This event is triggered just after Print method called.

* OnAfterPrint: TNotifyEvent
  This event is triggered just after printing of pages on the Printer
  object compeleted.

* OnPrintProgres: TPreviewPrintProgress
  TPreviewPrintProgress = procedure(Sender: TObject; PageNum, Progress:
  Integer; var AbortIt: Boolean) of object;
  This event will trigger on printing of pages on the Printer object.
  Set the AbortIt to True, if you want abort the printing.


M E T H O D S
-------------

* procedure BeginDoc;
  Initiates a new job and create preview canvas.

* procedure EndDoc;
  Terminates the current job.

* procedure NewPage;
  Starts a new page.

* procedure Clear;
  Clears all pages and reset PrintPreview.

* procedure Abort;
  Aborts creating or printing of pages.

* procedure Print;
  Print all available pages to Printer object.

* procedure PrintPages(StartPage, StopPage: Integer);
  Print specified range of pages to Printer object.

* procedure UpdateZoom;
  Forces PrintPreview to update its display.

* function Pixel2Units(Value: Integer): Integer;
  Converts a value in pixels to logical unit of PrintPreview.


This component is freeware and may be used in any software product (free or commercial).
If you have problems, suggestions, bug reports mail me.

Please accept my apologies for my bad English.

Kambiz
