Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP Printer How to use printer_draw_text Function
    text
    copied!<p>Sorry For my BAD English</p> <p>My Question is, how can I use <code>printer_draw_text</code> Function to print out a long String? (See example) on an <strong>Epson Billing Printer</strong>.</p> <p>All The examples work (source: <a href="http://www.php.net/manual/en/book.printer.php" rel="nofollow">http://www.php.net/manual/en/book.printer.php</a>)</p> <p>But when I want to combine a Logo.bmp + a long line of text it will only print out the logo and 1 line of sting:</p> <p><strong>Example:</strong></p> <pre><code>&lt;?php # DEMO PRINTER //http://fr.php.net/manual/en/function.printer-write.php /* $_SESSION['PrintBuffer']=''; //printer buffer print_sub_1(); print_sub_2(); print_sub_3(); $_SESSION['PrintBuffer'] */ $Printer_name = $_GET['Printer']; $text = $_GET['value']; $text = str_replace( '/r/n',PHP_EOL, $text); $handle = printer_open($Printer_name); // Open Pritner by Name printer_set_option($handle, PRINTER_MODE, "raw"); //printer_set_option($handle, PRINTER_TEXT_ALIGN, PRINTER_TA_LEFT); printer_start_doc($handle, "Print"); // Name Document printer_start_page($handle); // Start Logo printer_draw_bmp($handle, "c:\\logo.bmp", 60, 0); // Logo Dir, lenght H , With V printer_end_page($handle); // End Logo printer_start_page($handle); printer_draw_text($handle, $text,1,1); printer_end_page($handle); // printer_end_doc($handle); // Close document printer_close($handle); // Close Pritner ?&gt; </code></pre> <p><strong>Output Example:</strong></p> <p>Logo.bmp</p> <p>Test.... // But only 1 line :(</p> <p>The printer_write($handle, "Text to print"); Works !!! it prints out hole String + the \r\n But It prints out the logo on a new paper :( </p> <p>Needed example </p> <p>Logo &lt;-- here</p> <p>1 x product &lt;-- Long String 1 x product \r\n ( working printer_write function ) 2 x product ecr. </p> <p><code>printer_draw_text($handle, $text,1,1);</code> is printing out only 1 x product 2 x</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload