Some usage questions about printer expansion

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.