I'm a little late, but let me tell you that the code you use is only compatible with older versions of the Microsoft browser (ie), because it contains WScript and the ActiveX component.
Yes, you can generate it using jsPDF.js . Just find this javascript file in google and upload it locally, then enable it as below.
<script src="~/js/jspdf.js"></script> <script> var doc = new jsPDF('p', 'pt', 'letter'); var specialElementHandlers = { '#editor': function (element, renderer) { return true; } }; $('#btn_Pdfprint').click(function () { doc.fromHTML($('#myTabContent').html(), 25, 25, { 'width': 790, 'elementHandlers': specialElementHandlers }); doc.save('mywebpagee.pdf'); window.location.reload(); }); </script>
source share