@crowsgear/escl-protocol-scanner 1.0.8 → 1.0.9
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 +108 -582
- package/dist/client.d.ts +8 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +40 -8
- package/dist/client.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/python/__pycache__/base.cpython-312.pyc +0 -0
- package/python/__pycache__/escl_backend.cpython-312.pyc +0 -0
package/README.md
CHANGED
|
@@ -1,665 +1,191 @@
|
|
|
1
|
-
# @escl-protocol
|
|
1
|
+
# @crowsgear/escl-protocol-scanner
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Network scanner library based on eSCL/AirPrint protocol.
|
|
4
4
|
|
|
5
|
-
|
|
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
|
|
15
|
-
|
|
16
|
-
## Supported Devices
|
|
17
|
-
|
|
18
|
-
Compatible with network scanners from major manufacturers:
|
|
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**
|
|
5
|
+
> **Note**: This library only supports network-connected scanners (WiFi or LAN). USB scanners are not supported - use WIA (Windows) or system scan dialog instead.
|
|
26
6
|
|
|
27
7
|
## Installation
|
|
28
8
|
|
|
29
|
-
### Prerequisites
|
|
30
|
-
|
|
31
|
-
- Node.js ≥ 14.0.0
|
|
32
|
-
- Python 3.6+
|
|
33
|
-
- Python packages: `zeroconf`, `pillow`
|
|
34
|
-
|
|
35
|
-
### Step 1: Install Package
|
|
36
|
-
|
|
37
9
|
```bash
|
|
38
|
-
npm install @escl-protocol
|
|
10
|
+
npm install @crowsgear/escl-protocol-scanner
|
|
39
11
|
# or
|
|
40
|
-
yarn add @escl-protocol
|
|
12
|
+
yarn add @crowsgear/escl-protocol-scanner
|
|
41
13
|
```
|
|
42
14
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
1. Check for required Python packages (`zeroconf`, `pillow`)
|
|
46
|
-
2. **Interactively ask** if you want to install missing packages
|
|
47
|
-
3. Install to the Python environment specified by `PYTHON_PATH` (or system python3)
|
|
48
|
-
|
|
49
|
-
### Step 2: Setup Python Environment
|
|
15
|
+
### Python Dependencies
|
|
50
16
|
|
|
51
|
-
|
|
17
|
+
Requires Python 3.6+ and the following packages:
|
|
52
18
|
|
|
53
19
|
```bash
|
|
54
|
-
# 1. Create virtual environment
|
|
55
|
-
python3 -m venv venv
|
|
56
|
-
|
|
57
|
-
# 2. Get absolute path to Python executable
|
|
58
|
-
# Copy the full path (e.g., /Users/username/project/venv/bin/python3)
|
|
59
|
-
python3 -c "import sys; print(sys.executable)"
|
|
60
|
-
|
|
61
|
-
# 3. Install Python packages
|
|
62
|
-
source venv/bin/activate
|
|
63
20
|
pip install zeroconf pillow
|
|
64
|
-
|
|
65
|
-
# 4. Set PYTHON_PATH using ABSOLUTE path (important!)
|
|
66
|
-
# Use the full path from step 2, e.g.:
|
|
67
|
-
export PYTHON_PATH=/Users/username/project/venv/bin/python3
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
⚠️ **Important**: Always use **absolute path** for `PYTHON_PATH`, not relative paths like `./venv/bin/python3`
|
|
71
|
-
|
|
72
|
-
#### Option B: Using System Python
|
|
73
|
-
|
|
74
|
-
```bash
|
|
75
|
-
# Just ensure Python packages are installed
|
|
76
|
-
pip3 install zeroconf pillow
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
## Runtime Configuration
|
|
80
|
-
|
|
81
|
-
### Using Virtual Environment
|
|
82
|
-
|
|
83
|
-
Set the `PYTHON_PATH` environment variable when running your application:
|
|
84
|
-
|
|
85
|
-
```bash
|
|
86
|
-
# Option 1: Export before running
|
|
87
|
-
export PYTHON_PATH=./venv/bin/python3
|
|
88
|
-
npm start
|
|
89
|
-
|
|
90
|
-
# Option 2: One-liner
|
|
91
|
-
PYTHON_PATH=./venv/bin/python3 npm start
|
|
92
|
-
|
|
93
|
-
# Option 3: In package.json scripts
|
|
94
|
-
{
|
|
95
|
-
"scripts": {
|
|
96
|
-
"start": "PYTHON_PATH=./venv/bin/python3 electron ."
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
### Environment-Specific Setup
|
|
102
|
-
|
|
103
|
-
Create separate `.env` files for different environments:
|
|
104
|
-
|
|
105
|
-
```bash
|
|
106
|
-
# .env.dev
|
|
107
|
-
PYTHON_PATH=./venv-dev/bin/python3
|
|
108
|
-
|
|
109
|
-
# .env.staging
|
|
110
|
-
PYTHON_PATH=./venv-staging/bin/python3
|
|
111
|
-
|
|
112
|
-
# .env.production
|
|
113
|
-
PYTHON_PATH=/usr/local/bin/python3
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Then activate the appropriate environment:
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
source .env.dev
|
|
120
|
-
npm start
|
|
121
21
|
```
|
|
122
22
|
|
|
123
23
|
## Quick Start
|
|
124
24
|
|
|
125
|
-
###
|
|
25
|
+
### 1. Discover Scanners
|
|
126
26
|
|
|
127
27
|
```typescript
|
|
128
|
-
import { discoverScanners
|
|
129
|
-
|
|
130
|
-
async function example() {
|
|
131
|
-
// 1. Discover available scanners (5 second discovery window)
|
|
132
|
-
const scanners = await discoverScanners(5000);
|
|
133
|
-
console.log(`Found ${scanners.length} scanners`);
|
|
134
|
-
|
|
135
|
-
if (scanners.length === 0) {
|
|
136
|
-
console.log('No scanners found on network');
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// 2. Get scanner info
|
|
141
|
-
const scanner = scanners[0];
|
|
142
|
-
console.log(`Scanner: ${scanner.name}`);
|
|
143
|
-
console.log(`Host: ${scanner.host}:${scanner.port}`);
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
example();
|
|
147
|
-
```
|
|
28
|
+
import { discoverScanners } from "@crowsgear/escl-protocol-scanner";
|
|
148
29
|
|
|
149
|
-
|
|
30
|
+
// Basic usage (uses system Python)
|
|
31
|
+
const result = await discoverScanners(10000);
|
|
150
32
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
// Quick discovery
|
|
155
|
-
const scanners = await discoverScanners(5000);
|
|
156
|
-
|
|
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
|
-
}
|
|
33
|
+
// Specify Python path directly (recommended)
|
|
34
|
+
const result = await discoverScanners(10000, {
|
|
35
|
+
pythonPath: "/path/to/.venv/bin/python3",
|
|
165
36
|
});
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Get Scanner Capabilities
|
|
169
|
-
|
|
170
|
-
```typescript
|
|
171
|
-
import { discoverScanners, ESCLClient } from '@escl-protocol/scanner';
|
|
172
37
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
const capabilities = await client.getCapabilities(scanners[0]);
|
|
177
|
-
if (capabilities) {
|
|
178
|
-
console.log('Supported Resolutions:', capabilities.resolutions);
|
|
179
|
-
console.log('Color Modes:', capabilities.colorModes);
|
|
180
|
-
console.log('Scan Sources:', capabilities.sources);
|
|
38
|
+
if (result.success && result.data.length > 0) {
|
|
39
|
+
console.log("Found scanners:", result.data);
|
|
181
40
|
}
|
|
182
41
|
```
|
|
183
42
|
|
|
184
|
-
###
|
|
43
|
+
### 2. Get Scanner Capabilities
|
|
185
44
|
|
|
186
45
|
```typescript
|
|
187
|
-
import {
|
|
188
|
-
|
|
189
|
-
const scanners = await discoverScanners(5000);
|
|
190
|
-
const client = new ESCLClient();
|
|
191
|
-
|
|
192
|
-
// Create scan job
|
|
193
|
-
const jobId = await client.createScanJob(
|
|
194
|
-
scanners[0],
|
|
195
|
-
300, // DPI (300 DPI)
|
|
196
|
-
'RGB24', // Color mode (Full Color)
|
|
197
|
-
'Platen' // Source (Flatbed)
|
|
198
|
-
);
|
|
46
|
+
import { ESCLClient } from "@crowsgear/escl-protocol-scanner";
|
|
199
47
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
process.exit(1);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// Poll for completion
|
|
206
|
-
let completed = false;
|
|
207
|
-
let attempts = 0;
|
|
208
|
-
|
|
209
|
-
while (!completed && attempts < 30) {
|
|
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++;
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
if (!completed) {
|
|
233
|
-
console.error('Scan job timeout');
|
|
234
|
-
process.exit(1);
|
|
235
|
-
}
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### Quick Scan Helper
|
|
239
|
-
|
|
240
|
-
For simple one-off scans:
|
|
241
|
-
|
|
242
|
-
```typescript
|
|
243
|
-
import { discoverScanners, quickScan } from '@escl-protocol/scanner';
|
|
244
|
-
|
|
245
|
-
const scanners = await discoverScanners(5000);
|
|
246
|
-
|
|
247
|
-
const images = await quickScan({
|
|
248
|
-
scanner: scanners[0],
|
|
249
|
-
dpi: 300,
|
|
250
|
-
mode: 'color', // 'bw' | 'gray' | 'color'
|
|
251
|
-
source: 'Platen', // 'Platen' | 'Feeder'
|
|
252
|
-
timeout: 30000,
|
|
253
|
-
});
|
|
48
|
+
const client = new ESCLClient(10000);
|
|
49
|
+
const capabilities = await client.getCapabilities(scanner);
|
|
254
50
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
51
|
+
// capabilities structure:
|
|
52
|
+
// {
|
|
53
|
+
// resolutions: [100, 200, 300, 600], // Supported DPI
|
|
54
|
+
// colorModes: ['BlackAndWhite1', 'Grayscale8', 'RGB24'],
|
|
55
|
+
// sources: ['Platen', 'Adf'], // Platen=flatbed, Adf=feeder
|
|
56
|
+
// maxWidth: 297, // Max scan width (mm)
|
|
57
|
+
// maxHeight: 432 // Max scan height (mm)
|
|
58
|
+
// }
|
|
259
59
|
```
|
|
260
60
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
The library provides two different ways to perform scans, each with different use cases:
|
|
264
|
-
|
|
265
|
-
### Low-Level API: `client.createScanJob()`
|
|
266
|
-
|
|
267
|
-
**Use this when you need:**
|
|
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
|
|
273
|
-
|
|
274
|
-
**How it works:**
|
|
275
|
-
|
|
276
|
-
1. Create scan job with parameters → returns Job ID
|
|
277
|
-
2. Poll `getScanJobStatus()` to check completion
|
|
278
|
-
3. Download each image with `downloadImage()`
|
|
279
|
-
4. Manually manage job lifecycle
|
|
280
|
-
|
|
281
|
-
**Example:**
|
|
61
|
+
### 3. Perform Scan
|
|
282
62
|
|
|
283
63
|
```typescript
|
|
284
|
-
|
|
285
|
-
const jobId = await client.createScanJob(scanner, 300, 'RGB24', 'Platen');
|
|
286
|
-
|
|
287
|
-
// Step 2: Poll for completion with custom logic
|
|
288
|
-
while (!completed) {
|
|
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;
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
await new Promise((r) => setTimeout(r, 1000)); // Custom delay
|
|
301
|
-
}
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
**Pros:**
|
|
64
|
+
import { quickScan } from "@crowsgear/escl-protocol-scanner";
|
|
305
65
|
|
|
306
|
-
- Maximum flexibility and control
|
|
307
|
-
- Custom error handling strategies
|
|
308
|
-
- Can implement custom polling logic
|
|
309
|
-
- Direct access to job status
|
|
310
|
-
|
|
311
|
-
**Cons:**
|
|
312
|
-
|
|
313
|
-
- More code to write and maintain
|
|
314
|
-
- More opportunities for bugs
|
|
315
|
-
- Requires manual resource cleanup
|
|
316
|
-
|
|
317
|
-
### High-Level API: `quickScan()`
|
|
318
|
-
|
|
319
|
-
**Use this when you need:**
|
|
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
|
|
325
|
-
|
|
326
|
-
**How it works:**
|
|
327
|
-
|
|
328
|
-
1. Creates scan job automatically
|
|
329
|
-
2. Waits and polls for completion (~5 second intervals)
|
|
330
|
-
3. Downloads all images
|
|
331
|
-
4. Saves to disk automatically
|
|
332
|
-
5. Cleans up job automatically
|
|
333
|
-
|
|
334
|
-
**Example:**
|
|
335
|
-
|
|
336
|
-
```typescript
|
|
337
66
|
const filePaths = await quickScan({
|
|
338
|
-
scanner:
|
|
67
|
+
scanner: scanner,
|
|
339
68
|
dpi: 300,
|
|
340
|
-
mode:
|
|
341
|
-
source:
|
|
342
|
-
savePath:
|
|
69
|
+
mode: "color", // 'bw' | 'gray' | 'color'
|
|
70
|
+
source: "Platen", // 'Platen' | 'Feeder'
|
|
71
|
+
savePath: "/save/path",
|
|
72
|
+
width: 210, // Scan width in mm (default: 210 = A4)
|
|
73
|
+
height: 297, // Scan height in mm (default: 297 = A4)
|
|
74
|
+
timeout: 30000,
|
|
343
75
|
});
|
|
344
76
|
|
|
345
77
|
if (filePaths) {
|
|
346
|
-
console.log(
|
|
347
|
-
filePaths.forEach((path) => console.log(` - ${path}`));
|
|
78
|
+
console.log("Saved files:", filePaths);
|
|
348
79
|
}
|
|
349
80
|
```
|
|
350
81
|
|
|
351
|
-
|
|
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
|
|
358
|
-
|
|
359
|
-
**Cons:**
|
|
360
|
-
|
|
361
|
-
- Less control over polling
|
|
362
|
-
- Fixed timeout/retry logic
|
|
363
|
-
- Cannot implement custom scanning workflows
|
|
364
|
-
|
|
365
|
-
### Comparison Table
|
|
366
|
-
|
|
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 |
|
|
378
|
-
|
|
379
|
-
### Recommendation
|
|
380
|
-
|
|
381
|
-
**Choose `quickScan()` unless you have specific reasons not to:**
|
|
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
|
|
387
|
-
|
|
388
|
-
**Choose `createScanJob()` only if:**
|
|
389
|
-
|
|
390
|
-
- You need custom polling behavior
|
|
391
|
-
- Implementing a queue system
|
|
392
|
-
- Building advanced scanning workflows
|
|
393
|
-
- Integrating with custom error handling
|
|
82
|
+
## Paper Size Reference
|
|
394
83
|
|
|
395
|
-
|
|
84
|
+
| Paper | Width (mm) | Height (mm) |
|
|
85
|
+
| ------ | ---------- | ----------- |
|
|
86
|
+
| A4 | 210 | 297 |
|
|
87
|
+
| A3 | 297 | 420 |
|
|
88
|
+
| Letter | 216 | 279 |
|
|
89
|
+
| Legal | 216 | 356 |
|
|
396
90
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
#### `ESCLScanner`
|
|
91
|
+
## Cross-Platform Python Path
|
|
400
92
|
|
|
401
93
|
```typescript
|
|
402
|
-
|
|
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)
|
|
409
|
-
}
|
|
410
|
-
```
|
|
94
|
+
import path from "path";
|
|
411
95
|
|
|
412
|
-
|
|
96
|
+
const projectRoot = process.cwd();
|
|
97
|
+
const pythonPath =
|
|
98
|
+
process.platform === "win32"
|
|
99
|
+
? path.join(projectRoot, ".venv", "python.exe")
|
|
100
|
+
: path.join(projectRoot, ".venv", "bin", "python3");
|
|
413
101
|
|
|
414
|
-
|
|
415
|
-
interface ESCLCapabilities {
|
|
416
|
-
resolutions: number[]; // Available DPI values
|
|
417
|
-
colorModes: ('BlackAndWhite1' | 'Grayscale8' | 'RGB24')[]; // Available color modes
|
|
418
|
-
sources: ('Platen' | 'Adf' | 'Feeder')[]; // Available scan sources
|
|
419
|
-
}
|
|
102
|
+
const result = await discoverScanners(10000, { pythonPath });
|
|
420
103
|
```
|
|
421
104
|
|
|
422
|
-
|
|
105
|
+
## API
|
|
423
106
|
|
|
424
|
-
|
|
107
|
+
### discoverScanners(timeout, options?)
|
|
425
108
|
|
|
426
|
-
|
|
109
|
+
Discovers eSCL scanners on the network.
|
|
427
110
|
|
|
428
111
|
```typescript
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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>;
|
|
436
|
-
}
|
|
112
|
+
const result = await discoverScanners(10000, { pythonPath: "/path/to/python3" });
|
|
113
|
+
// result: { success: boolean, data: ESCLScanner[], error?: string }
|
|
437
114
|
```
|
|
438
115
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
Scanner discovery service using Python subprocess with zeroconf.
|
|
116
|
+
### ESCLClient
|
|
442
117
|
|
|
443
118
|
```typescript
|
|
444
|
-
|
|
445
|
-
constructor(timeout?: number);
|
|
446
|
-
|
|
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;
|
|
452
|
-
}
|
|
453
|
-
```
|
|
119
|
+
const client = new ESCLClient(timeout?: number);
|
|
454
120
|
|
|
455
|
-
|
|
121
|
+
// Get scanner capabilities
|
|
122
|
+
const caps = await client.getCapabilities(scanner, debug?: boolean);
|
|
456
123
|
|
|
457
|
-
|
|
124
|
+
// Create scan job
|
|
125
|
+
const jobId = await client.createScanJob(
|
|
126
|
+
scanner,
|
|
127
|
+
dpi: number,
|
|
128
|
+
colorMode: string, // 'BlackAndWhite1' | 'Grayscale8' | 'RGB24'
|
|
129
|
+
source: string, // 'Platen' | 'Feeder'
|
|
130
|
+
width?: number, // mm (default: 210)
|
|
131
|
+
height?: number // mm (default: 297)
|
|
132
|
+
);
|
|
458
133
|
|
|
459
|
-
|
|
134
|
+
// Check scan status
|
|
135
|
+
const status = await client.getScanJobStatus(scanner, jobId);
|
|
460
136
|
|
|
461
|
-
|
|
462
|
-
const
|
|
137
|
+
// Download image
|
|
138
|
+
const buffer = await client.downloadImage(scanner, imageUrl);
|
|
463
139
|
```
|
|
464
140
|
|
|
465
|
-
|
|
141
|
+
### quickScan(params)
|
|
466
142
|
|
|
467
|
-
Convenience function
|
|
143
|
+
Convenience function - handles scan job creation to image saving in one call.
|
|
468
144
|
|
|
469
145
|
```typescript
|
|
470
|
-
const
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
146
|
+
const filePaths = await quickScan({
|
|
147
|
+
scanner: ESCLScanner,
|
|
148
|
+
dpi: number,
|
|
149
|
+
mode: 'bw' | 'gray' | 'color',
|
|
150
|
+
source: 'Platen' | 'Feeder',
|
|
151
|
+
savePath?: string, // Save path (default: cwd)
|
|
152
|
+
width?: number, // mm (default: 210)
|
|
153
|
+
height?: number, // mm (default: 297)
|
|
154
|
+
timeout?: number
|
|
476
155
|
});
|
|
477
156
|
```
|
|
478
157
|
|
|
479
|
-
##
|
|
480
|
-
|
|
481
|
-
### How It Works
|
|
482
|
-
|
|
483
|
-
1. **Discovery**: JavaScript code spawns a Python subprocess (`escl_main.py`)
|
|
484
|
-
2. **Python Subprocess**: Uses `zeroconf` library to discover eSCL scanners on the network via mDNS
|
|
485
|
-
3. **Communication**: JSON-RPC over stdin/stdout between Node.js and Python
|
|
486
|
-
4. **Image Processing**: Python handles image rotation and PNG encoding
|
|
487
|
-
|
|
488
|
-
### Design Rationale
|
|
489
|
-
|
|
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
|
|
494
|
-
|
|
495
|
-
## Configuration
|
|
496
|
-
|
|
497
|
-
### Environment Variables
|
|
498
|
-
|
|
499
|
-
```bash
|
|
500
|
-
# Python path (if non-standard)
|
|
501
|
-
export PYTHON_PATH=python3
|
|
502
|
-
|
|
503
|
-
# Logging (if implemented)
|
|
504
|
-
export ESCL_DEBUG=1
|
|
505
|
-
```
|
|
506
|
-
|
|
507
|
-
### Timeouts
|
|
508
|
-
|
|
509
|
-
```typescript
|
|
510
|
-
const client = new ESCLClient(10000); // 10 second HTTP timeout
|
|
511
|
-
const scanners = await discoverScanners(5000); // 5 second discovery window
|
|
512
|
-
```
|
|
513
|
-
|
|
514
|
-
## Troubleshooting
|
|
515
|
-
|
|
516
|
-
### Scanners Not Found
|
|
517
|
-
|
|
518
|
-
1. **Check Python Dependencies**:
|
|
519
|
-
|
|
520
|
-
```bash
|
|
521
|
-
pip install zeroconf pillow
|
|
522
|
-
```
|
|
523
|
-
|
|
524
|
-
2. **Verify Network**:
|
|
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)
|
|
529
|
-
|
|
530
|
-
3. **Enable Debug Output**:
|
|
531
|
-
```typescript
|
|
532
|
-
import { ESCLDiscovery } from '@escl-protocol/scanner';
|
|
533
|
-
const discovery = new ESCLDiscovery();
|
|
534
|
-
// Check stderr output for Python errors
|
|
535
|
-
```
|
|
536
|
-
|
|
537
|
-
### Connection Refused
|
|
538
|
-
|
|
539
|
-
1. Verify scanner IP and port (usually port 80)
|
|
540
|
-
2. Ensure firewall allows HTTP access to scanner
|
|
541
|
-
3. Check scanner supports eSCL protocol (AirPrint-compatible)
|
|
542
|
-
|
|
543
|
-
### Scan Timeouts
|
|
544
|
-
|
|
545
|
-
1. Increase timeout value:
|
|
546
|
-
|
|
547
|
-
```typescript
|
|
548
|
-
const client = new ESCLClient(30000); // 30 seconds
|
|
549
|
-
```
|
|
550
|
-
|
|
551
|
-
2. Check scanner network latency
|
|
552
|
-
3. Reduce scan resolution for slower networks
|
|
553
|
-
|
|
554
|
-
### Image Processing Issues
|
|
555
|
-
|
|
556
|
-
1. Verify `pillow` library is installed:
|
|
557
|
-
|
|
558
|
-
```bash
|
|
559
|
-
pip install --upgrade pillow
|
|
560
|
-
```
|
|
561
|
-
|
|
562
|
-
2. Check disk space for image temporary files
|
|
563
|
-
3. Verify scanner outputs valid PNG/JPEG images
|
|
564
|
-
|
|
565
|
-
## Error Handling
|
|
158
|
+
## Types
|
|
566
159
|
|
|
567
160
|
```typescript
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
const capabilities = await client.getCapabilities(scanners[0]);
|
|
576
|
-
if (!capabilities) {
|
|
577
|
-
throw new Error('Failed to get capabilities');
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
const jobId = await client.createScanJob(scanners[0], 300, 'RGB24', 'Platen');
|
|
581
|
-
if (!jobId) {
|
|
582
|
-
throw new Error('Failed to create scan job');
|
|
583
|
-
}
|
|
584
|
-
} catch (error) {
|
|
585
|
-
console.error('eSCL operation failed:', error.message);
|
|
586
|
-
// Handle error appropriately
|
|
161
|
+
interface ESCLScanner {
|
|
162
|
+
name: string;
|
|
163
|
+
host: string;
|
|
164
|
+
port: number;
|
|
165
|
+
model?: string;
|
|
166
|
+
manufacturer?: string;
|
|
587
167
|
}
|
|
588
|
-
```
|
|
589
|
-
|
|
590
|
-
## Performance Considerations
|
|
591
|
-
|
|
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
|
-
|
|
599
|
-
## Development
|
|
600
|
-
|
|
601
|
-
### Building from Source
|
|
602
|
-
|
|
603
|
-
```bash
|
|
604
|
-
# Install dependencies
|
|
605
|
-
yarn install
|
|
606
|
-
|
|
607
|
-
# Build TypeScript
|
|
608
|
-
yarn build
|
|
609
|
-
|
|
610
|
-
# Clean build artifacts
|
|
611
|
-
yarn clean
|
|
612
|
-
|
|
613
|
-
# Watch mode
|
|
614
|
-
yarn build:watch
|
|
615
|
-
```
|
|
616
168
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
│ ├── discovery.ts # Scanner discovery service
|
|
625
|
-
│ └── [...other files]
|
|
626
|
-
├── python/
|
|
627
|
-
│ ├── escl_main.py # Python subprocess entry point
|
|
628
|
-
│ ├── escl_backend.py # eSCL protocol implementation
|
|
629
|
-
│ └── base.py # Base class for backends
|
|
630
|
-
├── dist/ # Compiled JavaScript (generated)
|
|
631
|
-
├── package.json
|
|
632
|
-
└── README.md
|
|
169
|
+
interface ESCLCapabilities {
|
|
170
|
+
resolutions: number[];
|
|
171
|
+
colorModes: ("BlackAndWhite1" | "Grayscale8" | "RGB24")[];
|
|
172
|
+
sources: ("Platen" | "Adf" | "Feeder")[];
|
|
173
|
+
maxWidth?: number; // mm
|
|
174
|
+
maxHeight?: number; // mm
|
|
175
|
+
}
|
|
633
176
|
```
|
|
634
177
|
|
|
635
|
-
##
|
|
178
|
+
## Supported Scanners
|
|
636
179
|
|
|
637
|
-
|
|
180
|
+
AirPrint/eSCL compatible network scanners:
|
|
638
181
|
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
182
|
+
- Canon iR-ADV series
|
|
183
|
+
- HP LaserJet MFP
|
|
184
|
+
- Xerox WorkCentre
|
|
185
|
+
- Epson WorkForce Pro
|
|
186
|
+
- Other AirPrint compatible MFPs
|
|
187
|
+
- ...
|
|
643
188
|
|
|
644
189
|
## License
|
|
645
190
|
|
|
646
191
|
MIT
|
|
647
|
-
|
|
648
|
-
## Support
|
|
649
|
-
|
|
650
|
-
For issues, questions, or feature requests:
|
|
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
|
|
656
|
-
|
|
657
|
-
## Changelog
|
|
658
|
-
|
|
659
|
-
### Version 1.0.0 (Initial Release)
|
|
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
|
package/dist/client.d.ts
CHANGED
|
@@ -23,9 +23,11 @@ export declare class ESCLClient {
|
|
|
23
23
|
* @param dpi Resolution in DPI
|
|
24
24
|
* @param colorMode Color mode (BlackAndWhite1, Grayscale8, RGB24)
|
|
25
25
|
* @param source Scan source (Platen, Feeder)
|
|
26
|
+
* @param width Scan width in mm (optional)
|
|
27
|
+
* @param height Scan height in mm (optional)
|
|
26
28
|
* @returns Scan job UUID
|
|
27
29
|
*/
|
|
28
|
-
createScanJob(scanner: ESCLScanner, dpi: number, colorMode: string, source: string): Promise<string | null>;
|
|
30
|
+
createScanJob(scanner: ESCLScanner, dpi: number, colorMode: string, source: string, width?: number, height?: number): Promise<string | null>;
|
|
29
31
|
/**
|
|
30
32
|
* Poll scan job status
|
|
31
33
|
* @param scanner Target scanner
|
|
@@ -45,6 +47,11 @@ export declare class ESCLClient {
|
|
|
45
47
|
downloadImage(scanner: ESCLScanner, imageUrl: string): Promise<Buffer | null>;
|
|
46
48
|
/**
|
|
47
49
|
* Build eSCL scan settings XML
|
|
50
|
+
* @param dpi Resolution in DPI
|
|
51
|
+
* @param colorMode Color mode
|
|
52
|
+
* @param source Scan source
|
|
53
|
+
* @param width Scan width in mm (optional, default: 210mm = A4)
|
|
54
|
+
* @param height Scan height in mm (optional, default: 297mm = A4)
|
|
48
55
|
*/
|
|
49
56
|
private buildScanSettings;
|
|
50
57
|
/**
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAgB,MAAM,SAAS,CAAC;AAEtE;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,CAAC,EAAE,MAAM;IAM5B;;;;;OAKG;IACG,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAarG
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAgB,MAAM,SAAS,CAAC;AAEtE;;;GAGG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,OAAO,CAAiB;gBAEpB,OAAO,CAAC,EAAE,MAAM;IAM5B;;;;;OAKG;IACG,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAarG;;;;;;;;;OASG;IACG,aAAa,CACjB,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAqBzB;;;;;OAKG;IACG,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;QACnE,MAAM,EAAE,YAAY,GAAG,WAAW,GAAG,SAAS,GAAG,SAAS,CAAC;QAC3D,MAAM,EAAE,MAAM,EAAE,CAAC;KAClB,CAAC;IAyBF;;;;;OAKG;IACG,aAAa,CAAC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAUnF;;;;;;;OAOG;IACH,OAAO,CAAC,iBAAiB;IAiCzB;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IA+FzB;;OAEG;IACH,OAAO,CAAC,OAAO;IAyBf;;OAEG;IACH,OAAO,CAAC,aAAa;IAyBrB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAmCjB"}
|
package/dist/client.js
CHANGED
|
@@ -72,11 +72,13 @@ class ESCLClient {
|
|
|
72
72
|
* @param dpi Resolution in DPI
|
|
73
73
|
* @param colorMode Color mode (BlackAndWhite1, Grayscale8, RGB24)
|
|
74
74
|
* @param source Scan source (Platen, Feeder)
|
|
75
|
+
* @param width Scan width in mm (optional)
|
|
76
|
+
* @param height Scan height in mm (optional)
|
|
75
77
|
* @returns Scan job UUID
|
|
76
78
|
*/
|
|
77
|
-
async createScanJob(scanner, dpi, colorMode, source) {
|
|
79
|
+
async createScanJob(scanner, dpi, colorMode, source, width, height) {
|
|
78
80
|
try {
|
|
79
|
-
const scanSettings = this.buildScanSettings(dpi, colorMode, source);
|
|
81
|
+
const scanSettings = this.buildScanSettings(dpi, colorMode, source, width, height);
|
|
80
82
|
const jobResponse = await this.httpPost(`http://${scanner.host}:${scanner.port}/eSCL/ScanJobs`, scanSettings);
|
|
81
83
|
// Extract job UUID from Location header or response
|
|
82
84
|
const jobMatch = jobResponse.match(/\/eSCL\/ScanJobs\/([a-f0-9-]+)/);
|
|
@@ -134,11 +136,18 @@ class ESCLClient {
|
|
|
134
136
|
}
|
|
135
137
|
/**
|
|
136
138
|
* Build eSCL scan settings XML
|
|
139
|
+
* @param dpi Resolution in DPI
|
|
140
|
+
* @param colorMode Color mode
|
|
141
|
+
* @param source Scan source
|
|
142
|
+
* @param width Scan width in mm (optional, default: 210mm = A4)
|
|
143
|
+
* @param height Scan height in mm (optional, default: 297mm = A4)
|
|
137
144
|
*/
|
|
138
|
-
buildScanSettings(dpi, colorMode, source) {
|
|
139
|
-
// Match the Python implementation which uses proper namespaces
|
|
145
|
+
buildScanSettings(dpi, colorMode, source, width, height) {
|
|
140
146
|
const ESCL_NS = 'http://schemas.hp.com/imaging/escl/2011/05/03';
|
|
141
147
|
const PWG_NS = 'http://www.pwg.org/schemas/2010/12/sm';
|
|
148
|
+
/* mm to 1/300 inch 변환 */
|
|
149
|
+
const widthInUnits = Math.round((width || 210) / 25.4 * 300);
|
|
150
|
+
const heightInUnits = Math.round((height || 297) / 25.4 * 300);
|
|
142
151
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
143
152
|
<scan:ScanSettings xmlns:scan="${ESCL_NS}" xmlns:pwg="${PWG_NS}">
|
|
144
153
|
<pwg:Version>2.0</pwg:Version>
|
|
@@ -148,8 +157,8 @@ class ESCLClient {
|
|
|
148
157
|
<pwg:ContentRegionUnits>escl:ThreeHundredthsOfInches</pwg:ContentRegionUnits>
|
|
149
158
|
<pwg:XOffset>0</pwg:XOffset>
|
|
150
159
|
<pwg:YOffset>0</pwg:YOffset>
|
|
151
|
-
<pwg:Width
|
|
152
|
-
<pwg:Height
|
|
160
|
+
<pwg:Width>${widthInUnits}</pwg:Width>
|
|
161
|
+
<pwg:Height>${heightInUnits}</pwg:Height>
|
|
153
162
|
</pwg:ScanRegion>
|
|
154
163
|
</pwg:ScanRegions>
|
|
155
164
|
<scan:Justification>
|
|
@@ -218,14 +227,37 @@ class ESCLClient {
|
|
|
218
227
|
sources.push('Adf');
|
|
219
228
|
}
|
|
220
229
|
}
|
|
230
|
+
// Extract max width and height (in 1/300 inch units, convert to mm)
|
|
231
|
+
let maxWidth;
|
|
232
|
+
let maxHeight;
|
|
233
|
+
const maxWidthMatch = xml.match(/<[a-z]*:?MaxWidth>(\d+)<\/[a-z]*:?MaxWidth>/);
|
|
234
|
+
const maxHeightMatch = xml.match(/<[a-z]*:?MaxHeight>(\d+)<\/[a-z]*:?MaxHeight>/);
|
|
235
|
+
if (maxWidthMatch) {
|
|
236
|
+
maxWidth = Math.round(parseInt(maxWidthMatch[1], 10) / 300 * 25.4);
|
|
237
|
+
}
|
|
238
|
+
if (maxHeightMatch) {
|
|
239
|
+
maxHeight = Math.round(parseInt(maxHeightMatch[1], 10) / 300 * 25.4);
|
|
240
|
+
}
|
|
221
241
|
// Remove duplicates from resolutions
|
|
222
242
|
const uniqueResolutions = Array.from(new Set(resolutions)).sort((a, b) => a - b);
|
|
223
243
|
const uniqueColorModes = Array.from(new Set(colorModes));
|
|
224
244
|
const uniqueSources = Array.from(new Set(sources));
|
|
225
245
|
if (debug) {
|
|
226
|
-
console.log('[eSCL] Parsed capabilities:', {
|
|
246
|
+
console.log('[eSCL] Parsed capabilities:', {
|
|
247
|
+
resolutions: uniqueResolutions,
|
|
248
|
+
colorModes: uniqueColorModes,
|
|
249
|
+
sources: uniqueSources,
|
|
250
|
+
maxWidth,
|
|
251
|
+
maxHeight
|
|
252
|
+
});
|
|
227
253
|
}
|
|
228
|
-
return {
|
|
254
|
+
return {
|
|
255
|
+
resolutions: uniqueResolutions,
|
|
256
|
+
colorModes: uniqueColorModes,
|
|
257
|
+
sources: uniqueSources,
|
|
258
|
+
maxWidth,
|
|
259
|
+
maxHeight
|
|
260
|
+
};
|
|
229
261
|
}
|
|
230
262
|
/**
|
|
231
263
|
* HTTP GET request
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAG7B;;;GAGG;AACH,MAAa,UAAU;IAGrB,YAAY,OAAgB;QAFpB,YAAO,GAAW,KAAK,CAAC;QAG9B,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,OAA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C,UAAU,KAAK,GAAG,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,EAAE,CAAC;wBACrD,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;oBAC9C,CAAC;yBAAM,CAAC;wBACN,MAAM,CAAC,IAAI,KAAK,CAAC,QAAQ,GAAG,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;oBAC9C,CAAC;gBACH,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;gBACrB,GAAG,CAAC,OAAO,EAAE,CAAC;gBACd,MAAM,CAAC,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC;YACvC,CAAC,CAAC,CAAC;YAEH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;YACxB,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YAChB,GAAG,CAAC,GAAG,EAAE,CAAC;QACZ,CAAC,CAAC,CAAC;IACL,CAAC;CACF;AA/VD,gCA+VC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAGH,YAAY,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,eAAe,EACf,eAAe,EACf,WAAW,EACX,aAAa,EACb,UAAU,EACV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,SAAS,CAAC;AAEjB,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAIxD,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,aAAa,E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AClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CA+E3B"}
|
package/dist/index.js
CHANGED
|
@@ -74,7 +74,7 @@ exports.VERSION = '1.0.0';
|
|
|
74
74
|
* ```
|
|
75
75
|
*/
|
|
76
76
|
async function quickScan(params) {
|
|
77
|
-
let { scanner, dpi, mode, source, timeout, savePath } = params;
|
|
77
|
+
let { scanner, dpi, mode, source, timeout, savePath, width, height } = params;
|
|
78
78
|
const client = new client_1.ESCLClient(timeout);
|
|
79
79
|
// Default save path to current working directory if not provided
|
|
80
80
|
if (!savePath) {
|
|
@@ -92,7 +92,7 @@ async function quickScan(params) {
|
|
|
92
92
|
throw new Error(`Invalid color mode: ${mode}`);
|
|
93
93
|
}
|
|
94
94
|
// 1. Create scan job
|
|
95
|
-
const jobId = await client.createScanJob(scanner, dpi, colorMode, source);
|
|
95
|
+
const jobId = await client.createScanJob(scanner, dpi, colorMode, source, width, height);
|
|
96
96
|
if (!jobId) {
|
|
97
97
|
throw new Error('Failed to create scan job');
|
|
98
98
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAuDH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;;;AAuDH,8BAwFC;AAzHD,4BAA4B;AAC5B,qCAAsC;AACtC,mCAAsC;AAA7B,oGAAA,UAAU,OAAA;AACnB,yCAA8D;AAArD,0GAAA,aAAa,OAAA;AAAE,6GAAA,gBAAgB,OAAA;AAExC,UAAU;AACG,QAAA,OAAO,GAAG,OAAO,CAAC;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