Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/330.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在条形码标签上打印asp面板_C#_Asp.net_Printing_Panel_Qr Code - Fatal编程技术网

C# 在条形码标签上打印asp面板

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

我有一个ASP面板,右边是条形码图像,左边是项目信息

当我在谷歌上搜索时,我知道这不能从服务器端完成,因此我选择在客户端完成,如下代码所示。但它允许用户选择打印机,我不想要,因为有许多打印机连接到系统。是否有其他方法通过默认打印机来实现它

Javascript方法-


或者有其他更好的方法吗???

将条形码图像放在面板内。条形码图像已经在面板内。
<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?
        }
    }