PDFJS Processing

The PDFViewer uses the pdf.js library by default, if no processing configuration is defined. PDF.JS is an open-source project developed by Mozilla.

Basic Configuration

PDF.JS Processing requires pdfjs lib scripts added to the page.

An example of a PDFViewer widget configured to use PDF.JS Processing.

Example
    <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.js"></script>
    <script>
        window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
    </script>

    @(Html.Kendo().PDFViewer()
        .Name("pdfviewer")
        .PdfjsProcessing(pdf => pdf
            .File(Url.Content("~/Content/web/pdfViewer/sample.pdf"))
        )
        .Height(1200)
    )

Troubleshooting

Important

PDF.JS Processing is not supported in IE9

PDF.JS requires additional configuration, to work properly in IE.

Example
<script>
    // The workerSrc property should be specified for IE support
    window.pdfjsLib.GlobalWorkerOptions.workerSrc = 'https://cdnjs.cloudflare.com/ajax/libs/pdf.js/2.2.2/pdf.worker.js';
</script>

See Also

For runnable examples on Kendo UI PDFViewer, refer to the Telerik UI for ASP.NET MVC Demos site.

In this article
Not finding the help you need? Improve this article