Skip to content

PDFThumbnailsView

Namespace: O2S.Components.PDF4NET.View

Defines a viewer control for PDF page thumbnails.

public class PDFThumbnailsView : System.Windows.Forms.Control, IPDFView

Inheritance Object → MarshalByRefObject → Component → Control → PDFThumbnailsView
Implements IPDFView

Remarks

Use this control to display thumbnails of PDF pages. Set the PDFThumbnailsView.Document property to display the desired PDF document and the PDFThumbnailsView.DocumentView property to link it to a document view. When the user clicks on a thumbnail in the PDFThumbnailsView, the corresponding page in the linked PDFDocumentView will be displayed, allowing for easy navigation through the PDF document.

Note

To ensure proper functionality, please make sure the value of the PDFThumbnailsView.Document property matches the document set in the linked PDFDocumentView. Otherwise, the thumbnail navigation may not work as expected.

Example

In your form's constructor initialize the PDFThumbnailsView and link it to a PDFDocumentView as follows:

public AppForm()
{
    InitializeComponent();

    // ...

    document = new PDFVisualDocument();
    documentView.Document = document;
    thumbnailsView.Document = document;
    thumbnailsView.DocumentView = documentView;

    // ...
}

When the form is closed, the viewer controls need to be disposed explicitly as follows:

protected override void OnFormClosing(FormClosingEventArgs e)
{
    base.OnFormClosing(e);

    document.Close();
    documentView.Dispose();
    thumbnailsView.Dispose();
    document.Dispose();
}

Constructors

PDFThumbnailsView()

Initializes a new PDFThumbnailsView object.

public PDFThumbnailsView()

Properties

AccessibilityObject

public AccessibleObject AccessibilityObject { get; }

Property Value

AccessibleObject


AccessibleDefaultActionDescription

public string AccessibleDefaultActionDescription { get; set; }

Property Value

String


AccessibleDescription

public string AccessibleDescription { get; set; }

Property Value

String


AccessibleName

public string AccessibleName { get; set; }

Property Value

String


AccessibleRole

public AccessibleRole AccessibleRole { get; set; }

Property Value

AccessibleRole


AllowDrop

public bool AllowDrop { get; set; }

Property Value

Boolean


Anchor

public AnchorStyles Anchor { get; set; }

Property Value

AnchorStyles


AutoScrollOffset

public Point AutoScrollOffset { get; set; }

Property Value

Point


BackColor

public Color BackColor { get; set; }

Property Value

Color


BackgroundImage

public Image BackgroundImage { get; set; }

Property Value

Image


BackgroundImageLayout

public ImageLayout BackgroundImageLayout { get; set; }

Property Value

ImageLayout


BindingContext

public BindingContext BindingContext { get; set; }

Property Value

BindingContext


Bottom

public int Bottom { get; }

Property Value

Int32


Bounds

public Rectangle Bounds { get; set; }

Property Value

Rectangle


CanFocus

public bool CanFocus { get; }

Property Value

Boolean


CanSelect

public bool CanSelect { get; }

Property Value

Boolean


Capture

public bool Capture { get; set; }

Property Value

Boolean


CausesValidation

public bool CausesValidation { get; set; }

Property Value

Boolean


ClientRectangle

public Rectangle ClientRectangle { get; }

Property Value

Rectangle


ClientSize

public Size ClientSize { get; set; }

Property Value

Size


CompanyName

public string CompanyName { get; }

Property Value

String


Container

public IContainer Container { get; }

Property Value

IContainer


ContainsFocus

public bool ContainsFocus { get; }

Property Value

Boolean


ContentPosition

Gets the content position.

public Point ContentPosition { get; set; }

Property Value

Point
The position of the content displayed in the viewer control.

Remarks

The position is relative to the top left corner of the viewer control.


ContentSize

Gets the content size.

public Size ContentSize { get; }

Property Value

Size
The size of the content displayed in the viewer control.


ContextMenu

public ContextMenu ContextMenu { get; set; }

Property Value

ContextMenu


ContextMenuStrip

public ContextMenuStrip ContextMenuStrip { get; set; }

Property Value

ContextMenuStrip


Controls

public ControlCollection Controls { get; }

Property Value

ControlCollection


Created

public bool Created { get; }

Property Value

Boolean


Cursor

public Cursor Cursor { get; set; }

