Silk skin

PdfViewer - Client-side Events

Event log

Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

RadPdfViewer exposes the following client-side events:

  • OnInitialize—Fired just before the RadPdfViewer client-side object is initialized.
  • OnLoad—Fired when RadPdfViewer is initialized.
  • OnRender—Fired when a page is rendered.
  • OnOpen—Fired when a PDF is opened in the viewer.
  • OnError—Fired when an error is encountered. By default, a dialog is shown with error message (unless the event is prevented). Cancelable.
  • DefaultCS.aspx
  • DefaultCS.aspx.cs
  • scripts.js
<%@ Page Language="c#" AutoEventWireup="true"  Inherits="Telerik.Web.Examples.PdfViewer.ClientSideEvents.DefaultCS" CodeFile="DefaultCS.aspx.cs" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="qsf" Namespace="Telerik.QuickStart" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <script type="text/javascript" src=""></script>
    <script src="scripts.js"></script>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
    <script type="text/javascript">
        window.pdfjsLib.GlobalWorkerOptions.workerSrc = '';
    <div class="demo-container size-wide no-bg" runat="server">
        <telerik:RadPdfViewer runat="server" ID="RadPdfViewer2" Height="550px" Width="100%" Scale="0.9">
            <ClientEvents OnInitialize="onInitialize" OnLoad="onLoad" OnRender="onRender" OnOpen="onOpen" OnError="onError" />
            <PdfjsProcessingSettings File="../Document.pdf"></PdfjsProcessingSettings>
    <qsf:EventLogConsole runat="server" ID="EventLogConsole1" AllowClear="true"></qsf:EventLogConsole>


Support & Learning Resources

Find Assistance

Help Us Improve

Was this example helpful?