Articles in this section
Category / Section

How to add fitpage and fitwidth functionalities while using Custom Toolbar?

1 min read

Essential PdfViewer Custom Toolbar sample does not contain fitpage and fitwidth functionality, by default. You can add the fitpage and fitwidth functions programmatically in Custom Toolbar sample by setting the ZoomMode property for PdfViewer control.

The following code example helps you add fitpage and fitwidth functionality in Custom Toolbar sample.

C#

/// <summary>
/// Handles FitPage Functionality.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void fitPage_Click(object sender, RoutedEventArgs e)
        {
            if (pdfViewerControl.ZoomMode != ZoomMode.FitPage)
                pdfViewerControl.ZoomMode = ZoomMode.FitPage;
        }
/// <summary>
/// Handles FitWidth Functionality.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void fitWidth_Click(object sender, RoutedEventArgs e)
        {
            if (pdfViewerControl.ZoomMode != ZoomMode.FitWidth)
                pdfViewerControl.ZoomMode = ZoomMode.FitWidth;
        }

Sample:

http://www.syncfusion.com/downloads/support/directtrac/general/PdfViewerControlCustomToolbar1469235419.zip

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied