HTML2PDF生成错误的Estructured PDF

时间:2014-05-22 15:23:29

标签: php html pdf html2pdf

我使用html2pdf将一些动态html转换为pdf。我的输出就是这个。

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'); 

但它让我像这样生成pdf。 (这是第一页,其他两个是相同的)(在第二页中,图像是如此之大,比实际页面更多)。

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

当页面看起来像这样

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

我要附加html代码。这个html是什么" pruebachidoone"包含。

    <!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 class="top"></div>
<div id="base">
  <table id="tablageneral" cellspacing="0" cellpadding="0" rules="all" align="center" bgcolor="#ffffff">
    <tr  width="1016px" height="183px">
      <td class="cuadrito" width="533" height="183" align="center"><img class="imagen" alt="Logo Quality" style="HEIGHT: 101px; WIDTH: 226px;  position:relative;" border="0" src="http://democotiza.acesistemas.com/images/quality_cocinas_logo_chico.png" />
        <p class="texto1" 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 class="cuadrito2" width="533" height="96"><span class="titulos" ><u>DISEÑO ESPECIAL PARA:</u> </span><br />
        <span  class="informacion">&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 class="titulos"><u>DATOS DE CONTACTO</u></span><br />
        <span class="informacion">&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 class="cuadrito3" width="533" height="100"><span class="titulos"><u>MODELO: </u></span><span class="class""seleccion">'. $modelo.'</span><br />
        <span class="informacion">Otras Opciones:</span><br />
        <span class="seleccion"> &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 class="titulos"><u>CUBIERTAS: </u></span><span class="seleccion">'. $cubierta.'</span><br />
        <span class="informacion">Otras Opciones:</span><br />
        <span class="seleccion"> &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 class="cuadrito4" width="533" height="101"><span class="titulos"><u>INTERIORES:</u></span><span class="seleccion">'. $maderas.'</span><br />
        <span class="informacion">Otras Opiciones:</span><br />
        <span class="seleccion"> &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 class="titulos"><u>EQUIPO ADICIONAL</u></span><br />
        <span class="informacion">&nbsp;&nbsp;&nbsp;&nbsp;'. $equipo.'</span></td>
    </tr>
    <tr width="1016px" height="66px">
      <td class="cuadrito5" width="533" height="66"><span class="titulos"><u>MEDIDAS</u></span><br />
        <span class="informacion">&nbsp;&nbsp;&nbsp;&nbsp;'. $medidas.'</span></td>
      <td  width="483" height="66" valign="top"><span class="titulos"><u>ACCESORIOS</u></span><br />
        <span class="informacion">&nbsp;&nbsp;&nbsp;&nbsp;'. $accesorios.'</span></td>
    </tr>
    <tr width="1016px" height="256px">
      <td class="cuadrito6" width="533" height="256" valign="top"><span class="titulos"><u>PRECIOS</u></span><br />
        <br />
        <blockquote>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">MUEBLES</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion"> '. $pciomueble.' </span><br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">CUBIERTAS</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion">'. $pciocubierta.' </span><br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">EQUIPO</span>;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion">'. $pcioequipo.' </span><br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">ACCESORIOS</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion">'. $pcioaccesorios.'</span> <br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">ADICIONALES</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion">'. $pcioadicionales.' </span><br />
        <br />
        <br />
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="seleccion">TOTAL</span>;&nbsp;&nbsp;&nbsp;&nbsp; <span class="informacion">'. $precio.'</span></blockquote>
        </td>
      <td  width="483" height="256"><p align="center"><img alt="servcompleto" style="HEIGHT: 188px; WIDTH: 255px" 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 class="cuadrito7" width="533" height="176"><span class="titulos"><u>APLICA DESCUENTO POR FORMA DE PAGO</u></span><br />
        <span class="seleccion">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 class="seleccion">Pago con Tarjeta&nbsp;a 6 Meses sin 
        Intereses&nbsp;&nbsp;&nbsp;&nbsp; 5% &nbsp;Desc</span><br />
        <br />
        <span class="seleccion">Pago con Tarjeta a 12 Meses sin 
        intereses&nbsp;&nbsp; 0%&nbsp; Desc</span><br />
        <br />
        <span class="seleccion">DESCUENTO UNICAMENTE EN MUEBLES</span></td>
      <td  width="483" height="176" align="center"><span class="titulos">CUALQUIER DUDA NO DUDE EN CONTACTARNOS</span><br />
        <span class="titulos">ESTOY PARA SERVIRLE...</span><br />
        <br />
        <span class="seleccion">VENDEDOR:</span>&nbsp;&nbsp;'. $vend.'&nbsp;
        <span class="seleccion">TEL:</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'. $telvend.'<br />
        <span class="seleccion">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 class="titulos"><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 class="seleccion"><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 class="seleccion"><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 class="seleccion"> <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 class="seleccion"><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 class="seleccion"><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 class="seleccion"><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>

0 个答案:

没有答案