paperSize Object (default: "auto")

Specifies the paper size of the PDF document. The default "auto" means paper size is determined by content.

The size of the content in pixels will match the size of the output in points (1 pixel = 1/72 inch).

Supported values:

  • A predefined size. The supported paper sizes are: A0-A10, B0-B10, C0-C10, Executive, Folio, Legal, Letter, Tabloid.
  • An array of two numbers specifying the width and height in points (1pt = 1/72in)
  • An array of two strings specifying the width and height in units. Supported units are "mm", "cm", "in" and "pt".

Example - set the paper size of the PDF document

<button class='export-doc k-button'>Export as PDF</button>
<div class="content">
  <div>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nam est justo, fermentum id nisl at, luctus tincidunt augue. Vestibulum dui lorem, imperdiet id condimentum vitae, rutrum sit amet velit. Curabitur neque arcu, tristique sit amet turpis eget, blandit accumsan velit. Praesent facilisis quam at mauris finibus, aliquet semper ligula viverra. Cras dolor diam, dignissim ut luctus vel, imperdiet in velit. Integer suscipit non leo eu commodo. Phasellus tempus mi sem, non faucibus metus semper ac. Etiam arcu nulla, laoreet ac risus sit amet, imperdiet condimentum diam. Fusce mollis porta arcu, id accumsan lectus tempor ut. Phasellus at risus justo. Integer quis vulputate enim
  </div>
</div>
<script>
  $(".export-doc").click(function() {
    // Convert the DOM element to a drawing using kendo.drawing.drawDOM
    kendo.drawing.drawDOM($(".content"))
      .then(function(group) {

      var content = new kendo.drawing.Group();
      content.append(group);

      return kendo.drawing.exportPDF(content,{
        paperSize: "A4",
        margin: "1cm"
      });
    })
      .done(function(data) {
      kendo.saveAs({
        dataURI: data,
        fileName: "Map.pdf",
        proxyURL: "https://demos.telerik.com/kendo-ui/service/export"
      });
    });
  });
</script>
In this article