@crowsgear/escl-protocol-scanner 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,31 +4,33 @@ A comprehensive TypeScript/Node.js library for discovering and communicating wit
4
4
 
5
5
  ## Features
6
6
 
7
- - 🔍 **Automatic Scanner Discovery**: Uses mDNS/Bonjour to discover eSCL-compatible scanners on the local network
8
- - 📡 **HTTP-based Communication**: eSCL protocol built on HTTP for reliable device communication
9
- - 🎨 **Multiple Color Modes**: Support for Black & White, Grayscale, and Full Color scanning
10
- - 📊 **Flexible Resolution**: Supports various DPI settings (150, 200, 300, 600 DPI, etc.)
11
- - 📄 **Multi-source Scanning**: Platen (flatbed) and ADF (Automatic Document Feeder) support
12
- - 📸 **Image Processing**: Automatic rotation correction and PNG encoding
13
- - 🔧 **Python Backend**: Uses Python subprocess for reliable mDNS discovery via zeroconf
14
- - ✨ **Production Ready**: Mature implementation from scanner-net project
7
+ - 🔍 **Automatic Scanner Discovery**: Uses mDNS/Bonjour to discover eSCL-compatible scanners on the local network
8
+ - 📡 **HTTP-based Communication**: eSCL protocol built on HTTP for reliable device communication
9
+ - 🎨 **Multiple Color Modes**: Support for Black & White, Grayscale, and Full Color scanning
10
+ - 📊 **Flexible Resolution**: Supports various DPI settings (150, 200, 300, 600 DPI, etc.)
11
+ - 📄 **Multi-source Scanning**: Platen (flatbed) and ADF (Automatic Document Feeder) support
12
+ - 📸 **Image Processing**: Automatic rotation correction and PNG encoding
13
+ - 🔧 **Python Backend**: Uses Python subprocess for reliable mDNS discovery via zeroconf
14
+ - ✨ **Production Ready**: Mature implementation from scanner-net project
15
15
 
16
16
  ## Supported Devices
17
17
 
18
18
  Compatible with network scanners from major manufacturers:
19
- - **Canon**: iR-series MFP devices
20
- - **HP**: LaserJet MFP devices
21
- - **Xerox**: WorkCentre series
22
- - **Ricoh**: MP series
23
- - **Epson**: WorkForce Pro series
24
- - **And other AirPrint-compatible MFP devices**
19
+
20
+ - **Canon**: iR-series MFP devices
21
+ - **HP**: LaserJet MFP devices
22
+ - **Xerox**: WorkCentre series
23
+ - **Ricoh**: MP series
24
+ - **Epson**: WorkForce Pro series
25
+ - **And other AirPrint-compatible MFP devices**
25
26
 
26
27
  ## Installation
27
28
 
28
29
  ### Prerequisites
29
- - Node.js ≥ 14.0.0
30
- - Python 3.6+
31
- - Python packages: `zeroconf`, `pillow`
30
+
31
+ - Node.js 14.0.0
32
+ - Python 3.6+
33
+ - Python packages: `zeroconf`, `pillow`
32
34
 
33
35
  ### Step 1: Install Package
34
36
 
