changing page size on mPDF and getting browser to auto print PDF file on display
<p>i am using mPDF (<a href="http://mpdf.bpm1.com" rel="nofollow">http://mpdf.bpm1.com</a>) to create pdf receipts. </p>

<p>but at the moment they only display on a full A4 page. </p>

<p>i would like to resize them down to a reasonable size because we are using a epson tm-t88iv. this is the first dilemma i have. </p>

<p>the second problem i have involves invoking auto print on the printer attached. </p>

<p>i would like to do this when the form is processed (on the same page). </p>

<p>but im not sure how to implement this into the code i have right now:</p>

<p>any ideas or hints?</p>

<pre><code>  &lt;?php 

// post

$id = $_GET['id'];
$user = $_GET['user'];
$week = $_GET['week'];
$pRent = $_GET['pRent'];
$rentPaid = $_GET['rentPaid'];
$result = $_GET['result'];
$pDate = date("d/m/Y");

$html = '

&lt;style&gt;
@page {
 margin-top: 20px;
 margin-left: 20px;
}
&lt;/style&gt;

&lt;div style="text-align:center; font-family: Arial, Helvetica, sans-serif;"&gt;
        &lt;div style="border: 0px; padding: 0px; width: 175px; text-align:center;"&gt;
        &lt;img src="resources/speedline.png" width="161" height="58" /&gt;
        &lt;p style="font-weight: bold;" align="center"&gt;
        DRIVER '.$id.' RECEIPT&lt;/p&gt;    
  &lt;p style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;"&gt;'.$week.'&lt;/p&gt;
    &lt;span style="font-size: 10px;"&gt;PROCESSED BY '.$user.'&lt;/span&gt;&lt;p&gt;
          &lt;table width="100%" border="0" cellspacing="0" cellpadding="0" &gt;
  &lt;tr&gt;
    &lt;td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;"&gt;DATE PAID&lt;/td&gt;
    &lt;td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right"&gt;'.$pDate.'&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left"&gt;&lt;/td&gt;
    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;"&gt;TOTAL RENT&lt;/td&gt;
    &lt;td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right"&gt;£'.$pRent.'&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;"&gt;RENT PAID&lt;/td&gt;
    &lt;td style="font-size: 12px; font-family: Arial, Helvetica, sans-serif;" align="right"&gt;£'.$rentPaid.'&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left"&gt;&amp;nbsp;&lt;/td&gt;
    &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
    &lt;td align="left" style="font-weight: bold; font-family: Arial, Helvetica, sans-serif;"&gt;REMAINING&lt;/td&gt;
    &lt;td align="right" style="font-family: Arial, Helvetica, sans-serif;"&gt;£'.$result.'&lt;/td&gt;
  &lt;/tr&gt;
&lt;/table&gt;
&lt;br /&gt;
&lt;span style="font-size:8px"&gt;THANK YOU FOR YOUR PAYMENT. PLEASE KEEP THIS RECEIPT FOR FUTURE REFERENCE. YOU WILL BE ASKED TO PRESENT IT AS EVIDENCE OF PAYMENT MADE.&lt;/span&gt;
  &lt;/div&gt;';

//==============================================================
//==============================================================
//==============================================================
include("mpdf/mpdf.php");
$mpdf=new mPDF('UTF-8-s','');
$mpdf-&gt;WriteHTML($html);
$mpdf-&gt;Output();
exit;
//==============================================================
//==============================================================
//==============================================================
//==============================================================
//==============================================================
?&gt;
</code></pre>

<p>any help would be appreciated. many thanks and God bless!</p>
