$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
PDF Viewer WinForms Control
Display PDF documents directly in your Windows Forms application.
Home > WinForms UI Controls > User Manual > Program PDFViewer in C# in C#

PDF Viewer Customizing in C#.NET

KetticPDF Viewer Control contains convenient C# API of the KetticPDFViewerElement for the users to customize the control to their Windows Forms application. There are various methods available to the users to perform the customization of PDFViewer control, for example, the Page methods, the scrolling methods, the selection methods and the search methods. In the following tutorial, we are going through the process of implement these methods of PDFViewer control for C#.NET applications.

Customize Page Methods of PDFViewer Control

There are the PageUp, PageDown, GoToPage methods available to the users to customize the navigation of PDF document. The C# code below demonstrates how to implement these methods.
Furthermore, the KetticPDFViewer WinForms control offers the Scrolling method to set the scrolling position and scroll the PDF view with a specified offset. In addition, there is a ScrollingTo method available to scroll the PDF view to an exact position in the PDFViewer. The C# code below demonstrates how to customize these methods.

Set Text Selection for PDFViewer Component

To customize the text of a PDF document, we are able to use the several text methods below in the C# API of KetticPDFViewerElement to set the text selection, including the SelectAll method, the DeselectAll method, and the Select method. The C# code below demonstrates how to use these text selection methods.
In addition, there are several methods in the C# API for getting the text currently selected, including the GetSelectedText, GetSelectedTextAsync, and Copy methods. The KetticPDFViewer control uses the GetSelectedTextAsync method to get the text currently selected asynchronously and call the specified callback function and uses the Copy method to copy the current selection to the clipboard. The C# code sample below demonstrates how to use these methods.
KetticPDFViewer also offers methods to search text in a PDF document, such as the Find, FindPrevious, and SearchResult methods. The Find method is able to search text forwards, the FindPrevious method can search text backwards, and the SearchResult method can return the search result. The C# code sample below demonstrates how to use these methods.

Context Menu Customizing in KetticPDFViewer Control

KetticPDFViewer control contains a default context menu for the users to fast perform a set of commands. It also supports custom menu by changing the KetticContextMenu property of the KetticPDFViewer control for Windows Forms. The simple C# code snippet below shows how to set the context menu property.

this.ketticPdfViewer1.KetticContextMenu = this.ketticContextMenu1;
In addition, there is a DisplayMenu method available to display the context menu using C# code at a specific position. The C# code below demonstrates the specification.

private void buttonDisplayMenu_Click(object sender, EventArgs e)
this.ketticPdfViewer1.PdfViewerElement.DisplayMenu(new Point(80, 80));

Build Hyperlinks in PDF Document using KetticPDFViewer

KetticPDFViewer WinForms control includes an AnnotationClicked C# event for the users to customize the hyperlinks in a PDF document. The Annotations created by the event actually are hyperlinks and can lead the users to an external web page or to a different place in the document. The C# code below shows how to use the AnnotationClicked event.
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls