FelixOngati / dompdf

Automatically exported from code.google.com/p/dompdf
0 stars 0 forks source link

dompdf issue : print preview showing fine but print come different margin setup #587

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've been using DomPDF within core php to generate a invoice with over 200 
pages of data. Within this there are many, many tables with multiple styles 
attached to them. my html and php code is below :

HTML code:

<!-- begin snippet: js hide: false -->

<!-- language: lang-html -->
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml">

    <head>

    <title>pdf test</title>

    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <style>
    @page
    {
        margin-left:10px;
        margin-top:10px;
        margin-right:10px;
        margin-bottom:0px; 

    }
    .Greek
    {
            font-family:symbol;
            color:#093;
            font-size:18px;
    }
    .blue {
    color:#0084cc;font-family:lucida calligraphy;text-transform:uppercase;font-size:14px;
    text-align: left; margin-left: 0px; padding-left: 0px;
    }
    .normal
    {
    font-family:lucida calligraphy;font-size:14px;
    }
    .green
    {
    color:#093;font-family:lucida calligraphy;text-transform:uppercase;font-size:14px;
    }
    </style>
    </head>

    <body style="margin:0 auto; padding-top:0px; width:100%;height:100%;">

    <table border="0" width="1180px" height="900" style="background-image:url(Certificatea4.jpg);background-repeat: no-repeat;" align="center">

      <tr>

        <td height="185px;" valign="top"><table width="100%" border="0">

         <tr>

        <td height="145px" width="100px">&nbsp; </td><td width="70px">&nbsp;</td><td width="600px">&nbsp;</td><td width="35px">&nbsp;</td><td>&nbsp;</td>

      </tr>

      <tr>

        <td>&nbsp;</td><td height="35px" style="font-family:Times New Roman; font-size:14px; font-weight:bold;">test: </td><td style="font-family:Times New Roman; font-size:14px;font-weight:bold;">test</td><td style="font-family:Times New Roman; font-size:14px; font-weight:bold;">Date:</td><td style="font-family:Times New Roman; font-size:14px;font-weight:bold;">date</td>

      </tr>

     </table></td>

      </tr>

       <tr>

        <td valign="middle" align="center" height="75px" style="font-family:Old English Text MT; font-size:36px;"></td>

      </tr>

      <tr>

        <td valign="top" align="center" height="360px" style="height:378px;">
    <br/>
        <table border="0" width="90%"><tr><td width="10%">&nbsp;</td><td style="font-size:13px; text-align:justify;line-height: 25px;">

        <span class="normal">this is test for a4 print</span><span class="green" align="left"> test I've been using DomPDF within CodeIgniter to generate a catalogue with over 200 pages of data. Within this there are many, many tables with multiple styles attached to them.</span>

    </td><td width="10%">&nbsp;</td></tr></table>

    </td>

      </tr>
      <tr>

        <td valign="top" height="39px" style="height:29px;"><table width="100%" border="0"><br/><br/><br/><br/><br/>

      <tr>

       <td width="130px">&nbsp;</td> <td valign="top" width="610px" style="font-family:Times New Roman; font-size:14px; font-weight:bold;"></td>

        <td valign="top" style="font-family:Times New Roman; font-size:14px; font-weight:bold;"></td>

      </tr>
     </table>

    </body>

    </html>
<!-- end snippet -->

PHP code:

    define("DOMPDF_ENABLE_HTML5PARSER", true);
    define("DOMPDF_ENABLE_REMOTE", true);
    include_once('dompdf/dompdf_config.inc.php');

    $dompdf=new DOMPDF();
    $dompdf->load_html($conv);
    $dompdf->set_paper('a4', 'landscape');
    $dompdf->render();
    $cid= "certificate.pdf";
    $pdf = $dompdf->output();

any one say how set exact what i viewed in browser print viewer print also like 
that.... very urgent

Original issue reported on code.google.com by seo.gmte...@gmail.com on 9 Jun 2015 at 6:08

GoogleCodeExporter commented 9 years ago
any one give ideaa......... very urgent.....

Original comment by seo.gmte...@gmail.com on 9 Jun 2015 at 6:10