@@ -39,6 +41,7 @@ yarn add @escl-protocol/scanner
39
41
  ```
40
42
 
41
43
  The postinstall script will:
44
+
42
45
  1. Check for required Python packages (`zeroconf`, `pillow`)
43
46
  2. **Interactively ask** if you want to install missing packages
44
47
  3. Install to the Python environment specified by `PYTHON_PATH` (or system python3)
@@ -125,19 +128,19 @@ npm start
125
128
  import { discoverScanners, ESCLClient } from '@escl-protocol/scanner';
126
129
 
127
130
  async function example() {
128
- // 1. Discover available scanners (5 second discovery window)
129
- const scanners = await discoverScanners(5000);
130
- console.log(`Found ${scanners.length} scanners`);
131
+ // 1. Discover available scanners (5 second discovery window)
132
+ const scanners = await discoverScanners(5000);
133
+ console.log(`Found ${scanners.length} scanners`);
131
134
 
132
- if (scanners.length === 0) {
133
- console.log('No scanners found on network');
134
- return;
135
- }
135
+ if (scanners.length === 0) {
136
+ console.log('No scanners found on network');
137
+ return;
138
+ }
136
139
 
137
- // 2. Get scanner info
138
- const scanner = scanners[0];
139
- console.log(`Scanner: ${scanner.name}`);
140
- console.log(`Host: ${scanner.host}:${scanner.port}`);
140
+ // 2. Get scanner info
141
+ const scanner = scanners[0];
142
+ console.log(`Scanner: ${scanner.name}`);
143
+ console.log(`Host: ${scanner.host}:${scanner.port}`);
141
144
  }
142
145
 
143
146
  example();
@@ -151,14 +154,14 @@ import { discoverScanners, ESCLScanner } from '@escl-protocol/scanner';
151
154
  // Quick discovery
152
155
  const scanners = await discoverScanners(5000);
153
156
 
154
- scanners.forEach(scanner => {
155
- console.log(`${scanner.name} at ${scanner.host}:${scanner.port}`);
156
- if (scanner.manufacturer) {
157
- console.log(` Manufacturer: ${scanner.manufacturer}`);
158
- }
159
- if (scanner.model) {
160
- console.log(` Model: ${scanner.model}`);
161
- }
157
+ scanners.forEach((scanner) => {
158
+ console.log(`${scanner.name} at ${scanner.host}:${scanner.port}`);
159
+ if (scanner.manufacturer) {
160
+ console.log(` Manufacturer: ${scanner.manufacturer}`);
161
+ }
162
+ if (scanner.model) {
163
+ console.log(` Model: ${scanner.model}`);
164
+ }
162
165
  });
163
166
  ```
164
167
 
@@ -172,9 +175,9 @@ const client = new ESCLClient();
172
175
 
173
176
  const capabilities = await client.getCapabilities(scanners[0]);
174
177
  if (capabilities) {
175
- console.log('Supported Resolutions:', capabilities.resolutions);
176
- console.log('Color Modes:', capabilities.colorModes);
177
- console.log('Scan Sources:', capabilities.sources);
178
+ console.log('Supported Resolutions:', capabilities.resolutions);
179
+ console.log('Color Modes:', capabilities.colorModes);
180
+ console.log('Scan Sources:', capabilities.sources);
178
181
  }
179
182
  ```
180
183
 
@@ -188,15 +191,15 @@ const client = new ESCLClient();
188
191
 
189
192
  // Create scan job
190
193
  const jobId = await client.createScanJob(
191
- scanners[0],
192
- 300, // DPI (300 DPI)
193
- 'RGB24', // Color mode (Full Color)
194
- 'Platen' // Source (Flatbed)
194
+ scanners[0],
195
+ 300, // DPI (300 DPI)
196
+ 'RGB24', // Color mode (Full Color)
197
+ 'Platen' // Source (Flatbed)
195
198
  );
196
199
 
197
200
  if (!jobId) {
198
- console.error('Failed to create scan job');
199
- process.exit(1);
201
+ console.error('Failed to create scan job');
202
+ process.exit(1);
200
203
  }
201
204
 
202
205
  // Poll for completion
@@ -204,31 +207,31 @@ let completed = false;
204
207
  let attempts = 0;
205
208
 
206
209
  while (!completed && attempts < 30) {
207
- const status = await client.getScanJobStatus(scanners[0], jobId);
208
-
209
- if (status.status === 'Completed') {
210
- // Download images
211
- for (const imageUrl of status.images) {
212
- const imageBuffer = await client.downloadImage(scanners[0], imageUrl);
213
- if (imageBuffer) {
214
- console.log('Downloaded image:', imageBuffer.length, 'bytes');
215
- }
210
+ const status = await client.getScanJobStatus(scanners[0], jobId);
211
+
212
+ if (status.status === 'Completed') {
213
+ // Download images
214
+ for (const imageUrl of status.images) {
215
+ const imageBuffer = await client.downloadImage(scanners[0], imageUrl);
216
+ if (imageBuffer) {
217
+ console.log('Downloaded image:', imageBuffer.length, 'bytes');
218
+ }
219
+ }
220
+ completed = true;
221
+ } else if (status.status === 'Aborted') {
222
+ console.error('Scan was aborted');
223
+ process.exit(1);
224
+ } else {
225
+ console.log(`Scan progress: ${status.status}`);
226
+ // Wait before next poll
227
+ await new Promise((resolve) => setTimeout(resolve, 1000));
228
+ attempts++;
216
229
  }
217
- completed = true;
218
- } else if (status.status === 'Aborted') {
219
- console.error('Scan was aborted');
220
- process.exit(1);
221
- } else {
222
- console.log(`Scan progress: ${status.status}`);
223
- // Wait before next poll
224
- await new Promise(resolve => setTimeout(resolve, 1000));
225
- attempts++;
226
- }
227
230
  }
228
231
 
229
232
  if (!completed) {
230
- console.error('Scan job timeout');
231
- process.exit(1);
233
+ console.error('Scan job timeout');
234
+ process.exit(1);
232
235
  }
233
236
  ```
