dsPrinter

dsPrinter is used for printing. It is used just like TPrinter except it has a lot of additional properties and procedures to work with. dsPrinter works with metafiles so you can always replay pages to some other canvas like jpg or pdf. These way print preview is done and dsPrintPreview is a component that comes with dsPrinter.

To print with dsPrinter you set page size, call BeginDoc, do your priting and call EndDoc. After that you can preview, print or anything else. Here are some things that might be interesting:

dsPrinter already comes with dsReport.

demo