php - HTML2PDF Generates Wrong Estructured PDF

9

Im using html2pdf to convert some dynamic html to pdf. My output is this.

session_start();   
ini_set('display_errors', 1);
error_reporting(E_ALL);
set_include_path(dirname(__FILE__)."/");
require 'html2pdf/html2pdf.class.php';
$html2pdf = new HTML2PDF('P','A4','es');
ob_end_clean();
$html2pdf->WriteHTML($pruebachidoone);

$html2pdf->Output("test.pdf", 'F');  //save pdf
$html2pdf->Output("test.pdf", 'I'); 

but it keeps me generating the pdf like this. (this is the firts page, the other 2 are kind of the same)(in the second page the images are so large, more than in the actual page).

https://scontent-b-lax.xx.fbcdn.net/hphotos-prn2/t1.0-9/q71/s720x720/10270720_10152420268666100_7548907389881154350_n.jpg

when the page look like this

https://scontent-b-lax.xx.fbcdn.net/hphotos-frc3/t1.0-9/10395852_10152420266381100_3150074092233664051_n.jpg

im going to append the html code. this html its what "pruebachidoone" contains.

  <!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>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Cotizacion</title>
<style type="text/css">
.top{
 width: 1036px;
 height:50px;
 background-color:#E33FA6;
 margin-bottom:0;
 -webkit-border-top-left-radius: 10px;
-webkit-border-top-right-radius: 10px;
-moz-border-radius-topleft: 10px;
-moz-border-radius-topright: 10px;
border-top-left-radius: 10px;
border-top-right-radius: 10px;
border-color:#000;
border-width:1px;
border-style:solid;
}
#base {
  HEIGHT: 1219px;
  WIDTH: 200px;
  background-color:#F4EAF4;
  top:10px;
  position:relative;
  margin-top: -10px;
  border-color:#000;
border-width:1px;
border-style:solid;
}
#tablageneral {
  position: relative;
  HEIGHT: 1209px;
  WIDTH: 1017px;
  border-color: #000;
  border: solid;
  border-width:1px;
  top:5px;
}
#tablageneral1 {
  position: relative;
  HEIGHT: auto;
  WIDTH: 900px;
  max-height: 190px;
  border-color: #000;
  border: solid;
  border-width:1px;
  top:5px;
  display:block;
}
.cuadrito {
  max-height:183px;
  display: block;
  word-wrap:break-word;
}
.cuadrito2 {
  max-height:96px;
  display: block;
  word-wrap:break-word;
}
.cuadrito3 {
  max-height:100px;
  display: block;
  word-wrap:break-word;
}
.cuadrito4 {
  max-height:101px;
  display: block;
  word-wrap:break-word;
}
.cuadrito5 {
  max-height:66px;
  display: block;
  word-wrap:break-word;
}
.cuadrito6 {
  max-height:256px;
  display: block;
  word-wrap:break-word;
}
.cuadrito7 {
  max-height:176px;
  display: block;
  word-wrap:break-word;
}
.cuadrito8 {
  max-height:230px;
  display: block;
  word-wrap:break-word;
}
.imagen {
  position:relative;
  margin:auto;
}
.texto1 {
  position:relative;
  top:-10px;
}
.titulos {
  font-size:16px;
  font-family: Arial, Helvetica, sans-serif;
  font-weight:bold;
 font-weight:
}
.informacion {
  font-size:12px;
  font-family:Arial, Helvetica, sans-serif;
}
.seleccion {
  font-size:14px;
  font-family:Arial, Helvetica, sans-serif;
}
</style>
</head>

