Prerequisites
Before you begin, make sure you have:- APM Windows Service installed and running (see Installation)
- A thermal printer configured in APM
- Basic knowledge of JavaScript and WebSocket connections
Step 1: Start the APM service
Verify the service is running
Check that the APM Windows Service is running. You can verify this through the Windows Services panel or the system tray icon.The WebSocket server should be listening on port 7000.
Step 2: Configure a printer
Open the MAUI application
Launch the APM configuration application from the Start Menu or desktop shortcut.
Add a printer
Navigate to the Printers section and click Add Printer. Configure your thermal printer with these settings:
- Printer ID:
main-printer - Connection Type: TCP/IP (or USB/IPP based on your setup)
- IP Address: Your printer’s IP address (e.g.,
192.168.1.100) - Port:
9100(default for most thermal printers) - Paper Width:
80mm (or58mm for smaller printers)
Step 3: Send your first print job
Create an HTML file with the following code to send a print job via WebSocket:Understanding the print job structure
ThePrintJobRequest object contains:
Must be
"PRINT_JOB_REQUEST" for print jobsUnique identifier for tracking the print job
Identifier for the workstation sending the request
Must match a printer ID configured in APM (e.g.,
"main-printer")Type of document to print. Common types:
ticket_venta- Sales receiptcomanda- Kitchen orderfactura_electronica- Electronic invoicesticker- Barcode label
The actual data to print. Structure varies by DocumentType. Must include fields referenced in your print template.
Next steps
Configure more printers
Set up multiple printers with different connection types
Customize templates
Design custom receipt layouts with the template editor
Integrate scales
Add scale data capture for weighing products
Explore the API
Learn about all available WebSocket API features
Troubleshooting
Connection refused error
Connection refused error
Cause: The APM Windows Service is not running or is listening on a different port.Solution:
- Check if the service is running in Windows Services
- Verify the WebSocket port is 7000 in the service configuration
- Check Windows Firewall settings
Printer not found error
Printer not found error
Cause: The
PrinterId doesn’t match any configured printer.Solution:- Open the APM MAUI application
- Go to Printers section
- Verify your printer ID matches exactly (case-sensitive)
- Make sure the printer is enabled
Template not found error
Template not found error
Cause: No template exists for the specified
DocumentType.Solution:- APM includes default templates for common document types
- Check the Templates section in the MAUI app
- Create a custom template if needed for your document type
Print job succeeds but nothing prints
Print job succeeds but nothing prints
Cause: Printer connectivity issue.Solution:
- Verify printer IP address and port
- Test printer connectivity with a ping command
- Check if printer is online and has paper
- Review logs in the APM MAUI application