We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the PDF viewer default toolbar?

Platform: ASP.NET Web Forms |
Control: PdfViewer |
Published Date: May 23, 2018 |
Last Revised Date: June 20, 2019

This article explains how to customize the default toolbar of PDF viewer in ASP.NET. Customization is the process of designing your own toolbar using the exposed public APIs in PDF viewer.


The following code example illustrates how to create custom toolbar for the PDF viewer with the given items:

  • Previous
  • Next
  • ZommIn
  • ZoomOut
  • FitToPage
  • FitToWidth
  • Download
  • Print



//creating custom toolbar
<div id="toolbarDiv" style="height:38px;width:100%;border:solid black 1px" class="toolbarclass " role="toolbar">
              <div style="float:left; padding:5px;">         
                    <div class="e-pdfviewer-icon e-pdfviewer-gotoprevious" id="viewer-previous" onclick="callClientSideMethod('previous')"></div>
                    <div class="e-pdfviewer-icon e-pdfviewer-gotonext" id="viewer-next" onclick="callClientSideMethod('next')"></div>
                    <div class="e-pdfviewer-icon e-pdfviewer-zoomin" id="viewer-zoomin" onclick="callClientSideMethod('zoomin')"></div>
                    <div class="e-pdfviewer-icon e-pdfviewer-zoomout"id="viewer-zoomout" onclick="callClientSideMethod('zoomout')"></div>
                    <div class="e-pdfviewer-icon e-pdfviewer-fitwidth" id="viewer-fitwidth" onclick="callClientSideMethod('fitwidth')"></div>
                    <div class="e-pdfviewer-icon e-pdfviewer-fitpage" id="viewer-fitpage" onclick="callClientSideMethod('fitpage')"></div>                          
            <div style="float:right; padding:5px;">
               <div class="e-pdfviewer-icon e-pdfviewer-print" id="viewer-print" onclick="callClientSideMethod('print')"></div>
                <div class="e-pdfviewer-icon e-pdfviewer-download" id="viewer-download" onclick="callClientSideMethod('download')"></div>



Syncfusion PDF viewer toolbar icons are used for customization in the previous code, your own icons can be used for custom toolbar.


$(function () {
            var pdfviewer = $("#PdfViewer1").data("ejPdfViewer");
//hide the default toolbar of the PDF Viewer
              function callClientSideMethod(apiName) {
             var _ejPdfViewer = $("#PdfViewer1").data("ejPdfViewer");
//call the client-side events
            switch (apiName) {
                case 'print':
                case 'zoomin':
                case 'zoomout':
                case 'fitpage':
                case 'fitwidth':
                case 'previous':
                case 'next':
                case 'download':



2X faster development

The ultimate ASP.NET Web Forms UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon