Overview
The Bridge Plugin enables direct printer communication without the browser’s print dialog. It connects to a local service that manages printer communication, allowing you to:- Print directly to specific printers
- Get a list of available printers
- Check printer status
- Send multiple print jobs programmatically
- Skip the browser print dialog entirely
Prerequisites
- Bridge Service: You need the print bridge service running locally (see Bridge Service Setup)
- Local Network: The bridge service must be accessible from your application
- Printer Access: The bridge service must have access to system printers
Installation
The bridge plugin is included in the main package:Basic Setup
1. Import the Bridge Plugin
2. Bridge Configuration Options
All available bridge plugin options fromsrc/types.ts:58:
Server Configuration
Development Setup
For local development with default settings:Production Setup
For production with custom server:Custom Port Configuration
Using the Bridge Plugin
Method 1: Using usePrintBridge Composable
TheusePrintBridge composable provides reactive state and methods (see src/plugins/bridge-plugin.ts:149):
Method 2: Using Global Bridge Instance
Access bridge directly from global properties:Printer Selection
Automatic Default Printer Selection
WithautoSelectDefault: true, the plugin automatically selects a default printer:
src/plugins/bridge-plugin.ts:66:
- First tries to find a printer marked as default by the system
- Falls back to the first available printer if no default is marked
Manual Printer Selection
Specifying Default Printer on Setup
Bridge State Management
The bridge plugin maintains reactive state (seesrc/plugins/bridge-plugin.ts:9):
Accessing Bridge State
Printing with Bridge
Using Print Options
Using Direct Print Method
Checking Bridge Status
Health Check
Getting Available Printers
Error Handling
Troubleshooting
Bridge Not Connecting
-
Check if bridge service is running:
-
Enable debug logging:
-
Increase timeout and retries:
No Printers Found
Next Steps
TypeScript Support
Learn about TypeScript types and interfaces
Configuration
Explore all configuration options in detail