>Printing works fine, however 2 problems:
>
>1. linefeed ("\n") doesn't work
>
>2. escape sequences to print BOLD, ITALIC, UNDERLINE,
>NARROW don't work

Probably the same problem, really.

>    $lp = popen("lpr -Plp1", "w");

I'm guessing that popen uses the shell or something, and it's "eating" your
control characters.

Try things like:

$print_string = "\"$print_string\"";
>    $bytes_written = fwrite($lp, $print_string);

$print_string = str_replace("\n", "\\n", $print_string);
>    $bytes_written = fwrite($lp, $print_string);


I suspect that something along those lines of convincing the shell to leave
your data alone will fix your problems.



It may also be a Good Idea to add:

if ($bytes_written != ($strlen = strlen($print_string)){
  die("Only wrote $bytes_written of $strlen characters");
}


-- 
Like Music?  http://l-i-e.com/artists.htm

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to