Page tree
Skip to end of metadata
Go to start of metadata

Requirement:

  • Computer with Windows operating system
  • Computer with available USB port
  • Any web browser
  • Windows enable share printing service
  • Windows enable Samba 1.0 service

Printer installation

  1. Plugin USB to a computer, and prepare the Ppaper roll in the printer.
  2. Turn on the printer and Windows shall ask for a new driver.
  3. Download the official driver from printer office site
  4. Once installation is complete, you should see the printer from your Windows printer lists
  5. Make sure your windows have printer share service enabled on window startup and enable automatically as following instructions:
  6. Make sure the printer is "Shared", if not; open "Printer Properties" from windows Hardware and printer list, and enabled "Share this printer" with the fixed text "LOCAL".


Install lightweight PHP service on the computer to handle the print job from Web Browser

  1. Download "Laragon" from this LINK or our fixed archived HERE


  2. Execute the installer downloaded, first option ONLY chose "Run Laragon when Windows Starts", rest uncheck.
  3. If admistrator of computer request your confirm for firewall access and tick both setting for local and public access.
  4. Once installation is complete, it should start Larafon in your "Taskbar"
  5. Double click to open the interface, if the service started, chose "Stop", we'll need to do some quick configuration to Laragon


  6. One-Stop, select the gear icon on the top right of the windows to configure the Laragon
  7. In "General" you should have the setting as follow, except for the "Document Root" and "Data Directory", rest should follow as highlighted
  8. Under Service & Ports, make sure have following service also. Important is the Apache port with "8888"
  9. Mail Catcher and Mail Sender shall disable as we do not need such service as follow:
  10. Once configured, just save by closing this "Preferences" windows with "x" icon on top right.
  11. Now we'll put an "index.php" file into the "Root" Directory. Open the WWW root directory by clicking the "Root" Icons
  12. It will open your directory root folder windows and should only have 1 file called "index.php"


  13. Right-click open the index.php and "edit" with notepad.exe
  14. Once you have the file open, remove all the contents in the file and replace them with the following codes:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12

    <?php
    header('Access-Control-Allow-Origin: *');
    $printer = "\\\\localhost\\LOCAL";
    $CMD = $_REQUEST['CMD'];
    if($CMD != "") {
        $tmpfname = tempnam(sys_get_temp_dir(), 'LBL');
        file_put_contents($tmpfname, $CMD);
        $newname = str_replace(pathinfo($tmpfname, PATHINFO_EXTENSION), 'prn', $tmpfname);
        rename($tmpfname, $newname);
        copy($newname, $printer);
        unlink($newname);
    }

  15. Now Laragon can "close" and it shall be hiding in the taskbar and automatically startup with Windows by default.
  16. Save it and that all, you can "test" it by calling from browser: http://localhost:8888/ and should have the following screen.

    This is fine because we are waiting for the POS print command from the POS Printing program.
  17. Download additional file from this escposprint.zip and copy the escposprint.php file's to root directory as same location with indes.php file  
  18. Once completed above step ,Then you shall "Start All"
  19. Next setup printer ip and name of printer in winx program site
    (Location >> Assign program manue list  = Admin & System > Property Management > Printer
    )
  20. And add new data for printer information


After completed all step above than trying testing in POS program

Important Step:

  1. Printer installation STEP 5 AND STEP 6

  2. Install lightweight PHP service STEP 2 OPTION OF INSTALLATION LARAGON

  3. Install lightweight PHP service STEP 3, MUST TICK BOTH FIREALL OF COMPUTER ACCESS

  4. Install lightweight PHP service STEP 7, MUST CHANGE TH EPORT TO BE 8888

  5. Install lightweight PHP serviceSTEP 13 AND STEP 16


 

  • No labels