如何将Gridview数据转换为PDF格式?

时间:2016-10-12 09:50:57

标签: c# jquery pdf

在我的gridview中,我有一个复选框,图像和单选按钮。现在我想将gridview数据作为pdf。

我的代码:

    function exporttopdf() {
        var pdf = new jsPDF('l', 'pt', 'a2');
        pdf.setFontSize(10);
       source = $('#tblgridview')[0]; 
       specialElementHandlers = {
      '#bypassme': function (element, renderer) {

                return true
            }
        };
        margins = { top: 30, bottom: 40,  left: 10, width: 1300 };
       pdf.fromHTML(
                source,
                margins.left, 
                margins.top, 
                    'width': margins.width, // max width of content on PDF
                    'elementHandlers': specialElementHandlers
                },
         function (dispose) {
       pdf.save('sample.pdf');
        }
        , margins);
    }
 <asp:ImageButton ID="btnExporttoPDF" ImageUrl="pdf.png" OnClientClick="exporttopdf(); return false;" runat="server" />

如何将Gridview数据转换为pdf?

0 个答案:

没有答案