note 47999 deleted from function.printer-draw-bmp by sobak
| From: | sobak@php.net | Date: | Thu, 24 Nov 2016 20:30:19 +0000 |
| Subject: | note 47999 deleted from function.printer-draw-bmp by sobak | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-207569@lists.php.net to get a copy of this message | ||
Note Submitter: lapoA at TseanetD dot O dot Tcom
----
something I found out the hard way...
in order for the example above to work, the file being printed must be in a directory that has been
opened for reading.
The example in the docs should probably have been listed as:
(There should probably be a check for the filename, but this should give an idea)
<?php
$dir = 'c:\\somedir';
$file = 'myimage.bmp';
if (is_dir($dir)) {
if($dhandle = opendir($dir)) {
$handle = printer_open();
printer_start_doc($handle, "My Document");
printer_start_page($handle);
printer_draw_bmp($handle, $file, 1, 1);
printer_end_page($handle);
printer_end_doc($handle);
printer_close($handle);
}
closedir($dhandle);
}
?>