title: jquery print set pages per sheet
body: <p>I am working on an asp.net project. in my current page, I need to print an image, I used jquery to print this, my code is below.</p>
  
  <pre><code> function VoucherSourcetoPrint(source) {
          var width = $("#imgWidth").val();
          var height = $("#imgHeight").val();
          return "&lt;html&gt;&lt;head&gt;&lt;script&gt;function step1(){\n" +
                  "setTimeout('step2()', 10);}\n" +
                  "function step2(){window.print();window.close()}" +
                  "\n&lt;\/script&gt;&lt;/head&gt;&lt;body onload='step1()'&gt;\n" +
                  "&lt;img src='" + source + "' style='width: " + width + "px; height: " + height + "px;' /&gt;&lt;/body&gt;&lt;/html&gt;";
      }
  
      function VoucherPrint(source) {
          source = $('#imgCtrl').attr('src');
  
          Pagelink = "about:blank";
          var pwa = window.open(Pagelink, "_new");
          pwa.document.open();
          pwa.document.write(VoucherSourcetoPrint(source));
          pwa.document.close();
      }
  </code></pre>
  
  <p>As you can see the height and width are taken from textboxes. after calling VoucherPrint function it shows print dialogue as below,</p>
  
  <p><a href="https://i.stack.imgur.com/MRS4B.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MRS4B.png" alt="enter image description here"></a></p>
  
  <p>So I am trying to achieve some things,</p>
  
  <ol>
  <li>Remove header and footer using code</li>
  <li>increase no of print, ie no of images per page using code? </li>
  </ol>
  
  <p>is there any way to achieve these? through jquery or CSS?</p>