29-latvian-star-tup592.php 1017B

1234567891011121314151617181920212223242526
  1. <?php
  2. require __DIR__ . '/../../vendor/autoload.php';
  3. use Mike42\Escpos\CapabilityProfile;
  4. use Mike42\Escpos\Printer;
  5. use Mike42\Escpos\PrintConnectors\FilePrintConnector;
  6. use Mike42\Escpos\PrintBuffers\ImagePrintBuffer;
  7. /* This example shows the printing of Latvian text on the Star TUP 592 printer */
  8. $profile = CapabilityProfile::load("SP2000");
  9. /* Option 1: Native character encoding */
  10. $connector = new FilePrintConnector("php://stdout");
  11. $printer = new Printer($connector, $profile);
  12. $printer -> text("Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus\n");
  13. $printer -> cut();
  14. $printer -> close();
  15. /* Option 2: Image-based output (formatting not available using this output) */
  16. $buffer = new ImagePrintBuffer();
  17. $connector = new FilePrintConnector("php://stdout");
  18. $printer = new Printer($connector, $profile);
  19. $printer -> setPrintBuffer($buffer);
  20. $printer -> text("Glāžšķūņa rūķīši dzērumā čiepj Baha koncertflīģeļu vākus\n");
  21. $printer -> cut();
  22. $printer -> close();