Advertisement
Guest User

Untitled

a guest
Dec 14th, 2017
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. <?php
  2.   $stylesheet = "
  3.     body      { font-family: verdana; font-size: 8px; }
  4.    .borda     { border: 1px solid black; }
  5.    .titulo    { font-weight: bold;  font-size: 10px; }
  6.    .endereco  { font-family: arial; font-size: 12px; }
  7.    .caixa     { border: 1px solid black; padding: 2px; width: 100px; }
  8.    
  9.    table.bordasimples { border-collapse: collapse; }
  10.    table.bordasimples tr th { border:1px solid #fff; background-color: #ccc; }
  11.    
  12.    .cabecalho { font-weight: bold; background-color: #ccc; }
  13.  ";
  14.  
  15. $html = '<!DOCTYPE html>
  16. <html>
  17.  <head>
  18.    <meta charset="utf-8">
  19.  </head>
  20.  <body>
  21.  
  22. <table width="100%">
  23.  <tr>
  24.    <td width="50%" height="1124px" align="center" valign="top">'.$dados.'</td>
  25.    <td align="center" valign="top">'.$dados.'</td>
  26.  </tr>
  27. </table>
  28.  
  29. </body>
  30. </html>';
  31.  
  32.  // Criar o PDF
  33.  $mpdf=new mPDF('c','A4','','',5,5,5,5,5,5);
  34.  $mpdf->SetProtection(array('print'));
  35.  $mpdf->SetTitle("Intercell Eletrônicos");
  36.  $mpdf->SetAuthor("ipeagenciadigital.com.br");
  37.  $mpdf->SetDisplayMode('fullpage');
  38.  $mpdf->WriteHTML($stylesheet,1);
  39.  $mpdf->WriteHTML($html,2);
  40.  $mpdf->Output();
  41.  exit;
  42.  
  43. exit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement