1 2 3 4 5 6 7 8 9 10 11 12 13 |
<?php /* get the sample text */ $lipsum = file_get_contents('lipsum.txt'); /* open a connection to the printer */ $printer = printer_open("Lexmark X850e XL V"); /* write the text to the print job */ printer_write($printer, $lipsum); /* close the connection */ printer_close($printer); ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
<?php /* get the sample text */ $lipsum = file_get_contents('lipsum.txt'); /* open a connection to the printer */ $printer = printer_open("PDFCreator"); printer_start_doc($printer, "Doc"); printer_start_page($printer); /* font management */ $barcode = printer_create_font("Free 3 of 9 Extended", 400, 200, PRINTER_FW_NORMAL, false, false, false, 0); $arial = printer_create_font("Arial", 148, 76, PRINTER_FW_MEDIUM, false, false, false, 0); /* write the text to the print job */ printer_select_font($printer, $barcode); printer_draw_text($printer, "*123456*", 50, 50); printer_select_font($printer, $arial); printer_draw_text($printer, "123456", 250, 500); /* font management */ printer_delete_font($barcode); printer_delete_font($arial); /* close the connection */ printer_end_page($printer); printer_end_doc($printer); printer_close($printer); ?> |
buenos días, tengo una pregunta sobre tu programación. hace falta q este instalada?? me refiero al driver.
Evidentemente tienes que estar instalada en el sistema operativo que utilice. Esto es un ejemplo bastante simple, te recomiendo usar clases php en google tienes varias.
Un saludo : )