我使用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转换为空,而不是我想要的方式 - 用它的字段和后面的搜索结果,如下图所示: