Customizing the Viewer Layout

The DynamicPDF Viewer provides the following three controls for customizing a Viewer control.

NOTE: see the Overview topic for more on these elements.

Default Behaviour

When adding a PdfViewer control to a Windows Form, the PdfViewer contains a PdfToolStrip and PdfNavigationPanel by default. The PdfToolStrip is across the PdfViewer control's top while the PdfNavigationPanel runs along the PdfViewer control's left and expands to the right. The default configuration of these three controls provide the behavior expected of other PDF viewers.

Hiding the Default NavigationPanel or ToolStrip

Hide the default PdfNavigationPanel or PdfToolStrip by setting the ShowNavigationPanel property or ShowToolStrip property to false . The following C# and VB .NET code illustrate.

myPdfViewer.ShowNavigationPanel = false;
myPdfViewer.ShowToolStrip = false;        
MyPdfViewer.ShowNavigationPanel = False
MyPdfViewer.ShowToolStrip = False  

Adding an Additional PdfNavigationPanel or PdfToolStrip

Add additional instances of the PdfNavigationPanel or PdfToolStrip to a PdfViewer by using the AssociateToPdfViewer method to create the necessary PdfViewer association, as the following two code examples illustrate.


Disassociating a PdfNavigationPanel or PdfToolStrip

Disassociate a PdfNavigationPanel or PdfToolStrip from its associated PdfViewer by passing a null or empty value to the relevant control's AssociateToPdfViewer method . Note that you are not required to disassociate a control from a PdfViewer instance. When a PDFViewer is disposed, any associated PdfToolStrip or PdfNavigationPanel is automatically detached from the PdfViewer and also disposed.

Customizing a PdfToolStrip

Adding, modifying, and removing PdfToolStripItems is accomplished the same as for other .NET toolstrip controls (in fact, the PdfToolStrip contains a .NET ToolStrip). Item properties are accessed, added, and removed using the Items collection within a ToolStrip.

The following example illustrates removing a Print button from a PdfToolStrip.

Print Button pdfToolStrip1.ToolStrip.Items[2].Visible = false; 
Section Divider pdfToolStrip1.ToolStrip.Items[3].Visible = false;       
Print Button pdfToolStrip1.ToolStrip.Items[2].Visible = False
Section Divider pdfToolStrip1.ToolStrip.Items[3].Visible = False  

Customizing a PdfNavigationPanel

The PdfNavigationPanel is also customizable and allows accomplishing the following tasks.

For example, the following code illustrates a PdfNavigationPanel that displays only thumbnails and is also expanded by default.

pdfViewer1.InitialVisibleNavigationPane = ceTe.DynamicPDF.Viewer.NavigationPane.PageThumbnail; 
pdfNavigationPanel1.ShowBookmarkIcon = false;
MyPdfViewer1.InitialVisibleNavigationPane = ceTe.DynamicPDF.Viewer.NavigationPane.PageThumbnail 
MyPdfNavigationPanel1.ShowBookmarkIcon = False

In this topic