使用jspdf生成gridview的pdf

时间:2019-03-18 10:26:03

标签: javascript jquery asp.net jspdf

我正在尝试生成gridview的pdf文件,但出现错误。当我检查button click事件时,控制台显示:::

AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. jspdf.node.debug.js:6397:5

AcroForm-Classes are not populated into global-namespace, because the class-Names exist already. acroform.js:2791:7

我的aspx页面::

<body>
    <form id="form1" runat="server">
    <div id="printDiv">
/// gridview ///
 </div>
        <button id="gpdf">gen PDF</button>
    </form>
</body>
    <script src="scripts/jquery-1.12.0.min.js"></script> 
    <script src="scripts/jspdf.min.js"></script>
    <script src="scripts/jspdf.node.debug.js"></script>
    <script src="scripts/acroform.js"></script>
     <script type="text/javascript">
         var pdfdoc = new jsPDF();         
         $(document).ready(function () {
             $('#gpdf').click(function () {
                 pdfdoc.fromHTML($('#printDiv').html(), 10, 10);
             pdfdoc.save('test.pdf');
         });});
    </script>
</html>

出现错误时,我添加了acroform js文件,但仍然收到错误。如何解决这个问题?

0 个答案:

没有答案