marginObject

Specifies the margins of the page (numbers or strings with units). Supported units are "mm", "cm", "in" and "pt" (default).

Example

<button class='export-doc k-button'>Export PDF with Custom Margins</button>
<div class="content">
  <p>This content will have custom margins on all sides.</p>
</div>
<script>
  $(".export-doc").click(function() {
    kendo.drawing.drawDOM($(".content"))
      .then(function(group) {
        return kendo.drawing.exportPDF(group, {
          margin: {
            top: "2cm",
            right: "1in", 
            bottom: "20mm",
            left: 72 // 72pt = 1 inch
          },
          paperSize: "A4"
        });
      })
      .done(function(data) {
        kendo.saveAs({
          dataURI: data,
          fileName: "CustomMargins.pdf"
        });
      });
  });
</script>

margin.bottom Number|String (default: 0)

The bottom margin. Numbers are considered as "pt" units.

margin.left Number|String (default: 0)

The left margin. Numbers are considered as "pt" units.

margin.right Number|String (default: 0)

The right margin. Numbers are considered as "pt" units.

margin.top Number|String (default: 0)

The top margin. Numbers are considered as "pt" units.

In this article
margin
Not finding the help you need?
Contact Support