Comunidad de diseño web y desarrollo en internet online

PHP - Html a PDF (No he podido)

Citar            
MensajeEscrito el 05 May 2017 04:15 pm
Buenas tardes señores, me llamo cesar laguna, soy de colombia, empeze a desarrollar paginas web hace ya un tiempo pero he lo que es programacion php no lo he podido dominar.

Tengo el siguiente dilema, un cliente me pidio un formulario donde el usuario solo llena unos campos (Lo demas es prestablecido), quieren que al dar clic en el boton enviar, este genere un pdf y se envie a varios emails, a parte necesito que ese pdf se guarde en una ubicacion en el hosting con nombre_fecha_hora.pdf para ser usado mas adelante.

he probado con dompdf, html2pdf, fpdf, etc me funcionan algunos pero no captura lo que esta escrito, me explico el usuario debe llenar los campos de nombre y apellidos y esa informacion debe ser guardada en el pdf, dompdf una vez me funciono pero me captura el html en blanco, osea sin la informacion que escriba el usuario.

enlace para que vean el formulario

http://actua1.tsem.com.co/formatos/86080748.html

por favor ayudenme explicandome para dummys como usar el que uds consideren efectivo para esa funcion, llevo 20 dias haciendo ese proyecto web y todo lo tengo listo menos ese punto, creanme que he leido cuanto manual encuentro, hasta con jquery he intentado pero no me funciona.

nota: no estoy usando bases de datos sql, ni nada, solo necesito que me capture el pdf y lo envie por email.
nota: en el enlace si uds llenan los campos de nombre e identificacion y dan clic en el boton que dice "Generar PDF" si funciona, obbio es un solo un llamado a la funcion imprimir de chrome q permite guardar en pdf, sin embargo esa funcion si captura lo que el usuario escribe, obbio no le puedo decir al cliente que el usuario debe llenar los campos, guardar el pdf, y enviarlo via mail de forma manual porque no le sirve esa solucion,

de antemano mil gracias.

dejo el codigo que estoy usando en html

Código :

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css" media="print">
.nover {display:none}
</style>
<style type='text/css'>
input{
text-align:center;
}
</style>
<title>Documento sin título</title>
</head>
 
<body>
<table width="80" border="0">
  <tbody>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td><form id="form1" name="form1" method="post">
