@mlightcad/cad-simple-viewer-cli 1.7.8 → 1.8.0-preview.0

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.
@@ -1,21 +1,21 @@
1
- ; Zoom extents, export a multi-file ACEX package zip (-chtml Multi),
2
- ; then export a JPEG preview of the extents view.
3
- ; Prompts for -chtml: export format / export invisible layers / export layouts /
4
- ; background (Black / White / Space) / initial view / viewer mode / chunk size MiB / compress chunks.
5
- ; Usage:
6
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi-preview.scr -o ./out
7
- zoom
8
- e
9
- -chtml
10
- Multi
11
- Yes
12
- Yes
13
- Black
14
- Extents
15
- Measure
16
- 2
17
- Yes
18
- jpgout
19
-
20
- 1024
21
- quit
1
+ ; Zoom extents, export a multi-file ACEX package zip (-chtml Multi),
2
+ ; then export a JPEG preview of the extents view.
3
+ ; Prompts for -chtml: export format / export invisible layers / export layouts /
4
+ ; background (Black / White / Space) / initial view / viewer mode / chunk size MiB / compress chunks.
5
+ ; Usage:
6
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi-preview.scr -o ./out
7
+ zoom
8
+ e
9
+ -chtml
10
+ Multi
11
+ Yes
12
+ Yes
13
+ Black
14
+ Extents
15
+ Measure
16
+ 2
17
+ Yes
18
+ jpgout
19
+
20
+ 1024
21
+ quit
@@ -1,16 +1,16 @@
1
- ; Export a multi-file ACEX package as a zip (-chtml Multi).
2
- ; Unzip before hosting so the offline viewer can fetch chunks progressively.
3
- ; Prompts: export format / export invisible layers / export layouts /
4
- ; background (Black / White / Space) / initial view / viewer mode / chunk size MiB / compress chunks.
5
- ; Usage:
6
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi.scr -o ./out
7
- -chtml
8
- Multi
9
- Yes
10
- Yes
11
- Black
12
- Extents
13
- Measure
14
- 2
15
- Yes
16
- quit
1
+ ; Export a multi-file ACEX package as a zip (-chtml Multi).
2
+ ; Unzip before hosting so the offline viewer can fetch chunks progressively.
3
+ ; Prompts: export format / export invisible layers / export layouts /
4
+ ; background (Black / White / Space) / initial view / viewer mode / chunk size MiB / compress chunks.
5
+ ; Usage:
6
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html-multi.scr -o ./out
7
+ -chtml
8
+ Multi
9
+ Yes
10
+ Yes
11
+ Black
12
+ Extents
13
+ Measure
14
+ 2
15
+ Yes
16
+ quit
@@ -1,13 +1,13 @@
1
- ; Export a self-contained offline HTML viewer (-chtml).
2
- ; Prompts: export format / export invisible layers / export layouts /
3
- ; background (Black / White / Space) / initial view / viewer mode.
4
- ; Usage:
5
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html.scr -o ./out
6
- -chtml
7
- Single
8
- Yes
9
- Yes
10
- Black
11
- Extents
12
- Measure
13
- quit
1
+ ; Export a self-contained offline HTML viewer (-chtml).
2
+ ; Prompts: export format / export invisible layers / export layouts /
3
+ ; background (Black / White / Space) / initial view / viewer mode.
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-html.scr -o ./out
6
+ -chtml
7
+ Single
8
+ Yes
9
+ Yes
10
+ Black
11
+ Extents
12
+ Measure
13
+ quit
@@ -0,0 +1,13 @@
1
+ ; export-pdf-monochrome.scr
2
+ ; Export a print-ready PDF: white paper, black linework and text, solid fills
3
+ ; in grey (-cpdf ... Monochrome).
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-pdf-monochrome.scr -o ./out
6
+ zoom
7
+ e
8
+ -cpdf
9
+ Extents
10
+ Yes
11
+ Text
12
+ Monochrome
13
+ quit
@@ -1,9 +1,14 @@
1
- ; export-pdf.scr
2
- zoom
3
- e
4
- -cpdf
5
- Extents
6
- Yes
7
- Text
8
-
9
- quit
1
+ ; export-pdf.scr
2
+ ; Export a vector PDF (-cpdf).
3
+ ; Prompts: model space frame (Extents / Display) / export layouts (Yes / No) /
4
+ ; text rendering (Text / Vector) / color mode (Color / Monochrome).
5
+ ; Usage:
6
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-pdf.scr -o ./out
7
+ zoom
8
+ e
9
+ -cpdf
10
+ Extents
11
+ Yes
12
+ Text
13
+ Color
14
+ quit
@@ -1,9 +1,9 @@
1
- ; Zoom extents, then export the drawing extents as PNG (long side 2048px).
2
- ; Usage:
3
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-png.scr -o ./out
4
- zoom
5
- e
6
- pngout
7
-
8
- 2048
9
- quit
1
+ ; Zoom extents, then export the drawing extents as PNG (long side 2048px).
2
+ ; Usage:
3
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/export-png.scr -o ./out
4
+ zoom
5
+ e
6
+ pngout
7
+
8
+ 2048
9
+ quit
@@ -1,15 +1,15 @@
1
- ; Turn off a layer via -LAYER, then export PNG.
2
- ; Requires --mode write (layer edits need Write open mode).
3
- ; Replace LAYER_NAME below with a real layer in your drawing.
4
- ; Usage:
5
- ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
- -layer
7
- Off
8
- LAYER_NAME
9
-
10
- zoom
11
- e
12
- pngout
13
-
14
- 2048
15
- quit
1
+ ; Turn off a layer via -LAYER, then export PNG.
2
+ ; Requires --mode write (layer edits need Write open mode).
3
+ ; Replace LAYER_NAME below with a real layer in your drawing.
4
+ ; Usage:
5
+ ; cad-simple-viewer-cli -i drawing.dwg -s examples/freeze-layer-png.scr -o ./out --mode write
6
+ -layer
7
+ Off
8
+ LAYER_NAME
9
+
10
+ zoom
11
+ e
12
+ pngout
13
+
14
+ 2048
15
+ quit
@@ -1,114 +1,141 @@
1
- {
2
- "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
- "defaultOutputDir": "tmp/examples-gallery",
4
- "examples": [
5
- {
6
- "id": "create-drawing-dxf",
7
- "title": "Create drawing -> DXF",
8
- "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
- "script": "create-drawing-dxf.scr",
10
- "mode": "write",
11
- "inputKind": "none",
12
- "runnable": true
13
- },
14
- {
15
- "id": "create-shapes-dxf",
16
- "title": "Create shapes -> DXF",
17
- "description": "qnew, draw a rectangle and a circle, export DXF.",
18
- "script": "create-shapes-dxf.scr",
19
- "mode": "write",
20
- "inputKind": "none",
21
- "runnable": true
22
- },
23
- {
24
- "id": "create-drawing-png",
25
- "title": "Create drawing -> PNG",
26
- "description": "qnew, draw geometry, zoom extents, export PNG.",
27
- "script": "create-drawing-png.scr",
28
- "mode": "write",
29
- "inputKind": "none",
30
- "runnable": true
31
- },
32
- {
33
- "id": "export-png",
34
- "title": "Export PNG",
35
- "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
- "script": "export-png.scr",
37
- "mode": "read",
38
- "inputKind": "file",
39
- "runnable": true
40
- },
41
- {
42
- "id": "export-html",
43
- "title": "Export HTML",
44
- "description": "Export a self-contained offline HTML viewer (-chtml).",
45
- "script": "export-html.scr",
46
- "mode": "read",
47
- "inputKind": "file",
48
- "runnable": true
49
- },
50
- {
51
- "id": "export-html-multi",
52
- "title": "Export HTML (multi-file)",
53
- "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
- "script": "export-html-multi.scr",
55
- "mode": "read",
56
- "inputKind": "file",
57
- "runnable": true
58
- },
59
- {
60
- "id": "export-html-multi-preview",
61
- "title": "Export HTML multi + preview",
62
- "description": "Zoom extents, export multi-file ACEX zip (-chtml Multi), then JPEG preview.",
63
- "script": "export-html-multi-preview.scr",
64
- "mode": "read",
65
- "inputKind": "file",
66
- "runnable": true
67
- },
68
- {
69
- "id": "export-dxf",
70
- "title": "Export DXF",
71
- "description": "Convert the open drawing to DXF (cdxf).",
72
- "script": "export-dxf.scr",
73
- "mode": "read",
74
- "inputKind": "file",
75
- "runnable": true
76
- },
77
- {
78
- "id": "freeze-layer-png",
79
- "title": "Layer off -> PNG",
80
- "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
81
- "script": "freeze-layer-png.scr",
82
- "mode": "write",
83
- "inputKind": "file",
84
- "runnable": true
85
- },
86
- {
87
- "id": "batch-export-png",
88
- "title": "Batch export PNG",
89
- "description": "Scan a folder of DWG/DXF files and export each to PNG.",
90
- "script": "batch-export-png.mjs",
91
- "kind": "batch",
92
- "inputKind": "directory",
93
- "runnable": true
94
- },
95
- {
96
- "id": "batch-export-html",
97
- "title": "Batch export HTML",
98
- "description": "Scan a folder and export each drawing to HTML.",
99
- "script": "batch-export-html.mjs",
100
- "kind": "batch",
101
- "inputKind": "directory",
102
- "runnable": true
103
- },
104
- {
105
- "id": "batch-export-html-multi-preview",
106
- "title": "Batch export HTML multi + preview",
107
- "description": "Scan a folder, export multi ACEX zip + extents preview, package like demo-drawings.",
108
- "script": "batch-export-html-multi-preview.mjs",
109
- "kind": "batch",
110
- "inputKind": "directory",
111
- "runnable": true
112
- }
113
- ]
114
- }
1
+ {
2
+ "fixtureDrawing": "https://cdn.jsdelivr.net/gh/mlightcad/cad-data@main/data/canteen.dwg",
3
+ "defaultOutputDir": "tmp/examples-gallery",
4
+ "examples": [
5
+ {
6
+ "id": "create-drawing-dxf",
7
+ "title": "Create drawing -> DXF",
8
+ "description": "qnew, draw a closed rectangle with LINE, export DXF. No input file.",
9
+ "script": "create-drawing-dxf.scr",
10
+ "mode": "write",
11
+ "inputKind": "none",
12
+ "runnable": true
13
+ },
14
+ {
15
+ "id": "create-shapes-dxf",
16
+ "title": "Create shapes -> DXF",
17
+ "description": "qnew, draw a rectangle and a circle, export DXF.",
18
+ "script": "create-shapes-dxf.scr",
19
+ "mode": "write",
20
+ "inputKind": "none",
21
+ "runnable": true
22
+ },
23
+ {
24
+ "id": "create-drawing-png",
25
+ "title": "Create drawing -> PNG",
26
+ "description": "qnew, draw geometry, zoom extents, export PNG.",
27
+ "script": "create-drawing-png.scr",
28
+ "mode": "write",
29
+ "inputKind": "none",
30
+ "runnable": true
31
+ },
32
+ {
33
+ "id": "export-png",
34
+ "title": "Export PNG",
35
+ "description": "Zoom extents and export the drawing as PNG (long side 2048).",
36
+ "script": "export-png.scr",
37
+ "mode": "read",
38
+ "inputKind": "file",
39
+ "runnable": true
40
+ },
41
+ {
42
+ "id": "export-html",
43
+ "title": "Export HTML",
44
+ "description": "Export a self-contained offline HTML viewer (-chtml).",
45
+ "script": "export-html.scr",
46
+ "mode": "read",
47
+ "inputKind": "file",
48
+ "runnable": true
49
+ },
50
+ {
51
+ "id": "export-html-multi",
52
+ "title": "Export HTML (multi-file)",
53
+ "description": "Export a multi-file ACEX package zip for progressive loading (-chtml Multi).",
54
+ "script": "export-html-multi.scr",
55
+ "mode": "read",
56
+ "inputKind": "file",
57
+ "runnable": true
58
+ },
59
+ {
60
+ "id": "export-html-multi-preview",
61
+ "title": "Export HTML multi + preview",
62
+ "description": "Zoom extents, export multi-file ACEX zip (-chtml Multi), then JPEG preview.",
63
+ "script": "export-html-multi-preview.scr",
64
+ "mode": "read",
65
+ "inputKind": "file",
66
+ "runnable": true
67
+ },
68
+ {
69
+ "id": "export-pdf",
70
+ "title": "Export PDF",
71
+ "description": "Zoom extents and export a vector PDF in color with every layout (-cpdf).",
72
+ "script": "export-pdf.scr",
73
+ "mode": "read",
74
+ "inputKind": "file",
75
+ "runnable": true
76
+ },
77
+ {
78
+ "id": "export-pdf-monochrome",
79
+ "title": "Export PDF (monochrome)",
80
+ "description": "Export a print-ready PDF: white paper, black linework and text, grey fills (-cpdf ... Monochrome).",
81
+ "script": "export-pdf-monochrome.scr",
82
+ "mode": "read",
83
+ "inputKind": "file",
84
+ "runnable": true
85
+ },
86
+ {
87
+ "id": "export-dxf",
88
+ "title": "Export DXF",
89
+ "description": "Convert the open drawing to DXF (cdxf).",
90
+ "script": "export-dxf.scr",
91
+ "mode": "read",
92
+ "inputKind": "file",
93
+ "runnable": true
94
+ },
95
+ {
96
+ "id": "freeze-layer-png",
97
+ "title": "Layer off -> PNG",
98
+ "description": "Turn off a layer with -LAYER, then export PNG. Edit LAYER_NAME in the script first.",
99
+ "script": "freeze-layer-png.scr",
100
+ "mode": "write",
101
+ "inputKind": "file",
102
+ "runnable": true
103
+ },
104
+ {
105
+ "id": "batch-export-png",
106
+ "title": "Batch export PNG",
107
+ "description": "Scan a folder of DWG/DXF files and export each to PNG.",
108
+ "script": "batch-export-png.mjs",
109
+ "kind": "batch",
110
+ "inputKind": "directory",
111
+ "runnable": true
112
+ },
113
+ {
114
+ "id": "batch-export-html",
115
+ "title": "Batch export HTML",
116
+ "description": "Scan a folder and export each drawing to HTML.",
117
+ "script": "batch-export-html.mjs",
118
+ "kind": "batch",
119
+ "inputKind": "directory",
120
+ "runnable": true
121
+ },
122
+ {
123
+ "id": "batch-export-pdf",
124
+ "title": "Batch export PDF",
125
+ "description": "Scan a folder and export each drawing to PDF (pass --color-mode monochrome for black and white).",
126
+ "script": "batch-export-pdf.mjs",
127
+ "kind": "batch",
128
+ "inputKind": "directory",
129
+ "runnable": true
130
+ },
131
+ {
132
+ "id": "batch-export-html-multi-preview",
133
+ "title": "Batch export HTML multi + preview",
134
+ "description": "Scan a folder, export multi ACEX zip + extents preview, package like demo-drawings.",
135
+ "script": "batch-export-html-multi-preview.mjs",
136
+ "kind": "batch",
137
+ "inputKind": "directory",
138
+ "runnable": true
139
+ }
140
+ ]
141
+ }
@@ -1,2 +1,2 @@
1
- ; Open-only timing: wait for idle in the runner, then exit.
2
- quit
1
+ ; Open-only timing: wait for idle in the runner, then exit.
2
+ quit
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/cad-simple-viewer-cli",
3
- "version": "1.7.8",
3
+ "version": "1.8.0-preview.0",
4
4
  "description": "AcCoreConsole-style headless CLI: run .scr command scripts against DXF/DWG drawings",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -42,17 +42,18 @@
