PHP printing problem
Posted: Wed Oct 18, 2006 8:49 am
feyd | Please use
Is there another way to print to custom paper from php?
Edit/Delete Message
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
My php version is 5.1.6 and OS is WinXP.The printer is OKI microline3321 dot matrix.Here is the code:Code: Select all
$handle = printer_open("ML3321");
printer_set_option($handle,PRINTER_ORIENTATION,PRINTER_ORIENTATION_LANDSCAPE);
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);
printer_start_doc($handle,"PHP printing test");
$font = printer_create_font("Arial", 10, 7, PRINTER_FW_NORMAL,false, false, false, 0);
printer_select_font($handle, $font);
printer_start_page($handle);
printer_draw_text($handle,$var1,980,540);//is printed
printer_draw_text($handle,$var2,1080,540); //is NOT printed
printer_end_page($handle);
printer_delete_font($font);
printer_end_doc($handle);
printer_close($handle);Edit/Delete Message
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]