Skip to content

Print and Preview Demo ​

Folder: Demos\PrintDemo. Project: TestPP.dpr.

Demonstrates the components for printing and print preview: TSynEditPrint and TSynEditPrintPreview. It uses a TImageCollection and a TVirtualImageList for the images of the actions.

UnitContent
MTestPPThe main form: opens a file in the editor and has the commands Printer Setup, Page Setup, Print Preview and Print.
DTestPrintPreviewThe form with the TSynEditPrintPreview, with the commands to browse the pages and to change the zoom.
DPageSetupThe page setup dialog (the library has the same dialog in SynEdit.DPageSetup).

What you can try ​

  • Open a source file and see it in the preview with the colors of the highlighter.
  • Change the margins, the header and the footer in the page setup dialog (with the macros $TITLE$, $PAGENUM$, $PAGECOUNT$, $DATE$...).
  • Print the whole text, or only the selected part.

Released under the MPL 1.1 / GPL 2 dual license.