0

我有一个功能可以像这样进行原始打印:

function execPrint($pPrinterShareName, $pInit, $pData)
{       
    $tmpdir = sys_get_temp_dir();   # temporary directory to save temporary file
    $x = 0;
    $file =  tempnam($tmpdir, 'cetak_struk__'.$pInit.'_'.$x);  # temporary file name that will be printed
    $handle = fopen($file, 'w');                
    fwrite($handle, $pData);
    fclose($handle);        

    sleep(1);

    chmod($file, 0777);
    $v='';
    $v = copy($file, "//localhost/".$pPrinterShareName);
    sleep(1);
    return $v; 
}

此函数将创建一个临时文件夹并在其中放置一个临时文件。然后将通过将该文件复制到我的本地主机打印机来打印该文件。$p打印机

如果我的应用程序位于本地主机中,我可以这样做,但如果我的应用程序位于在线托管中,我该怎么做?请帮忙...

4

0 回答 0