使用Rotativa将html转换为PDF

时间:2017-12-19 10:41:54

标签: asp.net asp.net-mvc pdf-generation html-to-pdf rotativa

我使用Rotativa将Html转换为Pdf。这是我的控制器传真

中的功能
$.post({
    type: "POST",
    url: "create.php",
    data: {pid: pid, price: price, contractor: contractor, netto: netto, brutto: brutto, delivery: delivery, amount: amount},
}).done(function() {
    $.post({
        type: "POST",
        url: "generate.php",
        data: {pid: pid},
    }).done(function(data) {
        printPage = window.open('');
        printPage.document.writeln('<html><head><link rel="stylesheet" type="text/css" href="offer.css" /></head><body>' +data+ '</body></html>');
        printPage.document.close();
        printPage.focus();
        printPage.print();
        printPage.close();  
    });
});

它将SearchForm转换为空,而不是我想要的方式 - 用它的字段和后面的搜索结果,如下图所示:

SearchForm view after clicked in search button

0 个答案:

没有答案