Plataforma TSEM 2017
      </form></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr> </tr>
    <tr>
      <td align="center"><img src="imgactual/logo.png" width="250" height="82" alt=""/></td>
      <td align="center" ><img src="imgactual/qrcode.png" width="116" height="110" alt=""/></td>
      <td align="center"><p><strong>SERVICIOS EMPRESARIALES DEL META S.A.S. </strong></p>
      <p><strong>NIT. 900985193-4 </strong></p></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="850" height="10" align="center"><p><strong>ACTUALIZACIÓN LISTA DE USUARIOS</strong></p></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="90"><label for="textfield">Contratista: </label></td>
      <td width="270"><strong>TRANSPORTE BUENAVISTA S.A.S</strong></td>
      <td width="27"><label for="textfield3">Nit:</label></td>
      <td width="385"><strong>900.476.774-1</strong></td>
    </tr>
    <tr>
      <td height="19"><label for="textfield5">Contratante:</label></td>
      <td><strong>Servicios Empresariales del Meta SAS</strong></td>
      <td><label for="textfield4">Nit:</label></td>
      <td><strong>900.985.193-4</strong></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="850"><label for="textfield5">Contrato Numero:</label>
        <strong>5046</strong></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="422" align="center"><strong>ACTUALIZAR LA LISTA  DE USUARIOS CORRESPONDIENTE AL </strong></td>
      <td width="362" align="center"><strong>CONTRATO NUMERO: 5046</strong></td>
    </tr>
    <tr>
      <td align="center"><strong>SUSCRITO ENTRE SERVICIOS  EMPRESARIALES DEL META S.A.S Y TRANSPORTE BUENAVISTA S.A.S</strong></td>
      <td align="center"><strong><p>23/11/2016</p></strong></td>
    </tr>
    <tr>
      <td align="center"><strong> VEHÍCULO DE PLACAS</strong></td>
      <td align="center"><strong>WLL051</strong></td>
    </tr>
    <tr>
      <td align="center"><strong>OPERADO POR EL CONDUCTOR</strong></td>
      <td align="center"><strong>WILLIAM MARTINEZ</strong></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="800" align="center"><p align="center">De acuerdo con el artículo 18 de la resolución 1069 del 23  de abril de 2015, <br>
      Solicito a ustedes se actualice el listado de usuarios  correspondiente al objeto del presente formato.</p></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="422" align="center"><strong>NOMBRES Y APELLIDOS</strong></td>
      <td width="422" align="center"><strong>IDENTIFICACION</strong><br></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr> </tr>
    <tr>
      <td><label for="textfield6">.</label>        <input style="border:none" name="textfield6" type="text" id="textfield6" autocomplete="off" size="50"></td>
      <td><label for="textfield7">.</label>        <input style="border:none" name="textfield7" type="text" id="textfield7" size="50"></td>
    </tr>
    <tr>
      <td><label for="textfield8">.</label>        <input style="border:none" name="textfield8" type="text" id="textfield8" size="50"></td>
      <td><label for="textfield9">.</label>        <input style="border:none" name="textfield9" type="text" id="textfield9" size="50"></td>
    </tr>
    <tr>
      <td><label for="textfield8">.</label>
      <input style="border:none" name="textfield2" type="text" id="textfield8" size="50"></td>
      <td><label for="textfield8">.</label>
      <input style="border:none" name="textfield10" type="text" id="textfield8" size="50"></td>
    </tr>
    <tr>
      <td><label for="textfield8">.</label>
      <input style="border:none" name="textfield4" type="text" id="textfield8" size="50"></td>
      <td><label for="textfield8">.</label>
      <input style="border:none" name="textfield11" type="text" id="textfield8" size="50"></td>
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center">
  <tbody>
    <tr>
      <td width="705" align="center">LA PRESENTE ACTUALIZACIÓN SE REMITE POR MEDIO ELECTRÓNICO A LA EMPRESA CONTRATISTA PARA SER IMPRESA Y ADJUNTADA AL CONTRATO.</td>
      <td align="center" width="139"><!-- #BeginDate format:En2 -->
    </tr>
  </tbody>
</table>
<table width="800" border="1" align="center" cellpadding="0">
  <tbody>
    <tr>
    <td width="51%" align="center"><h4>Calle 11 No. 47C-23 La Esperanza Etapa ll, Villavicencio-Metawww.tsem.com.co- [email protected] [email protected] 350 888 9944 - 0386630252 url: goo.gl/nKkYFI</h4></td>
    <td align="center" width="49%"><img src="imgactual/firma.png" width="293" height="103" alt=""/></td>
    </tr>
  </tbody>
</table>
<table width="800" border="0" align="center">
  <tbody>
    <tr>    </tr>
  </tbody>
</table>
<table width="800" border="0" align="center">
  <tbody>
    <tr>
      <td align="center" valign="top"><p>“La presente Actualización no lleva sellos según Decreto 2150, Art 11 de Diciembre de 1995 y el decreto Ley 019 de Enero de 2012 (Ley Antitramites)”</p></td>
    </tr>
  </tbody>
</table>
<table width="800" border="0" align="center">
  <tbody>
    <tr>
      <td align="center"><input type="submit" class="nover" name="submit" id="submit" value="Enviar"></td>
      <td align="center"><input type="reset" class="nover" name="reset" id="reset" value="Restablecer"></td>
      <td align="center"><input type="button" class="nover" name="imprimir" value="GenerarPDF" onclick="window.print();"></td>
    </tr>
  </tbody>
</table>
</body>
</html>

Por claguna

0 de clabLevel



 

chrome
Citar            
MensajeEscrito el 19 Jul 2017 02:39 am
la razon pr la que no te guarda con los datos, es que primero una vez que el usuario, ingrese los datos, tu debes recoger esos datos y agregarlos al HTML que tomara el DOMPDF u otro similar

Por tuadmin

Claber

598 de clabLevel



Genero:Masculino  

chrome

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.