Some questions about the use of printer expansion

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