Property Value

Cursor


DataBindings

public ControlBindingsCollection DataBindings { get; }

Property Value

ControlBindingsCollection


DeviceDpi

public int DeviceDpi { get; }

Property Value

Int32


DisplayRectangle

public Rectangle DisplayRectangle { get; }

Property Value

Rectangle


Disposing

public bool Disposing { get; }

Property Value

Boolean


Dock

public DockStyle Dock { get; set; }

Property Value

DockStyle


Document

Gets or sets the document displayed in the viewer.

public PDFVisualDocument Document { get; set; }

Property Value

PDFVisualDocument
A visual document that encapsulates the file to be displayed.


DocumentView

Gets or sets the associated document view.

public PDFDocumentView DocumentView { get; set; }

Property Value

PDFDocumentView
A PDFDocumentView that represents the document view associated with the thumbnails.

Remarks

When a page is clicked in the thumbnails view, the corresponding page in the document view is displayed.


Enabled

public bool Enabled { get; set; }

Property Value

Boolean


Focused

public bool Focused { get; }

Property Value

Boolean


Font

public Font Font { get; set; }

Property Value

Font


ForeColor

public Color ForeColor { get; set; }

Property Value

Color


GraphicRendererFactory

Gets or sets the graphic renderer factory.

public IGraphicRendererFactory GraphicRendererFactory { get; set; }

Property Value

IGraphicRendererFactory
A factory for creating graphic renderers used by the PDF rendering process.


Handle

public IntPtr Handle { get; }

Property Value

IntPtr


HasChildren

public bool HasChildren { get; }

Property Value

Boolean


Height

public int Height { get; set; }

Property Value

Int32


ImeMode

public ImeMode ImeMode { get; set; }

Property Value

ImeMode


InvokeRequired

public bool InvokeRequired { get; }

Property Value

Boolean


IsAccessible

public bool IsAccessible { get; set; }

Property Value

Boolean


IsDisposed

public bool IsDisposed { get; }

Property Value

Boolean


IsHandleCreated

public bool IsHandleCreated { get; }

Property Value

Boolean


IsMirrored

public bool IsMirrored { get; }

Property Value

Boolean


LayoutEngine

public LayoutEngine LayoutEngine { get; }

Property Value

LayoutEngine


Left

public int Left { get; set; }

Property Value

Int32


Location

public Point Location { get; set; }

Property Value

Point


Margin

public Padding Margin { get; set; }

Property Value

Padding


MaximumSize

public Size MaximumSize { get; set; }

Property Value

Size


MinimumSize

public Size MinimumSize { get; set; }

Property Value

Size


Name

public string Name { get; set; }

Property Value

String


Padding

public Padding Padding { get; set; }

Property Value

Padding


PageDisplayLayout

Gets or sets the current page display layout.

public PDFPageDisplayLayout PageDisplayLayout { get; set; }

Property Value

PDFPageDisplayLayout

Remarks

The page display layout defines how the PDF pages are arranged and displayed in the viewer control.


PageNumber

Gets or sets the page number.

public int PageNumber { get; set; }

Property Value

Int32
The number of the page to be displayed in the viewer.


Parent

public Control Parent { get; set; }

Property Value

Control


PreferredSize

public Size PreferredSize { get; }

Property Value

Size


ProductName

public string ProductName { get; }

Property Value

String


ProductVersion

public string ProductVersion { get; }

Property Value

String


RecreatingHandle

public bool RecreatingHandle { get; }

Property Value

Boolean


Region

public Region Region { get; set; }

Property Value

Region


public int Right { get; }

Property Value

Int32


RightToLeft

public RightToLeft RightToLeft { get; set; }

Property Value

RightToLeft


ShowAnnotations

Gets or sets a value indicating whether the annotations should be displayed or not.

public bool ShowAnnotations { get; set; }

Property Value

Boolean
True if the annotations should be displayed, false otherwise. Default is true.


ShowDefaultPageContextMenu

Gets of sets a flag indicating whether the default page context menu should be displayed when right-clicking on a page.

public bool ShowDefaultPageContextMenu { get; set; }

Property Value

Boolean
True if default page context menu should be displayed.


ShowFormFields

Gets or sets a value indicating whether the form fields should be displayed or not.

public bool ShowFormFields { get; set; }

Property Value

