title: DomPDF - Changing the point/pixel ratio
body: <p>I'm trying to use <a href="https://code.google.com/p/dompdf/" rel="nofollow noreferrer">DomPDF</a> to generate a PDF out of some HTML. I need the page to be 20mm x 20mm, so I use the following:</p>
  
  <pre><code>CPDF_Adapter::$PAPER_SIZES['my_square_page'] = array(0, 0, 566.929134, 566.929134);
  $dompdf-&gt;set_paper('my_square_page','portrait');
  </code></pre>
  
  <p>It works properly, if I check the PDF properties the size is ok. The HTML that will appear in the PDF has a container <code>div</code> of 490x490px. This size cannot be changed, as the elements inside that <code>div</code> are absolutely positioned.</p>
  
  <p>The problem, then, is that in the generated PDF the <code>div</code> <strong>does not cover the entire page</strong>. I've tried setting the DPI, using different values in</p>
  
  <pre><code>def("DOMPDF_DPI", 150);
  </code></pre>
  
  <p>But it does not seem to make any difference at all. The output I get is this (gray borders are from the PDF reader):</p>
  
  <p><img src="https://i.stack.imgur.com/hsnf8.png" alt="enter image description here"></p>
  
  <p>I've tried setting the <code>width</code> and <code>height</code> of <code>body</code> and <code>html</code> in the CSS of the content, but it does not work.</p>
  
  <p>You can check the <a href="http://pastebin.com/G4j4CQu8" rel="nofollow noreferrer">source code of my sample case here</a>.</p>