234
237
 
@@ -242,16 +245,16 @@ import { discoverScanners, quickScan } from '@escl-protocol/scanner';
242
245
  const scanners = await discoverScanners(5000);
243
246
 
244
247
  const images = await quickScan({
245
- scanner: scanners[0],
246
- dpi: 300,
247
- mode: 'color', // 'bw' | 'gray' | 'color'
248
- source: 'Platen', // 'Platen' | 'Feeder'
249
- timeout: 30000
248
+ scanner: scanners[0],
249
+ dpi: 300,
250
+ mode: 'color', // 'bw' | 'gray' | 'color'
251
+ source: 'Platen', // 'Platen' | 'Feeder'
252
+ timeout: 30000,
250
253
  });
251
254
 
252
255
  if (images) {
253
- console.log(`Scanned ${images.length} images`);
254
- // images are base64-encoded PNG data
256
+ console.log(`Scanned ${images.length} images`);
257
+ // images are base64-encoded PNG data
255
258
  }
256
259
  ```
257
260
 
@@ -262,59 +265,66 @@ The library provides two different ways to perform scans, each with different us
262
265
  ### Low-Level API: `client.createScanJob()`
263
266
 
264
267
  **Use this when you need:**
265
- - Fine-grained control over the scanning process
266
- - Custom polling intervals or timeout logic
267
- - To handle batch scanning with specific error recovery
268
- - Advanced features like job cancellation
268
+
269
+ - Fine-grained control over the scanning process
270
+ - Custom polling intervals or timeout logic
271
+ - To handle batch scanning with specific error recovery
272
+ - Advanced features like job cancellation
269
273
 
270
274
  **How it works:**
275
+
271
276
  1. Create scan job with parameters → returns Job ID
272
277
  2. Poll `getScanJobStatus()` to check completion
273
278
  3. Download each image with `downloadImage()`
274
279
  4. Manually manage job lifecycle
275
280
 
276
281
  **Example:**
282
+
277
283
  ```typescript
278
284
  // Step 1: Create job
279
285
  const jobId = await client.createScanJob(scanner, 300, 'RGB24', 'Platen');
280
286
 
281
287
  // Step 2: Poll for completion with custom logic
