Ver Mensaje Individual
  #3 (permalink)  
Antiguo 23/08/2006, 15:36
Avatar de Nano_
Nano_
 
Fecha de Ingreso: febrero-2006
Ubicación: Bogotá, Colombia
Mensajes: 1.866
Antigüedad: 18 años, 2 meses
Puntos: 96
Saludos..

El codigo es el siguiente.. Lo probe en linux (ubuntu) y en windows xp y me funciona muy bien. pero en mi otro servidor suse no corre. Utilizo fpdf

Código PHP:
    // conectamos con el servidor
    
require ("servidor.inc");
    
// comprobamos que hemos estabecido conexión en el servidor
    
if (! $link) {
    echo 
"<h2 align='center'>ERROR: Imposible establecer conexion con el servidor intente mas tarde</h2>";
    exit;
    }
    
// NO OLVIDAR CONECTARSE CON LA BASE DE DATOS
    
mysql_select_db($basedatos$link); 
Código PHP:
    define('FPDF_FONTPATH''fpdf/font/');
    require(
'fpdf/fpdf.php');

    class 
PDF extends FPDF 
    
// Page header
    
function Header()
    { 
        
$this->SetFont('Arial''B'15);
        
$this->SetTextColor(064155); 
        
// Title
        
$this->SetLineWidth(1);
        
$this->SetDrawColor(0064);
        
$this->Cell(60);
        
// Line break
        
$this->Ln(-7);
    }  

        
// Page footer
        
function Footer()
        { 
        
// Position at 1.5 cm from bottom
        
$this->SetY(-15); 
        
// Arial italic 8
        
$this->SetFont('Arial''I'8); 
        
// Page number 
        
$this->Cell(010'Linea Final ' $this->PageNo(), 00'C');
        } 
    } 
    
    
//Consulta a la Base de Datos para la generacion del PDF
    
$consulta mysql_query("select ........."$link);
    
    
$pdf = new PDF('P''mm''Letter');
    
$pdf->Open();
    
$pdf->AddPage();

    
$pdf->SetFont('Arial''B'10);
    
$pdf->SetLeftMargin(30);
    
$pdf->SetAutoPageBreak(false,);

    
//Arreglo de la Consulta a la Base de Datos 
    
$fila mysql_fetch_array($consulta);
    
$pdf->SetFont('Arial'''10);
    
$pdf->SetX(28);

    
// Se imprime el NIT del exportador ¡
    
$pdf->Cell(305'NOMBRE'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['ter_raz'], 01'L');
    
$pdf->Ln(1);
    
$pdf->SetX(28);

    
// Se imprime La direccion del exportador   
    
$pdf->Cell(305'DIRECCION'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['dir_prod'], 01'L');
    
$pdf->Ln(1);
    
$pdf->SetX(28);

    
//Pais del Exportador por defecto COLOMBIA
    
$pdf->Cell(305'PAIS'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605'COLOMBIA'01'L');
    
$pdf->Ln(7);
    
$pdf->SetX(28);

    
//Nombre del Importador
    
$pdf->Cell(305'NOMBRE'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['cer_nom_imp'], 01'L');
    
$pdf->Ln(1);
    
$pdf->SetX(28); 
    
    
// La direccion del Importador
    
$pdf->Cell(305'DIRECCION'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['cer_dir_imp'], 00'L');
    
$pdf->Cell(1005'COLOMBIA'01'C');

    
//Telefono del Importador
    
$pdf->Ln(1);
    
$pdf->SetX(28);
    
$pdf->Cell(305'TELEFONO'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['cer_tel_imp'], 01'L');

    
//Pais a Exportar
    
$pdf->Ln(1);
    
$pdf->SetX(28);
    
$pdf->Cell(305'PAIS'00'L');
    
$pdf->SetFont('Arial'''10);
    
$pdf->Cell(605$fila['cer_pai_imp'], 00'L');
    
$pdf->Ln(9);
    
$pdf->SetX(28); 

    
// Medio de Transporte
    
$pdf->Cell(305$fila['med_trans'], 00'L'); 

    
$conlin 0;
    
$pdf->SetFont('Arial'''10);
    
$pdf->Ln(65);
    
$pdf->SetX(26);


    
$pdf->Cell(65'01'00'L');
    
$pdf->SetX(37);
    
$pdf->Cell(85'ITALIA'00'L');
    
    
$pdf->SetX(65);
    
$pdf->Cell(85'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'00'L');

    
$pdf->SetX(145);
    
$pdf->Cell(85'AAAAA'00'L');
    
    
$pdf->SetX(170);
    
$pdf->Cell(85'AAAAAAA'00'L');
    
    
$pdf->SetX(194);
    
$pdf->Cell(85'AAAAA'00'L');
    
    
$pdf->Ln(5);
    
$pdf->SetX(65);
    
$pdf->Cell(85XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX00'L');

    
$pdf->Ln(5);
    
$pdf->SetX(65);
    
$pdf->Cell(85'Nit:'00'L');
    
$pdf->Cell(405CCC01'C');

    
$pdf->SetX(65);
    
$pdf->Cell(85'NANDINA:'00'L');
    
$pdf->Cell(405DDD01'C');

    
$pdf->SetX(65);
    
$pdf->Cell(85'CANTIDAD:'00'L');
    
$pdf->Cell(405DDD01'C');

    
$pdf->SetX(65);
    
$pdf->Cell(85'Pes.Br:'00'L');
    
$pdf->Cell(405DDD01'C');

    
$pdf->SetX(65);
    
$pdf->Cell(85'V.FOB:'00'L');
    
$pdf->Cell(405EEE01'C');
    
$pdf->SetX(15);

    
$pdf->Ln(92);
    
$pdf->SetX(120);
    
$pdf->Cell(1055'COLOMBIA'00'C');
  
    
$pdf->Ln(23);
    
$pdf->SetX(125);
    
$pdf->Cell(1015$fila['cer_pai_imp'], 01'L');
 
    
$pdf->Output(); 
__________________
:.:Nano.:: @nano_hard - Retornando al foro