Tema: crear pdf
Ver Mensaje Individual
  #7 (permalink)  
Antiguo 12/08/2012, 19:01
Avatar de kakashi20
kakashi20
 
Fecha de Ingreso: septiembre-2009
Mensajes: 616
Antigüedad: 14 años, 7 meses
Puntos: 15
Respuesta: crear pdf

la direccion si funciona, pero algunas algunas conexiones de internet la bloquean:
require("fpdf.php");

$conexA= mysql_connect("localhost","root","malu1101")
or die("No se pudo realizar la conexion");
$conexB=mysql_select_db("practica",$conexA)
or die("ERROR con la base de datos");

$consulta=mysql_query("SELECT * FROM prueba WHERE cedula='".$_POST['cedula']."'");
$fila=mysql_fetch_array($consulta);




class PDF extends FPDF
{
// Cabecera de página
function Header()
{
// Logo
//$this->Image('imagenes/LOGO_EMPRESA.png',180,10,20);
// Arial bold 15
$this->SetFont('Arial','I',11);
// Movernos a la derecha
$this->SetY(8);
$this->SetX(60);
// Título
//$this->Cell(80,10,"ESTO ES UN DUPLICADO DE LA FACTURA, NO TIENE NINGUN VALOR",0,0,'C');
// Salto de línea
$this->Ln(20);
}

function Footer()
{
//Posición: a 1,5 cm del final
$this->SetY(-15);
//Arial italic 8
$this->SetFont('Arial','I',6);
//Número de página
$this->Cell(0,10,'Hoja '.$this->PageNo().'/{nb}',0,0,'C');
}

function texto_negrita($label)
{
//Arial 12
$this->SetFont('Arial','B',11);
//Color de fondo
//$this->SetFillColor(252,240,239);
//Título
$this->Cell(40,10,"$label",0,0,'L');
//Salto de línea
$this->Ln(0);
}

function texto($label)
{
//Arial 12
$this->SetFont('Arial','',11);
//Color de fondo
//$this->SetFillColor(252,240,239);
//Título
$this->Cell(70,10,"$label",0,0,'L');
//Salto de línea
$this->Ln(0);
}







}

$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();

$pdf->SetY(13); // CORDENADAS X DE L AHOJA
$pdf->SetX(85); // CODERNANDAS Y DE LA HOJA
$pdf->texto($fila['nombre']);




$pdf->Output('320.pdf','D');