New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

RadPdfViewer Object

This article lists the client-side API of RadPdfViewer and how to use it.

To use the API, you must first get a reference to the control's client-side object. For example:

JavaScript
var pdfViewerObject = $find("<%=RadPdfViewer1.ClientID %>");

RadPdfViewer is a server-side wrapper over the Kendo UI PdfViewer Widget. Thus, it exposes the API of the underlying Kendo widget. To get a reference to the Kendo widget instance, you can do either of the following:

  • Use the get_kendoWidget() method of the MS AJAX wrapper:

    JavaScript
      var pdfViewerObject  = $find("<%=RadPdfViewer1.ClientID %>"); //the standard script control object
      var kendoPdfViewerObject = pdfViewerObject.get_kendoWidget(); //the Kendo widget
  • Get the Kendo Widget in its usual way. Make sure to use the $telerik.$ jQuery reference:

    JavaScript
      var kendoPdfViewer = $telerik.$("#<%=RadPdfViewer1.ClientID %>").data("kendoPDFViewer"); //the jQuery selector must get the RadPdfViewer1 wrapper span element

In addition to using the Kendo method directly, you can also use their wrappers that follow the MS AJAX convention through the RadPdfViewer client object.

Table1: Client-side methods exposed by the MS AJAX RadPdfViewer object

NameParametersReturn TypeDescription
activatePageNumbernoneLoads and scrolls to the page by number.
addToolBarItemObjectnoneAdd new command to the nested in RadPdfViewer Toolbar widget. Accepts object with valid command configuration options.
disposenonenoneDisposes the PdfViewer client-side object (calls its underlying Kendo widget's destroy method). Once you call it, you will not be able to use the widget or control.
executeObjectnoneExecutes a command of the PDFViewer (calls its underlying Kendo widget's execute method). The available commands are: OpenCommand, PageChangeCommand, DownloadCommand, EnableSelectionCommandо, EnablePanCommand, ExportCommand, PrintCommand, OpenSearchCommand, ZoomCommand
fromFileStringnoneDisplays the file which path is passed as a parameter in the PDFViewer.
get_activePagenoneNumberReturns the selected page number in the viewer.
get_defaultPageSizenoneObjectReturns the default page size.
get_documentnoneObjectReturns a reference to the loaded document.
get_heightnoneNumberReturns the height of the PDFViewer.
get_kendoWidgetnoneobjectReturns a reference to the underlying Kendo PdfViewer widget.
get_pageContainernoneObjectReturns a reference to the current page container.
get_pagesnoneArrayReturns a list of the pages in the loaded document.
get_processornoneObjectReturns a reference to the current PDF proccessor instance.
get_toolBarnoneObjectReturns the a reference to the nested in the PdfViewer Kendo UI toolbar instance.
get_visiblenoneBooleanReturns a Boolean value indicating whether the PdfViewer is visible.
get_widthnoneNumberReturns the width of the PDFViewer.
get_zoomMaxnoneNumberReturns the maximum zoom that could be applied to the pages.
get_zoomMinnoneNumberReturns the minimum zoom that could be applied to the pages.
hidenonenoneHides the PdfViewer element.
hideToolBarnonenoneHides the element of the nested in the PdfViewer toolbar.
loadPageNumbernoneRenders page canvas by number.
repaintBooleannoneRepaints the control. The "force" argument determines whether the resizing routine should be executed even if the respective widget's outer dimensions have not changed.
set_activePageNumbernoneLoads and scrolls to the page by number.
set_heightNumbernoneSpecifies the height of the PDFViewer.
set_visibleBooleannoneShows/Hides the PdfViewer element.
set_widthNumbernoneSpecifies the width of the PDFViewer.
set_zoomMaxNumbernoneSpecifies the maximum zoom that could be applied to the pages.
set_zoomMinNumbernoneSpecifies the minimum zoom that could be applied to the pages.
shownonenoneShows the PdfViewer element.
showToolBarnonenoneShows the element of the nested in the PdfViewer toolbar.

See Also

In this article
See Also
Not finding the help you need?
Contact Support