Código HTML:
Ver original
<!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=UTF-8" /> <style> body { font-family:Arial, Helvetica, sans-serif; } </style> </head> <body> <center> <div id="crear"> <form enctype="multipart/form-data" method="post" target="_self" name="formplantilla" action=""> <table id="tblcrear" border="1" width="800" align="center"> <tr> </tr> <tr> </tr> <tr> </tr> <tr> </tr> <tr> <td> <input type="text" id="inicio" value="" maxlength="5" /> </td> </tr> <tr> <td> <input type="text" id="fin" value="" maxlength="5" /> </td> </tr> <tr> <td> <select id="cantclases"> </select> </td> </tr> <tr> <td> <select id="mes"> </select> </td> </tr> <tr> </tr> </table> </form> <form enctype="multipart/form-data" action="http://imagina.com.uy/crearplanilla/crearpdf.php" target="new" id="formcrearpdf" name="formcrearpdf" method="post"> <div id="plantilla"> <table id="tblmes" style="display:none;" border="0" width="800" align="center"> </table> <table id="tblcantclases" style="display:none;" border="1" width="800" align="center"> </table> <table id="tblestudiantes" style="display:none;" border="1" width="800" align="center"> </table> <table id="tblcalculos" style="display:none; margin-top:15px; text-align:left;" border="0" width="800" align="center"> </table> </div> </form> <ul style="text-align:left; margin:15px 410px; display:none;" id="especificaciones"> </ul> </center> </body> </html>
Código Javascript:
Ver original
function pdf() { var pdf1 = new jsPDF('p', 'in', 'letter') , source = $('#plantilla')[0] , specialElementHandlers = { // element with id of "bypass" - jQuery style selector '#bypassme': function(element, renderer){ return true } } pdf1.fromHTML( , 0.5 // x coord , 0.5 // y coord , { 'width':7.5 // max width of content on PDF , 'elementHandlers': specialElementHandlers } ) pdf1.save('planilla.pdf'); }