title: Export to PDF increase number of items per page
body: <p>I have a grid control which I wish to export the content of. Upon initialisation, the <code>pageSize</code> attribute is set to 10 items however I want to increase the number of items per page during <code>exportToPDF</code>. </p>
  
  <p>I have tried to modify the <code>pageSize</code> of the <code>dataSource</code> prior to carrying out the export but this seems to have no effect on the end product.</p>
  
  <pre><code>var grid = $("#grid").data("kendoGrid");                                    
  var filter = grid.dataSource.filter;
  grid.dataSource.query({
      filter: filter,
      pageSize: 20, // has no effect on the exported PDF
      page: 1,
      group: [{
          field: "groupField1",
          dir: "asc"
      }, {
          field: "groupField2",
          dir: "asc"
      }, {
          field: "groupField3",
          dir: "asc"
      }]
  });
  
  var progress = $.Deferred();
  grid._drawPDF(progress)
      .then(function (root) {
          return kendo.drawing.exportPDF(root, { forcePageBreak: ".page-break", multiPage: true });
      })
      .done(function (dataURI) {
          // ... do some manual manipulation of dataURI
          kendo.saveAs({
              dataURI: manipualtedDataURI
          });
  progress.resolve();
  </code></pre>
  
  <p>Is there something I am missing so I can display more items on each page of the PDF export?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Including my grid definition with the <code>pdfExport</code> function suggested by the below answer (which never gets called):</p>
  
  <pre><code>var grid = $("#reportGrid").kendoGrid({                        
      pdf: {
          allPages: true,
          avoidLinks: true,
          repeatHeaders: true,            
          template: kendo.template($("#page-template").html()),
          scale: 0.7,
          margin: { top: "2.5cm", right: "1cm", bottom: "1.5cm", left: "1cm" },
          paperSize: "A4",
          landscape: true
      },
      // *this function is not getting called*
      pdfExport: function(e) {
          e.sender.dataSource.pageSize(10);
          e.promise.done(function() {
              e.sender.dataSource.pageSize(20);
          });
      },
      toolbar: kendo.template($("#template").html()),
      ...
  });    
  </code></pre>
  
  <p>Note: A template is used to include a header / footer on each page of the PDF export.</p>
  
  <p>Another note: 'Manual manipulation of dataURI' includes going out to the server to perform a merge with another PDF file, so I cannot use the default export via the grid :(</p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p>I have extended the <a href="http://dojo.telerik.com/UzOXO/7" rel="nofollow noreferrer">Dojo</a> example from @R.K.Saini's answer to use the method by which I need to generate the PDF export (as per original post). 
  The snippet logs the URI of the grid being exported and when the <code>pdfExport</code> function is called.  As you will see, when using the built in grid 'Export to PDF' button, the <code>pdfExport</code> function is triggered but when using the additional button below the grid, it is not.</p>