Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/05/2009, 03:42
Avatar de abimaelrc
abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 17 años, 5 meses
Puntos: 1517
Respuesta: Clase fpdf problemillas

Yo creo documentos pdf con este codigo


Código HTML:
<html>
<head>
<title>Name Entry Level</title>
</head>
<body>
<table border="0" width="100%" height="100%">
<tr>
<td valign="middle" align="center">
<form method="POST" action="pdf_file.php">
<p>
<font size="3" face="Arial">
Enter your name here please => 
<input type="text" name="userName" size="20" maxlength="20">
</font>
</p>
<p>
<input type="submit" value="Submit" name="B1">
<input type="reset" value="Reset" name="B2">
</p>
</form>
</td>
</tr>
</table>
</body>
</html> 

Código PHP:
<?php 
$user 
= $HTTP_POST_VARS["userName"]; 
$pdf = pdf_new(); 
pdf_open_file($pdf, $_SERVER['DOCUMENT_ROOT'] . "pdf/nombre.pdf"); 
pdf_set_info($pdf, "Author", "Ben Shepherd"); 
pdf_set_info($pdf, "Title", "Creating a pdf"); 
pdf_set_info($pdf, "Creator", "Ben Shepherd"); 
pdf_set_info($pdf, "Subject", "Creating a pdf"); 
pdf_begin_page($pdf, 800, 600); 
$arial = PDF_load_font($pdf,"Courier","host",""); 
pdf_setfont($pdf, $arial, 14); 
pdf_show_xy($pdf, "aqui va una informacion importante",50, 400); 

pdf_end_page($pdf); 
pdf_close($pdf); 
echo 
"<A HREF=\"nombre.pdf\" TARGET=\"_blank\">Open pdf in a new window $user</A>"; 
?>