Boolean
True if the form fields should be displayed, false otherwise. Default is true.


ShowPageNumbers

Gets or sets a flag indicating whether page numbers should be displayed.

public bool ShowPageNumbers { get; set; }

Property Value

Boolean
True if page numbers should be displayed.

Remarks

When set to true, the viewer will display page numbers under each thumbnail.


Site

public ISite Site { get; set; }

Property Value

ISite


Size

public Size Size { get; set; }

Property Value

Size


TabIndex

public int TabIndex { get; set; }

Property Value

Int32


TabStop

public bool TabStop { get; set; }

Property Value

Boolean


Tag

public object Tag { get; set; }

Property Value

Object


Text

public string Text { get; set; }

Property Value

String


Top

public int Top { get; set; }

Property Value

Int32


TopLevelControl

public Control TopLevelControl { get; }

Property Value

Control


UseWaitCursor

public bool UseWaitCursor { get; set; }

Property Value

Boolean


Visible

public bool Visible { get; set; }

Property Value

Boolean


Width

public int Width { get; set; }

Property Value

Int32


Zoom

Gets or sets the zoom level.

public int Zoom { get; set; }

Property Value

Int32
The zoom level used for displaying the PDF pages.


Methods

ConvertPagePointToViewerPoint(Int32, PDFPoint)

Converts a page point in page visual coordinates to a viewer point in viewer coordinates.

public Point ConvertPagePointToViewerPoint(int pageNumber, PDFPoint pagePoint)

Parameters

pageNumber Int32
The page number for which the conversion is performed.

pagePoint PDFPoint
The page point in visual coordinates (PDF points relative to top left corner of the visible page area)

Returns

Point
A object in viewer coordinates, relative to top left corner of the viewer control.


GetVisiblePages()

Gets the list of visible pages.

public Int32[] GetVisiblePages()

Returns

Int32[]
An array of page numbers, specifying the pages that are visible in the viewer.


ScrollToPageLocation(PDFVisualPage, Double, Double)

Scrolls the viewer to the specified page at the given location.

public void ScrollToPageLocation(PDFVisualPage visualPage, double x, double y)

Parameters

visualPage PDFVisualPage
The page to scroll to.

x Double
Location's x coordinate on the page where to scroll.

y Double
Location's Y coordinate on the page where to scroll.


Events

AfterPageDelete

Gets or sets the event that is fired after a page has been deleted.

public event EventHandler<PDFVisualPageDeleteEventArgs> AfterPageDelete;

BackColorChanged

public event EventHandler BackColorChanged;

BackgroundImageChanged

public event EventHandler BackgroundImageChanged;

BackgroundImageLayoutChanged

public event EventHandler BackgroundImageLayoutChanged;

BeforePageDelete

Gets or sets the event that is fired when a page is about to be deleted using the default page context menu.

public event EventHandler<PDFVisualPageDeleteEventArgs> BeforePageDelete;

BindingContextChanged

public event EventHandler BindingContextChanged;

CausesValidationChanged

public event EventHandler CausesValidationChanged;

ChangeUICues

public event UICuesEventHandler ChangeUICues;

Click

public event EventHandler Click;

ClientSizeChanged

public event EventHandler ClientSizeChanged;

ContentPainted

Gets or sets the event that is fired after the viewer content has been drawn.

public event EventHandler<PaintEventArgs> ContentPainted;

ContentPositionChanged

Gets or sets the event that is fired when the content position has changed.

public event EventHandler<EventArgs> ContentPositionChanged;

ContentSizeChanged

Gets or sets the event that is fired when the size of displayed content changes.

public event EventHandler<EventArgs> ContentSizeChanged;

ContextMenuChanged

public event EventHandler ContextMenuChanged;

ContextMenuStripChanged

public event EventHandler ContextMenuStripChanged;

ControlAdded

public event ControlEventHandler ControlAdded;

ControlRemoved

public event ControlEventHandler ControlRemoved;

CursorChanged

public event EventHandler CursorChanged;

Disposed

public event EventHandler Disposed;

DockChanged

public event EventHandler DockChanged;

DoubleClick

public event EventHandler DoubleClick;

DpiChangedAfterParent

public event EventHandler DpiChangedAfterParent;

DpiChangedBeforeParent

public event EventHandler DpiChangedBeforeParent;

