Table of Contents

TFlexCelPreviewer Class

Allows you to preview a file, even if the user has no printers installed. View the demo on Custom Preview to see how it is used.

Syntax

Unit: FlexCel.Preview

TFlexCelPreviewer = class(TScrollingWinControl);

Constructors

Name Description
Create Creates a new instance of FlexCelPreview.

Methods

Name Description
AutofitPreviewOnce Use this method to do a single autofit. If you want the preview to be in "autofit mode" so it keeps autofitting even if you resize the window, set AutofitPreview instead.
CMParentFontChanged Overrides the OnfontChanged event.
DoStartPageChanged Replace this event when creating a custom descendant of FlexCelPreview.
DoZoomChanged Replace this event when creating a custom descendant of FlexCelPreview.
InvalidatePreview Invalidates the preview and forces the control to reload from the document.
When the control is a Thumbnail you cannot Invalidate it, this will be done automatically when you invalidate the main view.
KeyDown Overrides the ProcessCmdKey event.
MouseDown Overrides the standard mousedown event to handle it.
Paint Does the actual painting. Override this method in your own classes to modify paint behavior.
PaintWindow Overrides the OnPaint event.
Resize Overrides de OnResize method.

Properties

Name Description
AutofitPreview Defines if the page will be automatically zoomed to fit in the preview. Note that zoom will never be less than 10%% or 400%%.
If you want to autofit just once, call AutofitPreviewOnce instead.
CacheSize The cache size in number of pages stored at 100%% zoom. For larger zoom actual number of pages is decreased by (Zoom*Zoom)
CenteredPreview When true, the preview will be drawn at the middle of the window, instead of at the left. If true, then PageXSeparation is the minimum margin that the preview will have.
Document Document to be Previewed.
EndPreviewAtLastPage When true, the preview will stop at the last page, and if you are showing more than one page at the same time you won't be able to select the last page. When false, FlexCelPreview will add enough space after the last page so all pages are selectable.
Note that in normal cases this won't make a difference, this property only applies if zoom is so small that you can see more than one page in the preview.
InterpolationMode This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality.
Consult the .NET framework documentation on SmoothingMode for more information
MaxPageSize Returns the maximum height and width of a page. Note that width and height might not be from the same page, this is the width of the widest page and the height of the tallest page.
PageBorderColor Border color for the pages in the preview.
PageBorderStyle Border style for the pages in the preview.
PageBorderWidth Border width for the pages in the preview.
PageNumberBgColor Background color for the page numbers in the thumbnail view.
PageNumberSelected​BgColor Background color for the selected page number in the thumbnail view.
PageNumberSelected​Text​Color Text color for the selected page number in the thumbnail view.
PageNumberTextColor Text color for the page number in the thumbnail view.
PageShadowColor Shadow color for the pages in the preview.
PageShadowSize Shadow size for the pages in the preview. Set it to 0 to disable shadows.
PageXSeparation Separation (in display units) between a page an the next. Note that if CenteredPreview is true and the preview window is bigger than the page being displayed, this value has no effect.
PageYSeparation Separation (in display units) between a page an the next.
ScrollWheelOffset How many lines the preview should scroll down when the user move the scroll wheel.
ShowThumbsPageNumber If true, the thumbnails will display the page number. Note that this property only affects the thumbnails, not the main preview.
SmoothingMode This affects how the images are rendered on the screen. Some modes will look a little blurred but with better quality.
Consult the .NET framework documentation on SmoothingMode for more information
StartPage Page the preview is showing.
ThumbnailLarge When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the large Thumbnail images.
ThumbnailSmall When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the small Thumbnail images.
TotalPages Number of pages displaying.
Zoom Zoom preview.

Events

Name Description
OnStartPageChanged Fires when the starting page changes.
OnZoomChanged Fires when the Zoom changes. (for example, the user uses ctrl+MouseWeel).