Toolbar and Tools

Internally, the PDFViewer uses the Telerik UI for ASP.NET Core 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
  • toggleSelection
  • search
  • open
  • download
  • print

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("toggleSelection");
                items.Add().Name("spacer");
                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
Not finding the help you need? Improve this article