lo genero lato client perche prendo parti di html per generarlo altrimenti poi dovrei passarmeli tutti tipo questo
codice:
var source = window.document.getElementById('bodypdf');            
            doc.fromHTML(source,margins.left,margins.top,{'width': margins.width,'elementHandlers': elementHandler},
                 function(dispose) {
        			     headerFooterFormatting(doc, doc.internal.getNumberOfPages())
                 });