Ver Mensaje Individual
  #13 (permalink)  
Antiguo 28/03/2010, 23:07
kristhian23
 
Fecha de Ingreso: noviembre-2008
Mensajes: 110
Antigüedad: 15 años, 5 meses
Puntos: 2
Respuesta: Crear codigos de barras en un PDF desde PHP

Hola el codigo lo tengo asi..
<?php
require('ean13.php');
$pdf=new PDF_EAN13();
$pdf->AddPage();

include_once('../conexion.php');
$queEmp = "SELECT item_name, description, quantity, buy_price, unit_price FROM inven_items where quantity>='1' ORDER BY `item_name` ASC ";
$resEmp = mysql_query($queEmp, $link) or die(mysql_error());
$totEmp = mysql_num_rows($resEmp);

$max = 3;
$bloq = 0;
$htmlTable='<TABLE><TR>';

while($datatmp = mysql_fetch_assoc($resEmp)) {

$unit_price_value=$datatmp['unit_price'];
$nombre=$datatmp['item_name'];
$quantity=$datatmp['quantity'];
$codigo=$datatmp['description'];


if(($unit_price_value)<100)
{
$pre=number_format($unit_price_value*(1+($cfg_defa ult_tax_rate/100)),2,'.', '');
}else{
$per=number_format($unit_price_value*($cfg_default _percepcion_rate/100),2,'.', '');
$iva=number_format($unit_price_value*($cfg_default _tax_rate/100),2,'.', '');
$pre=number_format($unit_price_value+$iva+$per,2,' .', '');
}

if ($bloq < $max) {
$htmlTable='<TD>';
$pdf->EAN13(10,10,$codigo);
$htmlTable='</TD>';
$bloq++;
}
else{
$htmlTable='</tr><tr></tr><tr></tr><tr>';
$bloq = 0;

$htmlTable='<TD>';
$pdf->EAN13(10,10,$codigo);
$htmlTable='</TD>';
$bloq++;
}
}
$htmlTable='</tr><TABLE>';
$pdf->WriteHTML("INICIO DE PRODUCTOS.<BR>$htmlTable<BR>FIN DEL PRODUCTO.");
$pdf->Output();
?>

me genera el codigo de barra perfectamente segun la consulta.. lo unico malo esque la tabla que trato de crear no toman valor porque el codigo de barra da valores de Y y de X y me tira todos los codigos de barra en un solo punto se ve un solo manchon.. como son casi 12 articulos..