0

I have used jspdf plugin to save the div named #main to pdf, have watched a youtube video of this code working for someone else, but does not seem to work for me in asp.net? Javascript/Jquery:

<script type="text/javascript" src="jspdf.min.js"></script>
<script type="text/javascript" src="jspdf.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="jquery/jquery-1.7.1.min.js"></script> 
<script type="text/javascript" src="jspdf.plugin.standard_fonts_metrics.js"></script>
<script type="text/javascript" src="jspdf.plugin.split_text_to_size.js"></script>
<script type="text/javascript" src="jspdf.plugin.from_html.js"></script>

<title>MCN Printout</title>

 <script type="text/javascript">

     $(document).ready(function () {

         function genPDF() {

             var doc = new jsPDF();

             doc.fromHTML($('#main').get(0), 20, 20, {
                 'width': 500
             });

             doc.save('mcn.pdf');


         }

     });
     </script>

I have used onclick="genPDF();" in the button attributes

kehoewex86
  • 21
  • 1
  • 12

0 Answers0