enhanced-printer 1.0.9 → 1.0.10
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/lib/print-manager.js +9 -2
- package/lib/types.d.ts +7 -0
- package/package.json +1 -1
package/lib/print-manager.js
CHANGED
|
@@ -64,8 +64,15 @@ async function print(options) {
|
|
|
64
64
|
if (options.subset !== undefined) {
|
|
65
65
|
printOptions.subset = options.subset;
|
|
66
66
|
}
|
|
67
|
-
//
|
|
68
|
-
|
|
67
|
+
// Build SumatraPDF print-settings for label clarity
|
|
68
|
+
// Scaling is CRITICAL - 'noscale' prints at actual PDF size without distortion
|
|
69
|
+
const scaling = options.scaling || 'noscale';
|
|
70
|
+
const printSettings = [scaling];
|
|
71
|
+
if (options.monochrome) {
|
|
72
|
+
printSettings.push('monochrome');
|
|
73
|
+
}
|
|
74
|
+
// Set the document name for job tracking and pass print settings to SumatraPDF
|
|
75
|
+
printOptions.win32 = ['-print-settings', printSettings.join(',')];
|
|
69
76
|
// Print the document
|
|
70
77
|
await (0, pdf_to_printer_1.print)(options.filePath, printOptions);
|
|
71
78
|
// Try to retrieve job ID
|
package/lib/types.d.ts
CHANGED
|
@@ -42,6 +42,13 @@ export interface PrintOptions {
|
|
|
42
42
|
pages?: string;
|
|
43
43
|
/** Print only odd or even pages (optional) */
|
|
44
44
|
subset?: 'odd' | 'even';
|
|
45
|
+
/**
|
|
46
|
+
* Scaling mode for printing (optional - defaults to 'noscale' for label clarity)
|
|
47
|
+
* - 'noscale': Print at actual PDF size (BEST for labels - no distortion)
|
|
48
|
+
* - 'fit': Fit to printable area (may distort aspect ratio)
|
|
49
|
+
* - 'shrink': Shrink if larger than page (may reduce quality)
|
|
50
|
+
*/
|
|
51
|
+
scaling?: 'noscale' | 'fit' | 'shrink';
|
|
45
52
|
}
|
|
46
53
|
/**
|
|
47
54
|
* Result of a print operation
|
package/package.json
CHANGED