php - HTML2PDF Generates Wrong Estructured PDF
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).
when the page look like this
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 </font></strong> '. $refcot.' <br/>
<br />
<font size="3"><strong>FECHA</strong></font> <strong><font size="3">COTIZACION </font></strong> '. $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 > '. $cte.''. $nomcliecot.' <br/>
'. $dirclicot.' <br/>
'. $colcliecot.' <br/>
'. $munclicot.' <br/>
'. $edocot.'</span></td>
<td width="483" height="96" valign="top"><span ><u>DATOS DE CONTACTO</u></span><br />
<span > TELEFONO: '. $telcliecot.'<br />
CELULAR: '. $celcliecot.'<br />
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 > VERSATIL<br />
LAMINADO PLASTICO<br />
MDF<br />
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 > FORMICA <br />
GRANITO <br />
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 > CEDRO<br />
MAPLE<br />
ENCINO<br />
NOGAL<br />
</span></td>
<td width="483" height="101" valign="top"><span ><u>EQUIPO ADICIONAL</u></span><br />
<span > '. $equipo.'</span></td>
</tr>
<tr width="1016px" height="66px">
<td width="533" height="66"><span ><u>MEDIDAS</u></span><br />
<span > '. $medidas.'</span></td>
<td width="483" height="66" valign="top"><span ><u>ACCESORIOS</u></span><br />
<span > '. $accesorios.'</span></td>
</tr>
<tr width="1016px" height="256px">
<td width="533" height="256" valign="top"><span ><u>PRECIOS</u></span><br />
<br />
<blockquote>
<span >MUEBLES</span>; <span > '. $pciomueble.' </span><br />
<br />
<span >CUBIERTAS</span>; <span >'. $pciocubierta.' </span><br />
<br />
<span >EQUIPO</span>; <span >'. $pcioequipo.' </span><br />
<br />
<span >ACCESORIOS</span>; <span >'. $pcioaccesorios.'</span> <br />
<br />
<span >ADICIONALES</span>; <span >'. $pcioadicionales.' </span><br />
<br />
<br />
<span >TOTAL</span>; <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
10% Desc</span><br />
<br />
<span >Pago con Tarjeta a 6 Meses sin
Intereses 5% Desc</span><br />
<br />
<span >Pago con Tarjeta a 12 Meses sin
intereses 0% 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> '. $vend.'
<span >TEL:</span> '. $telvend.'<br />
<span >CEL:</span> '. $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>