 
			
				23/01/2012, 07:49
			
			
			     |  
      |    |    |    Fecha de Ingreso: julio-2011  
						Mensajes: 47
					  Antigüedad: 14 años, 3 meses Puntos: 0     |        |  
  |      Respuesta: Formulario generar PDF        Amigos,,,, como estan bueno estube viendo varias cosas estoy con la clase fpdf y ya cree mi primer pdf con el siguiente codigo... que dice hola..   
cree un documento php llamado prueba.php con estas lineas para probar y me genera un documento pdf con la palabra hola.... superrrr pero sigo teniendo una duda como hago para generar el documento pdf pero de mi formulario.... es un formulario php... 
<?php  
require('C:\xampp\htdocs\protocolo solicitud de labor\formularios\pdf\fpdf.php'); 
$pdf=new FPDF(); 
$pdf-> Addpage(); 
$pdf-> setfont('arial','B','16'); 
$pdf-> cell(40,10,'hola'); 
$pdf-> output(); 
?>   
formulario.... estas son las lineas del formulario..... como hago para que los campos del formulario los pase al pdf.... eso no lo entiendo.....    
<?php 
include("conexion.php"); 
$rst_categorias=mysql_query("select * FROM categorias ORDER BY catnombre;",$conexion); 
if (mysql_num_rows($rst_categorias)==0) 
	echo "No se han definido categorias";     
?>   
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<title>Protocolo Solicitud de Labor</title> 
<style type="text/css"> 
<!-- 
.Estilo1 {color: #0033FF} 
--> 
</style> 
<script type="text/JavaScript"> 
<!-- 
function MM_jumpMenu(targ,selObj,restore){ //v3.0 
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); 
  if (restore) selObj.selectedIndex=0; 
} 
//--> 
</script> 
</head>   
<body> 
<form id="form1" name="form1" method="post" action=""> 
  <div align="center"> 
    <p><img src="../imagenes/header.png" width="1000" height="150" />    </p> 
    <p align="center"><strong><em>Protocolo O.T. Mantención</em></strong>.</p> 
    <p align="center" class="Estilo1">   
    <fieldset></fieldset> 
    <p align="center"><label></label></p> 
    <table width="426" border="0" align="center"> 
      <tr> 
        <th scope="col"><div align="center">Folio Interno : </div></th> 
        <th scope="col"><label> 
          <div align="left"> 
            <input name="textfield3" type="text" size="5" /> 
		  </div> 
        </label></th> 
        <th scope="col"><div align="center">Recinto : </div></th> 
        <th scope="col"><label> 
          <div align="center">El Sauce S.A. </div> 
        </label></th> 
      </tr> 
    </table> 
     <table width="1000" height="185" border="0" align="center"> 
      <tr> 
        <th height="31" scope="col"><div align="left">Área:</div></th> 
        <th scope="col"><label>   
          <div align="left"> 
            <input name="textfield" type="text" size="100" /> 
          </div> 
        </label></th> 
      </tr> 
      <tr> 
        <td height="23"><div align="left"><strong>Ubicación:</strong></div></td> 
        <td><label>   
          <div align="left"> 
            <input name="textfield2" type="text" size="100" /> 
          </div> 
        </label></td> 
      </tr> 
      <tr> 
        <td height="23"><div align="left"><strong>Solicitante:</strong></div></td> 
        <td><label> 
          <div align="left"> 
            <input name="textfield4" type="text" size="100" /> 
          </div> 
        </label></td> 
      </tr> 
      <tr> 
        <td height="23"><div align="left"><strong>Fecha:</strong></div></td> 
        <td><label> 
          <div align="left"> 
            <input name="textfield5" type="text" size="50" /> 
          </div> 
        </label></td> 
      </tr> 
      <tr> 
        <td height="23"><div align="left"><strong>Hora:</strong></div></td> 
        <td><label>   
          <div align="left"> 
            <input name="textfield6" type="text" size="50" /> 
          </div> 
        </label></td> 
      </tr> 
      <tr> 
        <td height="23"><div align="left"><strong>Ubicación Mantención </strong></div></td> 
        <td><div align="left"> 
          <input name="textfield7" type="text" size="100" /> 
        </div></td> 
      </tr> 
    </table> 
    <p align="center"> 
      <label></label><fieldset> 
      <table width="1000" border="0"> 
        <tr> 
          <th width="198" scope="col"><div align="left">Categorias de Mantención : </div></th> 
          <th width="786" scope="col"><div align="left"> 
              <select name="categoria" size="1" id="categoria"> 
                 <option selected=""VALUE="">[SELECIONE UNA CATEGORIA]</option> 
				  <?php  
		  while ($fila=mysql_fetch_array($rst_categorias)) 
		  { 
		  		echo "<option VALUE='". $fila["catcodigo"] ."'>".$fila["catnombre"] ."</option>"; 
		  } 
		  mysql_close($conexion); 
		  ?> 
		   </select> 
          </div></th> 
        </tr> 
      </table> 
      <p> </p> 
      <table width="1000" border="0" align="center"> 
        <tr> 
          <th width="220" scope="col"><div align="left">Selecione condición de Mantención:</div></th> 
          <th width="111" scope="col"><div align="center">Contingencia : </div></th> 
          <th width="44" scope="col"><label> 
              <div align="left"> 
                <input name="radiobutton" type="radio" value="radiobutton" /> 
              </div> 
            </label></th> 
          <th width="115" scope="col"><div align="center">Requerimiento : </div></th> 
          <th width="488" scope="col"><label> 
              <div align="left"> 
                <input name="radiobutton" type="radio" value="radiobutton" /> 
              </div> 
            </label></th> 
        </tr> 
      </table> 
      <p> </p> 
      <table width="1000" border="0"> 
        <tr> 
          <th width="312" scope="col"><div align="left">Detalle Observaciones de trabajos a realizar : </div></th> 
          <th width="678" scope="col"><label> 
              <div align="left"> 
                <textarea name="textarea" cols="50" rows="10"></textarea> 
              </div> 
            </label></th> 
        </tr> 
      </table> 
      <p> </p> 
      <p> </p> 
      <p> 
        <label> 
        <input type="submit" name="Submit" value="Guardar" />  
        </label> 
        <label> 
        <input type="submit" name="Submit2" value="Enviar Correo" /> 
        </label> 
        <label> 
        <input type="submit" name="Submit3" value="Imprimir"  onclick="window.print();"/> 
        </label> 
      </p> 
      </fieldset> 
    <p align="left">  </p> 
    <p> </p> 
    <p> </p> 
    <p> </p> 
  </div> 
</form> 
</body> 
</html>           |