title: How can I print an image in a web page, fitting the paper size (A3, A4, A5, etc)?
body: <p>I am currently using IE9 and media queries and I have no need to have this working from other browsers.</p>
  
  <p>I tried using a set of rules like:</p>
  
  <pre><code>@page {
      size: auto;
      margin: 10mm 10mm 10mm 10mm;
  }
  </code></pre>
  
  <p>//... rules to match the millimiters of all the A formats (A0, A1, A2, etc) including margins and tolerance</p>
  
  <pre><code>/* A4 210x297 mm */
  @media print and (min-height: 266mm) and (max-height: 288mm) and
      (min-width: 179mm) and (max-width: 201mm) {
      .img_port {
          height: 267mm !important;
      }
  }
  </code></pre>
  
  <p>// ...</p>
  
  <p>it seems to be working but it is not reliable because the size height and the width values passed to the CSS seems to depend on the printer even if the A4 format is always selected.</p>
  
  <p>What I want to ask is if there is any other possible way to obtain the same result (fitting the image on one page according to the paper size).</p>
  
  <p>Thank you in advance.</p>