282
288
  while (!completed) {
283
- const status = await client.getScanJobStatus(scanner, jobId);
284
-
285
- if (status.status === 'Completed') {
286
- // Step 3: Download images
287
- for (const imageUrl of status.images) {
288
- const buffer = await client.downloadImage(scanner, imageUrl);
289
- // Custom processing...
289
+ const status = await client.getScanJobStatus(scanner, jobId);
290
+
291
+ if (status.status === 'Completed') {
292
+ // Step 3: Download images
293
+ for (const imageUrl of status.images) {
294
+ const buffer = await client.downloadImage(scanner, imageUrl);
295
+ // Custom processing...
296
+ }
297
+ completed = true;
290
298
  }
291
- completed = true;
292
- }
293
299
 
294
- await new Promise(r => setTimeout(r, 1000)); // Custom delay
300
+ await new Promise((r) => setTimeout(r, 1000)); // Custom delay
295
301
  }
296
302
  ```
297
303
 
298
304
  **Pros:**
299
- - Maximum flexibility and control
300
- - Custom error handling strategies
301
- - Can implement custom polling logic
302
- - Direct access to job status
305
+
306
+ - Maximum flexibility and control
307
+ - Custom error handling strategies
308
+ - Can implement custom polling logic
309
+ - Direct access to job status
303
310
 
304
311
  **Cons:**
305
- - More code to write and maintain
306
- - More opportunities for bugs
307
- - Requires manual resource cleanup
312
+
313
+ - More code to write and maintain
314
+ - More opportunities for bugs
315
+ - Requires manual resource cleanup
308
316
 
309
317
  ### High-Level API: `quickScan()`
310
318
 
311
319
  **Use this when you need:**
312
- - Simple one-shot scanning (most common case)
313
- - Fast implementation without boilerplate
314
- - Automatic error handling and cleanup
315
- - Sensible defaults for typical scanning scenarios
320
+
321
+ - Simple one-shot scanning (most common case)
322
+ - Fast implementation without boilerplate
323
+ - Automatic error handling and cleanup
324
+ - Sensible defaults for typical scanning scenarios
316
325
 
317
326
  **How it works:**
327
+
318
328
  1. Creates scan job automatically
319
329
  2. Waits and polls for completion (~5 second intervals)
320
330
  3. Downloads all images
@@ -322,83 +332,90 @@ while (!completed) {
322
332
  5. Cleans up job automatically
323
333
 
324
334
  **Example:**
335
+
325
336
  ```typescript
326
337
  const filePaths = await quickScan({
327
- scanner: scanners[0],
328
- dpi: 300,
329
- mode: 'color', // 'bw' | 'gray' | 'color'
330
- source: 'Platen', // 'Platen' | 'Feeder'
331
- savePath: './scans' // optional, defaults to cwd()
338
+ scanner: scanners[0],
339
+ dpi: 300,
340
+ mode: 'color', // 'bw' | 'gray' | 'color'
341
+ source: 'Platen', // 'Platen' | 'Feeder'
342
+ savePath: './scans', // optional, defaults to cwd()
332
343
  });
333
344
 
334
345
  if (filePaths) {
335
- console.log(`Scanned ${filePaths.length} images`);
336
- filePaths.forEach(path => console.log(` - ${path}`));
346
+ console.log(`Scanned ${filePaths.length} images`);
347
+ filePaths.forEach((path) => console.log(` - ${path}`));
337
348
  }
338
349
  ```
339
350
 
340
351
  **Pros:**
341
- - Minimal code required
342
- - Automatic cleanup on success/failure
343
- - Returns file paths ready for use
344
- - Built-in error handling
345
- - Best for simple scanning tasks
352
+
353
+ - Minimal code required
354
+ - Automatic cleanup on success/failure
355
+ - Returns file paths ready for use
356
+ - Built-in error handling
357
+ - Best for simple scanning tasks
346
358
 
347
359
  **Cons:**
348
- - Less control over polling
349
- - Fixed timeout/retry logic
350
- - Cannot implement custom scanning workflows
360
+
361
+ - Less control over polling
362
+ - Fixed timeout/retry logic
363
+ - Cannot implement custom scanning workflows
351
364
 
352
365
  ### Comparison Table
353
366
 
354
- | Feature | `createScanJob()` | `quickScan()` |
355
- |---------|-------------------|---------------|
356
- | **Typical Use** | Advanced, custom workflows | Simple one-shot scans |
357
- | **Code Required** | ~30+ lines | ~10 lines |
358
- | **Control Level** | Full | Limited |
359
- | **Error Handling** | Manual | Automatic |
360
- | **Cleanup** | Manual | Automatic |
361
- | **Polling Logic** | Custom | Built-in (~5s intervals) |
362
- | **Return Type** | Job ID (string) | File paths (string[]) |
363
- | **Learning Curve** | Moderate | Easy |
364
- | **Best For** | Integrations, batch jobs | Desktop apps, CLI tools |
367
+ | Feature | `createScanJob()` | `quickScan()` |
368
+ | ------------------ | -------------------------- | ------------------------ |
369
+ | **Typical Use** | Advanced, custom workflows | Simple one-shot scans |
370
+ | **Code Required** | ~30+ lines | ~10 lines |
371
+ | **Control Level** | Full | Limited |
372
+ | **Error Handling** | Manual | Automatic |
373
+ | **Cleanup** | Manual | Automatic |
374
+ | **Polling Logic** | Custom | Built-in (~5s intervals) |
375
+ | **Return Type** | Job ID (string) | File paths (string[]) |
376
+ | **Learning Curve** | Moderate | Easy |
377
+ | **Best For** | Integrations, batch jobs | Desktop apps, CLI tools |
365
378
 
366
379
  ### Recommendation
367
380
 
368
381
  **Choose `quickScan()` unless you have specific reasons not to:**
369
- - It's the recommended approach for most use cases
370
- - Handles all the complexity automatically
371
- - Reduces bugs and improves maintainability
372
- - Perfect for Electron, CLI, and batch applications
382
+
383
+ - It's the recommended approach for most use cases
384
+ - Handles all the complexity automatically
385
+ - Reduces bugs and improves maintainability
386
+ - Perfect for Electron, CLI, and batch applications
373
387
 
374
388
  **Choose `createScanJob()` only if:**
375
- - You need custom polling behavior
376
- - Implementing a queue system
377
- - Building advanced scanning workflows
378
- - Integrating with custom error handling
389
+
390
+ - You need custom polling behavior
391
+ - Implementing a queue system
392
+ - Building advanced scanning workflows
393
+ - Integrating with custom error handling
379
394
 
380
395
  ## API Reference
381
396
 
382
397
  ### Types
383
398
 
384
399
  #### `ESCLScanner`
400
+
385
401
  ```typescript
386
402
  interface ESCLScanner {
387
- name: string; // Scanner display name
388
- host: string; // IP address
389
- port: number; // HTTP port (usually 80)
390
- serviceName?: string; // Full mDNS service name
391
- model?: string; // Device model (if available)
392
- manufacturer?: string; // Device manufacturer (if available)
403
+ name: string; // Scanner display name
404
+ host: string; // IP address
405
+ port: number; // HTTP port (usually 80)
406
+ serviceName?: string; // Full mDNS service name
407
+ model?: string; // Device model (if available)
408
+ manufacturer?: string; // Device manufacturer (if available)
393
409
  }
394
410
  ```
395
411
 
396
412
  #### `ESCLCapabilities`
413
+
397
414
  ```typescript
398
415
  interface ESCLCapabilities {
399
- resolutions: number[]; // Available DPI values
400
- colorModes: ('BlackAndWhite1' | 'Grayscale8' | 'RGB24')[]; // Available color modes
401
- sources: ('Platen' | 'Adf' | 'Feeder')[]; // Available scan sources
416
+ resolutions: number[]; // Available DPI values
417
+ colorModes: ('BlackAndWhite1' | 'Grayscale8' | 'RGB24')[]; // Available color modes
418
+ sources: ('Platen' | 'Adf' | 'Feeder')[]; // Available scan sources
402
419
  }
403
420
  ```
404
421
 
@@ -410,12 +427,12 @@ Main client for communicating with eSCL scanners.
410
427
 
411
428
  ```typescript
412
429
  class ESCLClient {
413
- constructor(timeout?: number);
430
+ constructor(timeout?: number);
414
431
 
415
- async getCapabilities(scanner: ESCLScanner): Promise<ESCLCapabilities | null>;
416
- async createScanJob(scanner: ESCLScanner, dpi: number, colorMode: string, source: string): Promise<string | null>;
417
- async getScanJobStatus(scanner: ESCLScanner, jobId: string): Promise<{ status: string; images: string[] }>;
418
- async downloadImage(scanner: ESCLScanner, imageUrl: string): Promise<Buffer | null>;
432
+ async getCapabilities(scanner: ESCLScanner): Promise<ESCLCapabilities | null>;
433
+ async createScanJob(scanner: ESCLScanner, dpi: number, colorMode: string, source: string): Promise<string | null>;
434
+ async getScanJobStatus(scanner: ESCLScanner, jobId: string): Promise<{ status: string; images: string[] }>;
435
+ async downloadImage(scanner: ESCLScanner, imageUrl: string): Promise<Buffer | null>;
419
436
  }
420
437
  ```
421
438
 
@@ -425,13 +442,13 @@ Scanner discovery service using Python subprocess with zeroconf.
425
442
 
426
443
  ```typescript
427
444
  class ESCLDiscovery {
428
- constructor(timeout?: number);
445
+ constructor(timeout?: number);
429
446
 
430
- async startDiscovery(): Promise<ESCLScanner[]>;
431
- stopDiscovery(): void;
432
- getScanners(): ESCLScanner[];
433
- onScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
434
- offScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
447
+ async startDiscovery(): Promise<ESCLScanner[]>;
448
+ stopDiscovery(): void;
449
+ getScanners(): ESCLScanner[];
450
+ onScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
451
+ offScannerDiscovered(callback: (scanners: ESCLScanner[]) => void): void;
435
452
  }
436
453
  ```
437
454
 
@@ -451,11 +468,11 @@ Convenience function for simple scan workflow.
451
468
 
452
469
  ```typescript
453
470
  const images = await quickScan({
454
- scanner: device,
455
- dpi: 300,
456
- mode: 'color',
457
- source: 'Platen',
458
- timeout: 30000
471
+ scanner: device,
472
+ dpi: 300,
473
+ mode: 'color',
474
+ source: 'Platen',
475
+ timeout: 30000,
459
476
  });
460
477
  ```
461
478
 
@@ -470,10 +487,10 @@ const images = await quickScan({
470
487
 
471
488
  ### Design Rationale
472
489
 
473
- - **Python for Discovery**: `zeroconf` library is more mature and stable than Node.js alternatives
474
- - **Subprocess Architecture**: Isolates network scanning from main application
475
- - **JSON-RPC Protocol**: Simple, reliable IPC between Node.js and Python processes
476
- - **Image Encoding**: Base64 PNG encoding for safe cross-process transmission
490
+ - **Python for Discovery**: `zeroconf` library is more mature and stable than Node.js alternatives
491
+ - **Subprocess Architecture**: Isolates network scanning from main application
492
+ - **JSON-RPC Protocol**: Simple, reliable IPC between Node.js and Python processes
493
+ - **Image Encoding**: Base64 PNG encoding for safe cross-process transmission
477
494
 
478
495
  ## Configuration
479
496
 
@@ -490,8 +507,8 @@ export ESCL_DEBUG=1
490
507
  ### Timeouts
491
508
 
492
509
  ```typescript
493
- const client = new ESCLClient(10000); // 10 second HTTP timeout
494
- const scanners = await discoverScanners(5000); // 5 second discovery window
510
+ const client = new ESCLClient(10000); // 10 second HTTP timeout
511
+ const scanners = await discoverScanners(5000); // 5 second discovery window
495
512
  ```
496
513
 
497
514
  ## Troubleshooting
@@ -499,21 +516,23 @@ const scanners = await discoverScanners(5000); // 5 second discovery window
499
516
  ### Scanners Not Found
500
517
 
501
518
  1. **Check Python Dependencies**:
502
- ```bash
503
- pip install zeroconf pillow
504
- ```
519
+
520
+ ```bash
521
+ pip install zeroconf pillow
522
+ ```
505
523
 
506
524
  2. **Verify Network**:
507
- - Ensure scanner is on same network as computer
508
- - Check scanner is powered on and connected
509
- - Verify network is mDNS-enabled (not blocked by firewall)
525
+
526
+ - Ensure scanner is on same network as computer
527
+ - Check scanner is powered on and connected
528
+ - Verify network is mDNS-enabled (not blocked by firewall)
510
529
 
511
530
  3. **Enable Debug Output**:
512
- ```typescript
513
- import { ESCLDiscovery } from '@escl-protocol/scanner';
514
- const discovery = new ESCLDiscovery();
515
- // Check stderr output for Python errors
516
- ```
531
+ ```typescript
532
+ import { ESCLDiscovery } from '@escl-protocol/scanner';
533
+ const discovery = new ESCLDiscovery();
534
+ // Check stderr output for Python errors
535
+ ```
517
536
 
518
537
  ### Connection Refused
519
538
 
@@ -524,9 +543,10 @@ const scanners = await discoverScanners(5000); // 5 second discovery window
524
543
  ### Scan Timeouts
525
544
 
526
545
  1. Increase timeout value:
527
- ```typescript
528
- const client = new ESCLClient(30000); // 30 seconds
529
- ```
546
+
547
+ ```typescript
548
+ const client = new ESCLClient(30000); // 30 seconds
549
+ ```
530
550
 
531
551
  2. Check scanner network latency
532
552
  3. Reduce scan resolution for slower networks
@@ -534,9 +554,10 @@ const scanners = await discoverScanners(5000); // 5 second discovery window
534
554
  ### Image Processing Issues
535
555
 
536
556
  1. Verify `pillow` library is installed:
537
- ```bash
538
- pip install --upgrade pillow
539
- ```
557
+
558
+ ```bash
559
+ pip install --upgrade pillow
560
+ ```
540
561
 
541
562
  2. Check disk space for image temporary files
542
563
  3. Verify scanner outputs valid PNG/JPEG images
@@ -545,56 +566,35 @@ const scanners = await discoverScanners(5000); // 5 second discovery window
545
566
 
546
567
  ```typescript
547
568
  try {
548
- const scanners = await discoverScanners(5000);
569
+ const scanners = await discoverScanners(5000);
549
570
 
550
- if (scanners.length === 0) {
551
- throw new Error('No scanners found');
552
- }
571
+ if (scanners.length === 0) {
572
+ throw new Error('No scanners found');
573
+ }
553
574
 
554
- const capabilities = await client.getCapabilities(scanners[0]);
555
- if (!capabilities) {
556
- throw new Error('Failed to get capabilities');
557
- }
575
+ const capabilities = await client.getCapabilities(scanners[0]);
576
+ if (!capabilities) {
577
+ throw new Error('Failed to get capabilities');
578
+ }
558
579
 
559
- const jobId = await client.createScanJob(scanners[0], 300, 'RGB24', 'Platen');
560
- if (!jobId) {
561
- throw new Error('Failed to create scan job');
562
- }
580
+ const jobId = await client.createScanJob(scanners[0], 300, 'RGB24', 'Platen');
581
+ if (!jobId) {
582
+ throw new Error('Failed to create scan job');
583
+ }
563
584
  } catch (error) {
564
- console.error('eSCL operation failed:', error.message);
565
- // Handle error appropriately
585
+ console.error('eSCL operation failed:', error.message);
586
+ // Handle error appropriately
566
587
  }
567
588
  ```
568
589
 
569
590
  ## Performance Considerations
570
591
 
571
- - **Discovery Time**: ~5 seconds for local network scan
572
- - **Scan Time**: Varies by document size, DPI, and network latency
573
- - Single page A4 at 300 DPI: typically 5-10 seconds
574
- - Large batch jobs: minutes depending on document count
575
- - **Memory Usage**: Python subprocess uses ~50-100MB when idle
576
- - **Network**: Requires local network access to scanners (no internet required)
577
-
578
- ## Compatibility
579
-
580
- ### Operating Systems
581
- - ✅ macOS 10.14+
582
- - ✅ Linux (Ubuntu 18.04+, CentOS 7+, etc.)
583
- - ✅ Windows 10+ (with Python 3.6+)
584
-
585
- ### Node.js Versions
586
- - ✅ Node.js 14.x
587
- - ✅ Node.js 16.x
588
- - ✅ Node.js 18.x
589
- - ✅ Node.js 20.x
590
-
591
- ### Scanner Models
592
- - ✅ Canon: iR-ADV C series, iR 2500/3000 series
593
- - ✅ HP: LaserJet Pro M series, MFP devices
594
- - ✅ Xerox: WorkCentre 5000+ series
595
- - ✅ Ricoh: MP C series
596
- - ✅ Epson: WorkForce Pro series
597
- - ✅ Brother: MFC series (eSCL enabled)
592
+ - **Discovery Time**: ~5 seconds for local network scan
593
+ - **Scan Time**: Varies by document size, DPI, and network latency
594
+ - Single page A4 at 300 DPI: typically 5-10 seconds
595
+ - Large batch jobs: minutes depending on document count
596
+ - **Memory Usage**: Python subprocess uses ~50-100MB when idle
597
+ - **Network**: Requires local network access to scanners (no internet required)
598
598
 
599
599
  ## Development
600
600
 
@@ -648,16 +648,18 @@ MIT
648
648
  ## Support
649
649
 
650
650
  For issues, questions, or feature requests:
651
- - GitHub Repository: [escl-protocol-scanner](https://github.com/byeong1/escl-protocol-scanner)
652
- - GitHub Issues: [Report Issues](https://github.com/byeong1/escl-protocol-scanner/issues)
653
- - npm Package: [@escl-protocol/scanner](https://www.npmjs.com/package/@escl-protocol/scanner)
654
- - Email: your-email@example.com
651
+
652
+ - GitHub Repository: [escl-protocol-scanner](https://github.com/byeong1/escl-protocol-scanner)
653
+ - GitHub Issues: [Report Issues](https://github.com/byeong1/escl-protocol-scanner/issues)
654
+ - npm Package: [@escl-protocol/scanner](https://www.npmjs.com/package/@escl-protocol/scanner)
655
+ - Email: your-email@example.com
655
656
 
656
657
  ## Changelog
657
658
 
658
659
  ### Version 1.0.0 (Initial Release)
659
- - Basic eSCL protocol support
660
- - Scanner discovery via mDNS
661
- - Single and batch scanning
662
- - Image rotation and encoding
663
- - Support for multiple manufacturers
660
+
661
+ - Basic eSCL protocol support
662
+ - Scanner discovery via mDNS
663
+ - Single and batch scanning
664
+ - Image rotation and encoding
665
+ - Support for multiple manufacturers
@@ -65,7 +65,8 @@ export declare class ESCLDiscovery {
65
65
  /**
66
66
  * Convenience function for quick scanner discovery
67
67
  * @param timeout Discovery timeout in milliseconds (default: 5000)
68
+ * @param options Discovery options including pythonPath
68
69
  * @returns Discovery response with success status and scanner data
69
70
  */
70
- export declare function discoverScanners(timeout?: number): Promise<DiscoveryResponse>;
71
+ export declare function discoverScanners(timeout?: number, options?: ESCLDiscoveryOptions): Promise<DiscoveryResponse>;
71
72
  //# sourceMappingURL=discovery.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,OAAO,EAAE,WAAW,EAA6B,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAEpF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,sEAAsE;IACtE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,UAAU,CAAuC;IACzD,OAAO,CAAC,SAAS,CAAqD;IACtE,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,YAAY,CAAkB;IACtC,OAAO,CAAC,UAAU,CAAqB;gBAE3B,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,oBAAoB;IAS5D;;;OAGG;IACH,OAAO,CAAC,kBAAkB;IAuB1B;;;;OAIG;IACG,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAoDlE;;OAEG;IACH,aAAa,IAAI,IAAI;IAIrB;;OAEG;IACH,WAAW,IAAI,W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AAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,IAAI;IAItE;;OAEG;IACH,oBAAoB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE,WAAW,EAAE,KAAK,IAAI,GAAG,IAAI;IAIvE;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA6D1B;;OAEG;IACH,OAAO,CAAC,OAAO;IA2Bf;;OAEG;IACH,OAAO,CAAC,eAAe;CAMxB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,GAAE,MAAa,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAGzH"}
package/dist/discovery.js CHANGED
@@ -260,10 +260,11 @@ exports.ESCLDiscovery = ESCLDiscovery;
260
260
  /**
261
261
  * Convenience function for quick scanner discovery
262
262
  * @param timeout Discovery timeout in milliseconds (default: 5000)
263
+ * @param options Discovery options including pythonPath
263
264
  * @returns Discovery response with success status and scanner data
264
265
  */
265
- async function discoverScanners(timeout = 5000) {
266
- const discovery = new ESCLDiscovery(timeout);
266
+ async function discoverScanners(timeout = 5000, options) {
267
+ const discovery = new ESCLDiscovery(timeout, options);
267
268
  return discovery.startDiscovery(timeout);
268
269
  }
269
270
  //# sourceMappingURL=discovery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.js","sourceRoot":"","sources":["../src/discovery.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQH,4CAGC;AApQD,iDAAoD;AACpD,2CAA6B;AAC7B,uCAAyB;AAYzB;;;GAGG;AACH,MAAa,aAAa;IAQxB,YAAY,OAAgB,EAAE,OAA8B;QAPpD,kBAAa,GAAwB,IAAI,CAAC;QAC1C,eAAU,GAA6B,IAAI,GAAG,EAAE,CAAC;QACjD,cAAS,GAA2C,IAAI,GAAG,EAAE,CAAC;QAC9D,YAAO,GAAW,IAAI,CAAC;QACvB,iBAAY,GAAY,K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AwOC;AAED;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CAAC,UAAkB,IAAI,EAAE,OAA8B;IAC3F,MAAM,SAAS,GAAG,IAAI,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,SAAS,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowsgear/escl-protocol-scanner",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "description": "eSCL/AirPrint Protocol Scanner Library - HTTP-based network scanner support with mDNS discovery",
5
5
  "license": "MIT",
6
6
  "author": "CrowsGear",