Foros del Web » Programando para Internet » PHP »

Como Generar El Manejar El Marjen De Un Documento Pdf

Estas en el tema de Como Generar El Manejar El Marjen De Un Documento Pdf en el foro de PHP en Foros del Web. HOLA AMIGOS, SALUDOS, MI CONSULTA ES COMO PUEDO MANEJAR EL MARJEN SUPERIOR Y COMO PUEDO INSERTARLE LOS TITULOS A CADA UNO DE LOS CAMPOS. EJEMPLO ...
  #1 (permalink)  
Antiguo 19/01/2006, 09:59
Avatar de calavera  
Fecha de Ingreso: diciembre-2005
Mensajes: 113
Antigüedad: 18 años, 2 meses
Puntos: 0
Como Generar El Manejar El Marjen De Un Documento Pdf

HOLA AMIGOS,

SALUDOS, MI CONSULTA ES COMO PUEDO MANEJAR EL MARJEN SUPERIOR Y COMO PUEDO INSERTARLE LOS TITULOS A CADA UNO DE LOS CAMPOS.

EJEMPLO
FUNCIONARIOS

Rut_Asignado | Nombre | Apellido | Departamento | Anexo | Mail

Código PHP:
<?php

define
('FPDF_FONTPATH','font/');
require(
'fpdf.php');


include(
"conex.php");
$link=Conectarse();

//Create new pdf file
$pdf=new FPDF();

//Open file
$pdf->Open();

//Disable automatic page break
$pdf->SetAutoPageBreak(false);

//Add first page
$pdf->AddPage();


//set initial y axis position per page
$y_axis_initial 25;

//print column titles for the actual page
$pdf->SetFillColor(232,232,232);
$pdf->SetFont('Arial','',8);
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
    
$pdf->Cell(18,5,'Rut_Asignado',1,0,'L',1);
$pdf->Cell(22,5,'Nombre',1,0,'L',1);
$pdf->Cell(25,5,'Apellido',1,0,'L',1);
$pdf->Cell(28,5,'Departamento',1,0,'L',1);
$pdf->Cell(20,5,'Anexo',1,0,'L',1);
$pdf->Cell(30,5,'E-mail',1,0,'L',1);


$y_axis $y_axis $row_height;

//Select the Products you want to show in your PDF file
$result=mysql_query("SELECT * FROM Funcionarios ORDER BY Rut_Asignado",$link);

//initialize counter
$i 0;

//Set maximum rows per page
$max 25;

//Set Row Height
$row_height 5;

while(
$row mysql_fetch_array($result))
{
    
//If the current row is the last one, create new page and print column title
    
if ($i == $max)
    {
        
$pdf->AddPage();
        
        
//print column titles for the current page
        
$pdf->SetY($y_axis_initial);
        
$pdf->SetX(25);

        
$pdf->Cell(18,5,'Rut_Asignado',1,0,'L',1);
        
$pdf->Cell(22,5,'Nombre',1,0,'L',1);
        
$pdf->Cell(25,5,'Apellido',1,0,'L',1);
        
$pdf->Cell(28,5,'Departamento',1,0,'L',1);
        
$pdf->Cell(20,5,'Anexo',1,0,'L',1);
        
$pdf->Cell(30,5,'E-mail',1,0,'L',1);                
        
        
//Go to next row
        
$y_axis $y_axis $row_height;
        
        
//Set $i variable to 0 (first row)
        
$i 0;
    }

    
$pdf->SetY($y_axis);
    
$pdf->SetX(25);
    
    
$pdf->Cell(18,5,$row[Rut_Asignado],1,0,'L',1);
    
$pdf->Cell(22,5,$row[Nombre],1,0,'L',1);
    
$pdf->Cell(25,5,$row[Apellido],1,0,'L',1);
    
$pdf->Cell(28,5,$row[Departamento],1,0,'L',1);
    
$pdf->Cell(20,5,$row[Anexo],1,0,'L',1);
    
$pdf->Cell(30,5,$row[Mail],1,0,'L',1);

    
//Go to next row
    
$y_axis $y_axis $row_height;
    
$i $i 1;
}

mysql_close($link);

//Create file
$pdf->Output();
?>


:si: :si: :si: :si: :si: :arriba: :arriba: :arriba:
  #2 (permalink)  
Antiguo 19/01/2006, 11:10
Avatar de mauled  
Fecha de Ingreso: marzo-2005
Ubicación: Cd. de México.
Mensajes: 3.001
Antigüedad: 19 años
Puntos: 33
Porque no visitas http://www.fpdf.org/ y verifcas los manuales y ejemplos que viene ahi.
  #3 (permalink)  
Antiguo 26/01/2006, 05:33
Avatar de calavera  
Fecha de Ingreso: diciembre-2005
Mensajes: 113
Antigüedad: 18 años, 2 meses
Puntos: 0
Agradeecido

este link es fantastico, muchas gracias.


Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 11:02.