Requirement:
- Computer with Windows operating system
- Computer with available USB port
- Any web browser
- Windows enables shared printing service
- Windows enable Samba 1.0 service
Printer installation
- Plug the USB into a computer, and prepare the paper roll in the printer.
- Turn on the printer and Windows shall ask for a new driver.
- Download the official driver from the printer office site
- Once installation is complete, you should see the printer from your Windows printer lists
- Make sure your windows have printer share service enabled on window startup and enable it automatically as the following instructions:
Install lightweight PHP service on the computer to handle the print job from the Web Browser
- Download "Laragon" from this LINK or our fixed archived HERE
- Execute the installer downloaded, first option ONLY choose "Run Laragon when Windows Starts", rest uncheck.
- Once installation is complete, it should start Larafon in your "Taskbar"
- Double-click to open the interface, if the service starts, choose "Stop", we'll need to do some quick configuration to Laragon
- One-Stop, select the gear icon on the top right of the windows to configure the Laragon
- In "General" you should have the setting as follow, except for the "Document Root" and "Data Directory", The rest should follow as highlighted
- Under Service & Ports, make sure to have the following service also. Important is the Apache port with "8888"
- Mail Catcher and Mail Sender shall be disabled as we do not need such service as follows:
- It will open your directory root folder windows and should only have 1 file called "index.php"
- Right-click open the index.php and "edit" with notepad.exe
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
);
}
- Now Laragon can "close" and it shall be hiding in the taskbar and automatically startup with Windows by default.
- Save it and that's all, you can "test" it by calling from the 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. - And add new data for printer information
Important Step:
Printer installation STEP 5 AND STEP 6
Install lightweight PHP service STEP 2 OPTION OF INSTALLATION LARAGON
Install lightweight PHP service STEP 3, MUST TICK BOTH FIREWALL OF COMPUTER ACCESS
Install lightweight PHP service STEP 7, MUST CHANGE THE PORT TO BE 8888
Install lightweight PHP service STEP 13 AND STEP 16