# ASP.NET MVC PDFViewer Overview

The Telerik UI PDFViewer HtmlHelper for ASP.NET MVC is a server-side wrapper for the Kendo UI PDFViewer widget.

The PDFViewer displays PDF files in the browser and consists of a toolbar and a scrollable container that wraps the page elements. The default tools collection includes the `pager`, `open`, and `download` tools. For processing files, it supports the PDF.JS Processing and Telerik DPL Processing libraries. Among the key features the PDFViewer provides are the selection of a PDF processing library, a built-in paging mechanism, virtualization capabilities, a built-in default toolbar collection, and responsive capabilities and page scaling.

* [Demo page for the PDFViewer](https://demos.telerik.com/aspnet-mvc/pdfviewer/index)

## Initializing the PDFViewer

You can initialize the PDFViewer from HTML either by using [PDF.JS](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/overview#using-pdfjs) or [the Telerik Document Processing library](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/overview#using-telerik-document-processing).

### Using PDF.JS

The following example demonstrates how to initialize the PDFViewer by using [PDF.JS](https://mozilla.github.io/pdf.js/).

```C# Global.asax
    KendoMvc.Setup(options =>
    {
        options.RenderAsModule = true;
    });
```

```Razor HtmlHelper
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.3.136/pdf.mjs" type="module"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/4.3.136/pdf.worker.mjs" type="module"></script>
    <script src="https://code.jquery.com/jquery-3.7.1.min.js" type="module"></script>
    <script src="https://cdn.jsdelivr.net/npm/@progress/kendo-ui@2024.4.1112/umd/kendo.all.min.js" type="module"></script>
    <script src="https://cdn.jsdelivr.net/npm/@progress/kendo-ui@2024.4.1112/umd/kendo.aspnetmvc.min.js" type="module"></script>

    @(Html.Kendo().PDFViewer()
        .Name("pdfviewer") // The name of the PDFViewer is mandatory. It specifies the "id" attribute of the component.
        .PdfjsProcessing(pdf => pdf
            .File(Url.Content("~/Content/web/pdfViewer/sample.pdf"))
        )
        .Height(1200)
    )
```

### Using Telerik Document Processing

The following example demonstrates how to initialize the PDFViewer by using the [Telerik Document Processing library](https://docs.telerik.com/devtools/document-processing/introduction).

```Razor HtmlHelper
    @(Html.Kendo().PDFViewer()
        .Name("pdfviewer") // The name of the PDFViewer is mandatory. It specifies the "id" attribute of the widget.
        .DplProcessing(dpl => {
            dpl.Read(r => r.Url(Url.Action("GetInitialPdf", "PdfViewer")));
            dpl.Upload(upload => upload.Url(Url.Action("GetPdf", "PdfViewer")).SaveField("file"));
            dpl.LoadOnDemand(true);
        })
        .Toolbar(toolbar =>
            toolbar.Items(items =>
            {
                items.Add().Command("PageChangeCommand").Type("pager").Name("pager");
                items.Add().Name("spacer").Type("spacer");
                items.Add().Command("OpenCommand").Type("button").Name("open").Icon("folder-open");
            })
        )
        .Height(1200)
    )
```

## Functionality and Features

* [PDF.js Processing](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/pdfjs-processing)—You can configure the PDFViewer to use the PDF.js library for PDF processing and visualization.
* [DPL Processing](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/dpl-processing)—The component can use the Telerik Document Processing library to process and visualize a PDF document.
* [Toolbar and Tools](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/toolbar)—The PDFViewer offers diverse tools and commands.
* [Annotations](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/annotations)—You can highlight important text areas with different colors or add free text notes in the document.
* [Form Filling](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/form-filling)—You can import files containing PDF forms and fill in the input elements.
* [Events](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/events)—To control the behavior of the component upon user interaction, you can use the events that the component emits.
* [Accessibility](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/accessibility/overview)—The PDFViewer is accessible for screen readers, supports WAI-ARIA attributes, and delivers [keyboard shortcuts](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/accessibility/keyboard-navigation) for faster navigation.

## Next Steps

* [Getting Started with the PDFViewer](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/pdf/pdfviewer/getting-started)
* [Basic Usage of the PDFViewer HtmlHelper and TagHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/pdfviewer)
* [Using the PDFViewer with the Telerik Document Processing library (Demo)](https://demos.telerik.com/aspnet-mvc/pdfviewer/dpl-processing)

## See Also

* [Basic Usage of the PDFViewer for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/pdfviewer/index)

* [Using the API of the PDFViewer HtmlHelper for ASP.NET MVC (Demo)](https://demos.telerik.com/aspnet-mvc/pdfviewer/api)

* [Knowledge Base Section](https://www.telerik.com/aspnet-mvc/documentation/knowledge-base)
