Some usage questions about printer extensions // phpinfo (); exit; // printer name, and initialize $ handle & nbsp ;=& nbsp; printer_open ("EPSON & nbsp; LQ-735K & nbsp; ESC/P2 "); $ name printer extends some usage questions
// Phpinfo (); exit;
// Name of the printer and initialize it
$ Handle = printer_open ("EPSON LQ-735K ESC/P2 ");
$ Name = "Mahua Vine ";
$ Address = "No. 1801, Hongmei Road, Shanghai ";
// Format conversion. garbled characters are output by UTF8.
$ 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 work. The paper is still printed according to the A4 size.
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 );
// Enable the document
Printer_start_doc ($ handle, "Print"); // Name Document
// Number of prints. In fact, the printer_set_option parameter also exists, but it does not work.
For ($ I = 1; $ I <= 2; $ I ++)
{
Printer_start_page ($ handle );
Printer_draw_text ($ handle, $ name. $ I, 150,150 );
Printer_draw_text ($ handle, $ address. $ I, 250,250 );
Printer_end_page ($ handle );//
// Print the image
// 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 does not work in this step. it is still printed according to the A4 specification. I want to customize the specification myself. I don't know which great God has used this extension. please advise. (I have changed the default printer specification in the control panel to a custom one, but it is still printed according to the A4 specification)
------ Solution --------------------
Check out your printer Programmer Manual. all printer control commands are a string guided by Esc.