New to Kendo UI for jQuery? Start a free 30-day trial

Specifies the default file to be displayed.

pdfjsProcessing.file

Object | String

Default: ""

<div id="pdfviewer"></div>
<script type="module">
$("#pdfviewer").kendoPDFViewer({
    pdfjsProcessing: {
        file: {
            url: "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf"
        }
    }
});
</script>

Specifies if the Adobe CMaps are binary packed. Further info in the PDF.js API ref.

<div id="pdfviewer"></div>
<script type="module">
$("#pdfviewer").kendoPDFViewer({
    pdfjsProcessing: {
        file: {
            cMapPacked: true,
            url: "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf"
        }
    }
});
</script>

Specifies the URL where the predefined Adobe CMaps are located. Further info in the PDF.js API ref.

<div id="pdfviewer"></div>
<script type="module">
$("#pdfviewer").kendoPDFViewer({
    pdfjsProcessing: {
        file: {
            cMapUrl: "https://cdn.jsdelivr.net/npm/pdfjs-dist@3.4.120/cmaps/",
            url: "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf"
        }
    }
});
</script>

pdfjsProcessing.file.data

Blob | byte[] | String

Specifies the data to be passed to the pdfjs processor. Accepts blob, byte array or base64 string.

<div id="pdfViewer"></div>
<script type="module">
  var request = new XMLHttpRequest();
  request.open('GET', "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf", true);
  request.responseType = 'blob';
  request.onload = function() {
    var reader = new FileReader();
    reader.readAsDataURL(request.response);
    reader.onload =  function(e){
      $("#pdfViewer").kendoPDFViewer({
        pdfjsProcessing: {
          file: {
            //retain the base64 data
            data: e.target.result.split(",")[1]
          }
        },
        width: "100%",
        height: 1200
      }).getKendoPDFViewer();
    };
  };
  request.send();
</script>

Specifies the url to be passed to the pdfjs processor.

<div id="pdfviewer"></div>
<script type="module">
    $("#pdfviewer").kendoPDFViewer({
        pdfjsProcessing: {
            file: {
                url: "https://demos.telerik.com/kendo-ui/content/web/pdfViewer/sample.pdf"
            }
        }
    });
</script>