Php problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • lazaroskyr
    New Member
    • Jul 2006
    • 1

    Php problem

    My php version is 5.1.6 and OS is WinXP.The printer is OKI microline3321 dot matrix.Here is the code:

    php:
    [PHP]$handle = printer_open("M L3321");
    printer_set_opt ion($handle,PRI NTER_ORIENTATIO N,PRINTER_ORIEN TATION_LANDSCAP E);
    printer_set_opt ion($handle,PRI NTER_PAPER_FORM AT, PRINTER_FORMAT_ CUSTOM);
    printer_set_opt ion($handle,PRI NTER_PAPER_WIDT H,320);
    printer_set_opt ion($handle,PRI NTER_PAPER_LENG TH,250);
    printer_start_d oc($handle,"PHP printing test");
    $font = printer_create_ font("Arial", 10, 7, PRINTER_FW_NORM AL,false, false, false, 0);
    printer_select_ font($handle, $font);
    printer_start_p age($handle);

    printer_draw_te xt($handle,$var 1,980,540);//is printed
    printer_draw_te xt($handle,$var 2,1080,540); //is NOT printed

    printer_end_pag e($handle);
    printer_delete_ font($font);
    printer_end_doc ($handle);
    printer_close($ handle);
    [/PHP]

    Is there another way to print to custom paper from php?
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    PHP itself does not have printer handling code. Usually the best way, without tying yourself to a data stream and dedicated devices, is to do your page makeup via a CSS dedicated print media stylesheet and using javascript window.print to actually start the print itself.

    Ronald :cool:

    Comment

    Working...