Some usage questions for printer extensions
Phpinfo (); exit;
Name of the printer, and initialize
$handle = Printer_open ("EPSON lq-735k esc/p2");
$name = "Twist vine";
$address = "No. 1801th, Hongmei Road, Shanghai";
Conversion format, UTF8 typed to garbled
$name = Iconv ("UTF-8", "GBK", $name);
$address = Iconv ("UTF-8", "GBK", $address);
Manually set the length and width of the paper, but this step does not start, the paper is still in accordance with the size of the A4 to print
Printer_set_option ($handle, Printer_paper_format,printer_format_custom);
Printer_set_option ($handle, printer_paper_width,320);
Printer_set_option ($handle, printer_paper_length,250);
Open Document
Printer_start_doc ($handle, "Print"); Name Document
Print the number of times, in fact, the above printer_set_option also have parameters, but also did not work
for ($i =1; $i <=2; $i + +)
{
Printer_start_page ($handle);
Printer_draw_text ($handle, $name. $i. $i. $i, 150,150);
Printer_draw_text ($handle, $address. $i. $i. $i, 250,250);
Printer_end_page ($handle); //
Print a picture
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_end_doc ($handle); Close Document
Printer_close ($handle); Close Pritner
Printer_set_option This step does not work, or according to A4 specifications in print, I would like to customize the specifications. I do not know which God has used this extension, to teach you a bit. (the printer in the Control Panel default specifications I have changed to custom specifications, but still according to A4 specifications in print)
------Solution--------------------
You look at your printer programmer's manual, all the printer control instructions are a string of ESC boot