用PHP打印自动生成的条形码图像

用PHP打印自动生成的条形码图像,php,javascript,html,codeigniter,barcode,Php,Javascript,Html,Codeigniter,Barcode,我已经能够在我的php项目中创建条形码,现在我想打印我的条形码,所以我使用javascript,但当涉及到打印部分图像时,并没有显示。我的条形码图像链接如下 http://localhost/Labortory_Management_System/assets/barcode/test_1D.php?text=3921214754 如何打印物品图像 PS 我使用这个javascript来打印图像 <script type="text/javascript"> functi

我已经能够在我的php项目中创建条形码,现在我想打印我的条形码,所以我使用javascript,但当涉及到打印部分图像时,并没有显示。我的条形码图像链接如下

http://localhost/Labortory_Management_System/assets/barcode/test_1D.php?text=3921214754
如何打印物品图像

PS

我使用这个javascript来打印图像

<script type="text/javascript">

    function PrintElem(elem)
    {
        Popup($(elem).html());
    }

    function Popup(data) 
    {
        var mywindow = window.open('', 'my div', 'height=400,width=600');
        mywindow.document.write('<html><head><title>my div</title>');
        /*optional stylesheet*/ //mywindow.document.write('<link rel="stylesheet" href="main.css" type="text/css" />');
        mywindow.document.write('</head><body >');
        mywindow.document.write(data);
        mywindow.document.write('</body></html>');

        mywindow.print();
        mywindow.close();

        return true;
    }

</script>

函数PrintElem(elem)
{
弹出($(elem.html());
}
功能弹出窗口(数据)
{
var mywindow=window.open(“”,'my div','height=400,width=600');
mywindow.document.write('mydiv');
/*可选样式表*///mywindow.document.write(“”);
mywindow.document.write(“”);
mywindow.document.write(数据);
mywindow.document.write(“”);
mywindow.print();
mywindow.close();
返回true;
}