DragDrop

public event DragEventHandler DragDrop;

DragEnter

public event DragEventHandler DragEnter;

DragLeave

public event EventHandler DragLeave;

DragOver

public event DragEventHandler DragOver;

EnabledChanged

public event EventHandler EnabledChanged;

Enter

public event EventHandler Enter;

FontChanged

public event EventHandler FontChanged;

ForeColorChanged

public event EventHandler ForeColorChanged;

GiveFeedback

public event GiveFeedbackEventHandler GiveFeedback;

GotFocus

public event EventHandler GotFocus;

HandleCreated

public event EventHandler HandleCreated;

HandleDestroyed

public event EventHandler HandleDestroyed;

HelpRequested

public event HelpEventHandler HelpRequested;

ImeModeChanged

public event EventHandler ImeModeChanged;

Invalidated

public event InvalidateEventHandler Invalidated;

KeyDown

public event KeyEventHandler KeyDown;

KeyPress

public event KeyPressEventHandler KeyPress;

KeyUp

public event KeyEventHandler KeyUp;

Layout

public event LayoutEventHandler Layout;

Leave

public event EventHandler Leave;

LocationChanged

public event EventHandler LocationChanged;

LostFocus

public event EventHandler LostFocus;

MarginChanged

public event EventHandler MarginChanged;

MouseCaptureChanged

public event EventHandler MouseCaptureChanged;

MouseClick

public event MouseEventHandler MouseClick;

MouseDoubleClick

public event MouseEventHandler MouseDoubleClick;

MouseDown

public event MouseEventHandler MouseDown;

MouseEnter

public event EventHandler MouseEnter;

MouseHover

public event EventHandler MouseHover;

MouseLeave

public event EventHandler MouseLeave;

MouseMove

public event MouseEventHandler MouseMove;

MouseUp

public event MouseEventHandler MouseUp;

MouseWheel

public event MouseEventHandler MouseWheel;

Move

public event EventHandler Move;

PaddingChanged

public event EventHandler PaddingChanged;

PageClick

Gets or sets the event that is fired when a page has been clicked.

public event EventHandler<PDFVisualPageClickEventArgs> PageClick;

PageContextMenu

Gets or sets the event that is fired when a page context menu should be displayed.

public event EventHandler<PDFVisualPageClickEventArgs> PageContextMenu;

PageDoubleClick

Gets or sets the event that is fired when a page has been double clicked.

public event EventHandler<PDFVisualPageClickEventArgs> PageDoubleClick;

PageNumberChanged

Gets or sets the event that is fired when the page number has changed.

public event EventHandler<PDFVisualPageEventArgs> PageNumberChanged;

PageRenderingCancelled

Gets or sets the event that is fired when the page stops displaying content.

public event EventHandler<PDFVisualPageEventArgs> PageRenderingCancelled;

PageRenderingCompleted

Gets or sets the event that is fired when the page content for the page visible area is displayed in full.

public event EventHandler<PDFVisualPageEventArgs> PageRenderingCompleted;

PageRenderingStarted

Gets or sets the event that is fired when a page begins to be displayed.

public event EventHandler<PDFVisualPageEventArgs> PageRenderingStarted;

Paint

public event PaintEventHandler Paint;

ParentChanged

public event EventHandler ParentChanged;

PreviewKeyDown

public event PreviewKeyDownEventHandler PreviewKeyDown;

QueryAccessibilityHelp

public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp;

QueryContinueDrag

public event QueryContinueDragEventHandler QueryContinueDrag;

RegionChanged

public event EventHandler RegionChanged;

Resize

public event EventHandler Resize;

RightToLeftChanged

public event EventHandler RightToLeftChanged;

SizeChanged

public event EventHandler SizeChanged;

StyleChanged

public event EventHandler StyleChanged;

SystemColorsChanged

public event EventHandler SystemColorsChanged;

TabIndexChanged

public event EventHandler TabIndexChanged;

TabStopChanged

public event EventHandler TabStopChanged;

TextChanged

public event EventHandler TextChanged;

Validated

public event EventHandler Validated;

Validating

public event CancelEventHandler Validating;

VisibleChanged

public event EventHandler VisibleChanged;

ZoomChanged

Gets or sets the event that is fired when the zoom has changed.

public event EventHandler<EventArgs> ZoomChanged;