1

我无法使用 printer_draw_bmp() 函数打印图像文件。我已经在 Windows 7(32 位)上安装了 php 打印机 dll 和 imagick。

这是我的示例代码。但我收到“警告:printer_draw_bmp():加载位图失败”。谁能指导我调试这个?

<?php
$handle = printer_open();
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_start_doc($handle, "My Doc");
printer_start_page($handle);

$image = new Imagick();
$image->readImage("c:\\picStorage\\pic\\999-0001.jpg");
$image->setImageFormat("bmp");
$image->writeImage("C:\\test.bmp");

printer_draw_bmp($handle,"C:\\test.bmp", 300,600);

printer_end_page($handle);
printer_end_doc($handle);

printer_close($handle);

运行示例代码后,它将在 C: 目录中创建一个 BMP 图像。

C: 目录下的 BMP 图像

4

0 回答 0