【发布时间】:2019-08-09 04:21:24
【问题描述】:
在将我的 aspx 页面导出为 pdf 时,在页面的右上角,我得到了页面的 url,在右下角,它显示了 datetime。如何从 pdf 页面中删除它?
而且我必须减少pdf页面的左右边距并更改字体大小?有可能吗?
<div id="printIt">
// data grid
</div>
<asp:Button ID="btn_print" runat="server" ClientIDMode="Static" Text="Print" OnClientClick="printPage();" />
js代码
function printPage() {
var headstr = "<html><head><title></title></head><body>";
var footstr = "</body>";
var newstr = document.getElementById("printIt").innerHTML;
var oldstr = document.body.innerHTML;
document.body.innerHTML = newstr;
window.print();
document.body.innerHTML = oldstr;
}
如何将此打印功能修改为::
1. remove url and date time from top of the pdf
2. set left and right margins for the pdf page
3. set font size and font type for pdf page
【问题讨论】:
-
这个页面是供内部使用还是供公共客户使用?
-
@KhurramIshaque 面向公共客户。
-
尝试以下上一个问题,看看是否有帮助:stackoverflow.com/questions/8228088/…
-
@KhurramIshaque 我的第二个和第三个问题如何,为 pdf 页面设置边距和字体设置?请帮忙。谢谢!!!
标签: javascript asp.net