<body>
<div ></div>
<div id="base">
 <table id="tablageneral" cellspacing="0" cellpadding="0" rules="all" align="center" bgcolor="#ffffff">
  <tr width="1016px" height="183px">
   <td width="533" height="183" align="center"><img alt="Logo Quality" border="0" src="http://democotiza.acesistemas.com/images/quality_cocinas_logo_chico.png" />
    <p align="center"><font size="3"><strong>SUCURSAL</strong></font>'. $sucursal . '<br />
     '.$dirsuc.' '.$numsuc.' <br />
     '.$colsuc.' '.$munsuc.'<br />
     <font size="2"><strong>Tel.- '.$telsuc.' </strong></font></p></td>
   <td width="483" height="183"><p align="center"><strong><font size="3">PRESUPUESTO</font></strong> <strong><font size="3">No&nbsp; </font></strong>&nbsp; '. $refcot.' <br/>
     <br />
     <font size="3"><strong>FECHA</strong></font> <strong><font size="3">COTIZACION </font></strong>&nbsp;'. $fechacot.' <br />
     <br />
     <strong><font size="3">TIPO</font></strong> <strong><font size="3">DE</font></strong> <strong><font size="3">COTIZACION</font></strong> '. $tipocot.'</p></td>
  </tr>
  <tr width="1016px" height="96px">
   <td width="533" height="96"><span ><u>DISEÑO ESPECIAL PARA:</u> </span><br />
    <span >&nbsp;&nbsp;&nbsp;&nbsp;'. $cte.''. $nomcliecot.' <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;'. $dirclicot.' <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;'. $colcliecot.' <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;'. $munclicot.' <br/>
    &nbsp;&nbsp;&nbsp;&nbsp;'. $edocot.'</span></td>
   <td width="483" height="96" valign="top"><span ><u>DATOS DE CONTACTO</u></span><br />
    <span >&nbsp;&nbsp;&nbsp;&nbsp;TELEFONO:  '. $telcliecot.'<br />
    &nbsp;&nbsp;&nbsp;&nbsp;CELULAR: '. $celcliecot.'<br />
    &nbsp;&nbsp;&nbsp;&nbsp;E-MAIL: '. $mailcliecot.'</span></td>
  </tr>
  <tr width="1016px" height="100px">
   <td width="533" height="100"><span ><u>MODELO: </u></span><span "seleccion">'. $modelo.'</span><br />
    <span >Otras Opciones:</span><br />
    <span > &nbsp;&nbsp;&nbsp;&nbsp;VERSATIL<br />
    &nbsp;&nbsp;&nbsp;&nbsp;LAMINADO PLASTICO<br />
    &nbsp;&nbsp;&nbsp;&nbsp;MDF<br />
    &nbsp;&nbsp;&nbsp;&nbsp;ITALIA IMPORTADO</span></td>
   <td width="483" height="100" valign="top"><span ><u>CUBIERTAS: </u></span><span >'. $cubierta.'</span><br />
    <span >Otras Opciones:</span><br />
    <span > &nbsp;&nbsp;&nbsp;&nbsp;FORMICA <br />
    &nbsp;&nbsp;&nbsp;&nbsp;GRANITO <br />
    &nbsp;&nbsp;&nbsp;&nbsp;SUP. SOLIDA </span></td>
  </tr>
  <tr width="1016px" height="101px">
   <td width="533" height="101"><span ><u>INTERIORES:</u></span><span >'. $maderas.'</span><br />
    <span >Otras Opiciones:</span><br />
    <span > &nbsp;&nbsp;&nbsp;&nbsp;CEDRO<br />
    &nbsp;&nbsp;&nbsp;&nbsp;MAPLE<br />
    &nbsp;&nbsp;&nbsp;&nbsp;ENCINO<br />
    &nbsp;&nbsp;&nbsp;&nbsp;NOGAL<br />
    </span></td>
   <td width="483" height="101" valign="top"><span ><u>EQUIPO ADICIONAL</u></span><br />
    <span >&nbsp;&nbsp;&nbsp;&nbsp;'. $equipo.'</span></td>
  </tr>
  <tr width="1016px" height="66px">
   <td width="533" height="66"><span ><u>MEDIDAS</u></span><br />
    <span >&nbsp;&nbsp;&nbsp;&nbsp;'. $medidas.'</span></td>
   <td width="483" height="66" valign="top"><span ><u>ACCESORIOS</u></span><br />
    <span >&nbsp;&nbsp;&nbsp;&nbsp;'. $accesorios.'</span></td>
  </tr>
  <tr width="1016px" height="256px">
   <td width="533" height="256" valign="top"><span ><u>PRECIOS</u></span><br />
    <br />
    <blockquote>
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >MUEBLES</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span > '. $pciomueble.' </span><br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >CUBIERTAS</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span >'. $pciocubierta.' </span><br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >EQUIPO</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span >'. $pcioequipo.' </span><br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >ACCESORIOS</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span >'. $pcioaccesorios.'</span> <br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >ADICIONALES</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span >'. $pcioadicionales.' </span><br />
    <br />
    <br />
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span >TOTAL</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span >'. $precio.'</span></blockquote>
    </td>
   <td width="483" height="256"><p align="center"><img alt="servcompleto" border="0" src="http://democotiza.acesistemas.com/include/include2/images/servcompleto.png" width="744" height="572" /></p></td>
  </tr>
  <tr width="1016px" height="176px">
   <td width="533" height="176"><span ><u>APLICA DESCUENTO POR FORMA DE PAGO</u></span><br />
    <span >Efectivo o 
    Cheque&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;10% Desc</span><br />
    <br />
    <span >Pago con Tarjeta&nbsp;a 6 Meses sin 
    Intereses&nbsp;&nbsp;&nbsp;&nbsp; 5% &nbsp;Desc</span><br />
    <br />
    <span >Pago con Tarjeta a 12 Meses sin 
    intereses&nbsp;&nbsp; 0%&nbsp; Desc</span><br />
    <br />
    <span >DESCUENTO UNICAMENTE EN MUEBLES</span></td>
   <td width="483" height="176" align="center"><span >CUALQUIER DUDA NO DUDE EN CONTACTARNOS</span><br />
    <span >ESTOY PARA SERVIRLE...</span><br />
    <br />
    <span >VENDEDOR:</span>&nbsp;&nbsp;'. $vend.'&nbsp;
    <span >TEL:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'. $telvend.'<br />
    <span >CEL:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'. $celvend.' </td>
  </tr>
  <tr width="1016px" height="200px">
   <td width="auto" height="200" colspan="2" align="center"><span ><u>SUCURSALES</u></span><br />
    <table id="tablageneral1" cellspacing="0" cellpadding="0" rules="all" align="center" bgcolor="#ffffff">
     <tr>
      <td width="300px" valign="top"><span ><u><b>QUALITY GONZALITOS</b></u> <br />
       AVE.GONZALITOS No.210 COL VISTA HERMOSA<br />
       MONTERREY N.L. C.P.64620<br />
       TEL 83486700 83482900</span></td>
      <td width="300px" valign="top"><span ><u><b>QUALITY LA FE</b></u> <br />
       ROMULO GARZA # 101 FRACC. DEL LAGO <br />
       SAN NICOLAS DE LOS GARZA N.L. C.P.66477 <br />
       TEL 83219191</span></td>
      <td width="300px" valign="top"><span > <u><b>QUALITY MADERO</b></u> <br />
       AVE MADERO No.1254 ZONA CENTRO <br />
       MONTERREY N.L. C.P.64000 <br />
       TEL 83726696 83754319 </span></td>
     </tr>
     <tr>
      <td width="300px" valign="top"><span ><u><b>QUALITY SENDERO</b></u> <br />
       AVE SENDERO # 442 LOCAL 1 Y 2 COL. NOGALERA<br />
       ESCOBEDO NUEVO LEON <br />
       TEL 80582280 </span></td>
      <td width="300px" valign="top"><span ><u><b>QUALITY SUC.VICTORIA</b></u> <br />
       CALLE 22 #513 ENTRE BRAVO Y ALLENDE<br />
       COL CENTRO CD VICTORIA TAMPS.<br />
       TEL 83431 24840 y 83431 24850</span></td>
      <td width="300px" valign="top"><span ><u><b>QUALITY CONTRY</b></u> <br />
       AVE REVOLUCION No.1206 COL CONTRY MONTERREY N.L.<br /> 
        C.P.64845<br />
       TEL 8349 5858 83496060</span></td>
     </tr>
    </table></td>
  </tr>
 </table>
</div>
</body>
</html>

People are also looking for solutions to the problem: php - Curl error 6 couldn't resolve host

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.