42
42
  "script"
43
43
  ],
44
44
  "dependencies": {
45
- "@mlightcad/data-model": "1.15.21",
46
- "@mlightcad/libredwg-converter": "3.15.21",
45
+ "@mlightcad/data-model": "1.15.22",
46
+ "@mlightcad/libredwg-converter": "3.15.22",
47
47
  "@mlightcad/mtext-parser": "1.5.7",
48
48
  "@mlightcad/mtext-renderer": "0.13.7",
49
49
  "commander": "^12.1.0",
50
50
  "playwright": "^1.49.1",
51
- "@mlightcad/cad-html-plugin": "1.7.8",
52
- "@mlightcad/cad-pdf-plugin": "1.7.8",
53
- "@mlightcad/pdf-renderer": "1.7.8",
54
- "@mlightcad/cad-simple-viewer": "1.7.8",
55
- "@mlightcad/cad-svg-plugin": "1.7.8"
51
+ "@mlightcad/cad-html-plugin": "1.8.0-preview.0",
52
+ "@mlightcad/cad-simple-viewer": "1.8.0-preview.0",
53
+ "@mlightcad/cad-svg-plugin": "1.8.0-preview.0",
54
+ "@mlightcad/pdf-renderer": "1.8.0-preview.0",
55
+ "@mlightcad/cad-pdf-core": "1.8.0-preview.0",
56
+ "@mlightcad/cad-pdf-plugin": "1.8.0-preview.0"
56
57
  },
57
58
  "devDependencies": {
58
59
  "@types/node": "^20.14.9",