ID: 22668
User updated by: rauf at ug dot bcc dot bilkent dot edu dot tr
Reported By: rauf at ug dot bcc dot bilkent dot edu dot tr
Status: Open
Bug Type: Unknown/Other Function
Operating System: Windows 2000
PHP Version: 4.3.1
New Comment:
?/ should be */ in the previous post
Previous Comments:
------------------------------------------------------------------------
[2003-03-12 18:20:15] rauf at ug dot bcc dot bilkent dot edu dot tr
This function (printer_write()) runs perfectly when i use the
following:
ob_start();
/* put some data on the screen ?/
echo("some text to be written\n");
echo("some other text to be written\n");
echo("another text to be written\n");
$handle = printer_open("Panasonic KX-P1150");
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_set_option($handle, PRINTER_COPIES, 1);
$string = ob_get_contents();
/* I'm using the data on the screen buffer */
printer_write($handle, $string);
printer_close($handle);
I have the following error message when i use the following code:
Warning: couldn't allocate the printerjob [1804] in
c:\apache\htdocs\... on line 148
the code is:
----------------
ob_start();
/* put some data on the screen ?/
echo("some text to be written\n");
echo("some other text to be written\n");
echo("another text to be written\n");
$handle = printer_open("Panasonic KX-P1150");
printer_set_option($handle, PRINTER_MODE, "RAW");
printer_set_option($handle, PRINTER_COPIES, 1);
$string = ob_get_contents();
/* I'm using the data on the screen buffer */
replaceTurkish($string)
/* this time i'm using this function that replaces
the Turkish characters with the English ones.
The function is given below */
printer_write($handle, $string);
printer_close($handle);
--------------------
function replaceTurkish(&$text)
{
$text = str_replace("�", "G", $text);
$text = str_replace("�", "U", $text);
$text = str_replace("�", "S", $text);
$text = str_replace("�", "I", $text);
$text = str_replace("�", "O", $text);
$text = str_replace("�", "C", $text);
$text = str_replace("�", "g", $text);
$text = str_replace("�", "u", $text);
$text = str_replace("�", "s", $text);
$text = str_replace("�", "i", $text);
$text = str_replace("�", "o", $text);
$text = str_replace("�", "c", $text);
}
----------------------------------
The same error occurs when I use:
printer_write($handle, "$string");
instead of
printer_write($handle, $string);
-----------------------------------
I've seen some similar bug reports closed because of the PHP version is
too old. I used the latest stable version but the same problem occurs.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22668&edit=1