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 |
---|---|
DoStartPageChanged | Replace this event when creating a custom descendant of FlexCelPreview. |
DoZoomChanged | Replace this event when creating a custom descendant of FlexCelPreview. |
MouseDown | Overrides the standard mousedown event to handle it. |
KeyDown | Overrides the ProcessCmdKey event. |
CMParentFontChanged | Overrides the OnfontChanged event. |
PaintWindow | Overrides the OnPaint event. |
Paint | Does the actual painting. Override this method in your own classes to modify paint behavior. |
Resize | Overrides de OnResize method. |
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. |
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. |
Properties
Name | Description |
---|---|
Document | Document to be Previewed. |
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. |
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. |
PageYSeparation | Separation (in display units) between a page an the next. |
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. |
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. |
StartPage | Page the preview is showing. |
TotalPages | Number of pages displaying. |
Zoom | Zoom preview. |
CacheSize | The cache size in number of pages stored at 100%% zoom. For larger zoom actual number of pages is decreased by (Zoom*Zoom) |
ShowThumbsPageNumber | If true, the thumbnails will display the page number. Note that this property only affects the thumbnails, not the main preview. |
ThumbnailSmall | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the small Thumbnail images. |
ThumbnailLarge | When using this component on Thumbnail mode, set this property to another FlexCelPreview component that will hold the large Thumbnail images. |
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 |
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 |
PageShadowSize | Shadow size for the pages in the preview. Set it to 0 to disable shadows. |
PageShadowColor | Shadow color for the pages in the preview. |
PageBorderColor | Border color for the pages in the preview. |
PageBorderWidth | Border width for the pages in the preview. |
PageBorderStyle | Border style for the pages in the preview. |
PageNumberBgColor | Background color for the page numbers in the thumbnail view. |
PageNumberSelectedBgColor | Background color for the selected page number in the thumbnail view. |
PageNumberTextColor | Text color for the page number in the thumbnail view. |
PageNumberSelectedTextColor | Text color for the selected page number in the thumbnail view. |
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. |
ScrollWheelOffset | How many lines the preview should scroll down when the user move the scroll wheel. |
Events
Name | Description |
---|---|
OnStartPageChanged | Fires when the starting page changes. |
OnZoomChanged | Fires when the Zoom changes. (for example, the user uses ctrl+MouseWeel). |