SHARE
TWEET

Untitled

a guest Jun 18th, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. error_reporting(0);
  2. if($handle = printer_open('Canon G3010 series')){
  3.     printer_set_option($handle, PRINTER_MODE, 'RAW');
  4.     printer_start_doc($handle);
  5.     printer_start_page($handle);
  6.     $n=1;
  7.  
  8.      $line1 = ('中华人民共和国');
  9.  
  10.  
  11.     $font = printer_create_font('Arial', 90, 50, 100, false, false, false, 0);
  12.     printer_select_font($handle, $font);
  13.     $n++;$n++;$n++;
  14.     $n++;$n++;$n++;
  15.     printer_draw_text($handle, $line1, 10, 60);
  16.  
  17.     $font = printer_create_font('Arial', 90, 50, 100, false, false, false, 0);
  18.     printer_select_font($handle, $font);
  19.     printer_draw_text($handle, $line2, 10, 10);
  20.     printer_draw_text($handle, $line3, 10, 10);
  21.     printer_draw_text($handle, $line4, 10, 10);
  22.  
  23.     printer_delete_font($font);
  24.     printer_end_page($handle);
  25.     printer_end_doc($handle);
  26.     printer_close($handle);
  27.     echo 'Impresion exitosa.';
  28. }else{
  29.     echo 'No se pudo conectar a la impresora.';
  30. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top