我想使用打印机扩展PHP。所以我下载了dll并将其安装在我的wamp服务器上,但是现在,当我想打开打印机时,我遇到了这个问题:
这是代码:
$printer = "''''MARKETING1-PC''Canon LBP2900";
if($ph = printer_open($printer))
{
$content = 'test';
// Set print mode to RAW and send PDF to printer
printer_set_option($ph, PRINTER_MODE, "RAW");
printer_write($ph, $content);
printer_close($ph);
}
else "Couldn't connect...";
错误是
Fatal error: Out of memory (allocated 1048576) (tried to allocate 4294967295 bytes) in C:'wamp'www'test'sell_report.php on line 10
也许问题是我下载的dll?
我会先尝试本地打印机,而无需通过网络。
此外,打印机扩展是为PHP4编写的,从未正式发布过。我怀疑它是否可用。
您最好生成 PDF 或 .ps 文件并使用 CLI 命令打印它们。