Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please add printer Xprinter XP-402B #1363

Open
higshinzui opened this issue Dec 21, 2024 · 1 comment
Open

please add printer Xprinter XP-402B #1363

higshinzui opened this issue Dec 21, 2024 · 1 comment

Comments

@higshinzui
Copy link

I want to use printer Xprinter XP-402B for my work for windows. thanks

@marianz-bonfire
Copy link

Hi, I came across this issue and thought it might be helpful to share how I resolved a similar problem. Hopefully, it helps someone else who encounters the same issue.

First, I’d like to confirm that the escpos-php library is compatible with the XPrinter XP-402B. I managed to get it working by following these steps:

✅ Ensure that your XPrinter XP-402B is properly installed on your Windows system.

  • Assign a clear, simple name to the printer (e.g., "XP-402B") and make sure the name has no spaces.
  • You can Print Test Page to very if its properly setup.
  • (Optional) Share the printer on your network to make it accessible to other devices.

Image

Here’s the code that worked for me:

$printerName = 'XP-402B'; 
$connector = new WindowsPrintConnector($printerName);
$printer = new Printer($connector);
$printer -> text("Hello World!\n");
$printer -> cut();
$printer -> close();

✅ If you want to print via Bluetooth, you can check this php-bluetooth-windows repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants