New to Telerik UI for ASP.NET MVC? Download free 30-day trial

Toolbar and Tools

Internally, the PDFViewer uses the Telerik UI for ASP.NET MVC Toolbar and provides a set of default tools and corresponding commands in its toolbar.

This approach enables you to use the ToolBar client-side API and perform all available customizations.

You can control the number and type of the rendered tools by initializing the items collection only with the tools that you require. For the full list of configuration options, refer to the client-side API of the ToolBar items.

The toolbar collection includes the following built-in tools:

  • pager
  • zoom
  • zoomInOut
  • toggleSelection
  • search
  • open
  • download
  • print

Running an Adblock extension in Chrome might treat the new browser tab for the print dialog as a potential ad and block it.

The zoom, zoomInOut, toggleSelection, search and print tools are available only with PDFjs processing.

The following example demonstrates basic configuration options for the PDFViewer toolbar tools. You can also add spacer elements, in order to group a preferable set of tools.

      @(Html.Kendo().PDFViewer().Name("pdfviewer")
        .Toolbar(toolbar =>
            toolbar.Items(items =>
            {
                items.Add().Name("pager");
                items.Add().Name("spacer");
                items.Add().Name("zoom");
                items.Add().Name("zoomInOut");
                items.Add().Name("toggleSelection");
                items.Add().Name("search");
                items.Add().Name("open");
                items.Add().Name("download");
                items.Add().Name("print");
            })
        )
    )

You can also use the add and remove client-side API methods to programmatically manage the rendered tools in the PDFViewer.

    @(Html.Kendo().PDFViewer()
        .Name("pdfviewer")     
    )
    <script>    
      var pdfviewer = $("#pdfViewer").getKendoPDFViewer();
      var printToolElement = $(".k-toolbar").find('a[title="Print"]');
      pdfviewer.toolbar.remove(printToolElement);
    </script>

See Also

In this article