C# 在条形码标签上打印asp面板
我有一个ASP面板,右边是条形码图像,左边是项目信息 当我在谷歌上搜索时,我知道这不能从服务器端完成,因此我选择在客户端完成,如下代码所示。但它允许用户选择打印机,我不想要,因为有许多打印机连接到系统。是否有其他方法通过默认打印机来实现它 Javascript方法-C# 在条形码标签上打印asp面板,c#,asp.net,printing,panel,qr-code,C#,Asp.net,Printing,Panel,Qr Code,我有一个ASP面板,右边是条形码图像,左边是项目信息 当我在谷歌上搜索时,我知道这不能从服务器端完成,因此我选择在客户端完成,如下代码所示。但它允许用户选择打印机,我不想要,因为有许多打印机连接到系统。是否有其他方法通过默认打印机来实现它 Javascript方法- 或者有其他更好的方法吗???将条形码图像放在面板内。条形码图像已经在面板内。 <script type = "text/javascript"> function PrintPanel() { v
或者有其他更好的方法吗???将条形码图像放在面板内。条形码图像已经在面板内。
<script type = "text/javascript">
function PrintPanel() {
var panel = document.getElementById("<%=pnlContents.ClientID %>");
var printWindow = window.open('', '', 'height=400,width=800');
printWindow.document.write('<html><head><title>DIV Contents</title>');
printWindow.document.write('</head><body >');
printWindow.document.write(panel.innerHTML);
printWindow.document.write('</body></html>');
printWindow.document.close();
setTimeout(function () {
printWindow.print();
}, 500);
return false;
}
</script>
void pd_PrintPage(object sender, PrintPageEventArgs e)
{
Graphics g = e.Graphics;
using Font printFont=new Font("Arial",10.0f))
{
g.DrawImage(???)// How to convert my asp panel to image here?
}
}