The world’s first fully web-based DXF/DWG viewer and editor that runs entirely in the browser — no backend server required.
See the codeEnglish | 简体中文 | 日本語 | 한국어 | Español | Português | Русский | Čeština
cad-viewer is the first web-based DXF/DWG viewer and editor in the world that operates entirely in browser, without relying on any backend services.
By performing DWG/DXF parsing, geometry processing, and rendering directly in the browser, cad-viewer enables true serverless CAD viewing and editing, ideal for cloud apps, offline usage, and privacy-sensitive workflows.
It also offers something you will rarely find in other CAD viewers—one-click export to a single, self-contained HTML file. The downloaded .html embeds the drawing snapshot and a lightweight viewer runtime, so recipients can open, pan, zoom, toggle layers, and measure distances in any modern browser with no CAD app, no server, and no install. Most desktop and web CAD viewers only let you view inside their own product; cad-viewer turns a live drawing into a portable, offline artifact you can email, archive, or drop on a static file host—ideal for sharing with clients, compliance archives, and air-gapped workflows. The offline viewer also uses far less memory than traditional desktop tools when opening the same drawing (see memory comparison below).
The Thingraph team builds production DWG/DXF viewers and platform integrations on top of cad-viewer, serving tens of thousands of users worldwide:
.dwg / .dxfCommunity apps & integrations:
Community Linux desktop packages:
Official sample apps that show how to integrate cad-viewer into your own product:
@mlightcad/cad-simple-viewer: open local or CDN DXF/DWG, drive commands from a small toolbar, and lazy-load HTML/PDF/SVG export plugins without the full Vue UI.@mlightcad/cad-viewer with menus, ribbons, dialogs, command line, and status bar (live demo).cad-simple-viewer) or server-side ACEX prerender (faster load, lower memory).
@mlightcad/cad-simple-viewer, so mobile browsers work without a separate app.html file with an embedded viewer (pan/zoom, zoom extents, layers, distance measure, EN/ZH UI). Opens offline in any browser; no cad-viewer instance or backend required.Add DWG/DXF viewing to any website with a single <iframe>—no CAD backend, no uploading drawings to a third-party cloud. The file is fetched from your URL and parsed entirely in the visitor’s browser, with review tools (pan, zoom, measure, annotate) ready out of the box.
<iframe
src="https://mlightcad.com/embed.html?url=https://example.com/plans/floor.dwg&mode=review&toolbar=1"
style="width:100%;height:600px;border:0"
allowfullscreen>
</iframe>
Walkthrough and live playground: Embed DWG/DXF on Your Website Without Uploading a Single Byte.
git clone https://github.com/mlightcad/cad-viewer.git
cd cad-viewer
pnpm install
# Start the full-featured viewer (cad-viewer)
pnpm dev
# Or start the simple viewer
pnpm dev:simple
pnpm build
# Preview the full-featured viewer
pnpm preview
# Preview the simple viewer
pnpm preview:simple
New to CAD Viewer? The User Guide provides step-by-step instructions for the viewer interface, desktop and touch operations, markup, and measurement tools.
Del keyCAD-Viewer is built around a modular plugin system in @mlightcad/cad-simple-viewer. Plugins implement the AcApPlugin interface and hook into viewer lifecycle via onLoad / onUnload—typically to register commands, add UI, or wire export/import pipelines.
Load plugins through AcApDocManager.instance.pluginManager (loadPlugin, registerLazyPlugin, or plugins.fromConfig when creating the document manager). Export-oriented plugins support lazy loading: register a small stub up front and download the heavy bundle only when the user runs the related command (for example -chtml, or when confirming export from the chtml dialog in cad-viewer).
The monorepo ships several first-party plugins. Each focuses on one concern; combine them as needed. Installation, registration, and API details live in each package’s README—see the links below.
| Package | Role | Commands / capabilities |
|---|---|---|
@mlightcad/cad-simple-ui-plugin | Toolbar, layer manager & review palette UI for cad-simple-viewer (plain DOM, no Vue/React) | layer, markuppanel, default toolbar (view, measure, export, review, theme, locale) |
@mlightcad/cad-agent-plugin | Natural-language CAD agent (AI chat panel + drawing tool calls) | agent |
@mlightcad/cad-html-plugin | Export drawings to self-contained offline HTML | chtml (dialog in cad-viewer), -chtml (command-line) |
@mlightcad/cad-pdf-plugin | PDF export and import (vector pipeline) | cpdf, ipdf |
@mlightcad/cad-svg-plugin | SVG export and shared vector renderer (also used by PDF export) | csvg |
@mlightcad/cad-onedrive-plugin | OneDrive data source — open DWG/DXF from OneDrive / SharePoint | Registers AcApDataSource (onedrive); two-step Sign in → Open (popup-safe) |
@mlightcad/cad-google-drive-plugin | Google Drive data source — open DWG/DXF from Google Drive | Registers AcApDataSource (googledrive); two-step Sign in → Open (popup-safe) |
@mlightcad/cad-simple-ui-plugin — UI chrome for the simple viewercad-simple-viewer deliberately ships no application UI—only the canvas and CAD core. If you embed the simple viewer in your own web app and want ready-made chrome without adopting the full Vue-based cad-viewer shell, cad-simple-ui-plugin is the intended UI layer.
It provides:
COLORTHEME sysvar and --ml-ui-* CSS tokens on your host elementAcApI18n (English / Chinese / Czech / Turkish)All widgets are framework-agnostic (plain DOM). The full Vue cad-viewer app has its own Element Plus UI and does not require this plugin; use cad-simple-ui-plugin when you build on cad-simple-viewer directly.
→ Quick start, toolbar customization, and options: packages/cad-simple-ui-plugin/README.md
@mlightcad/cad-agent-plugin — AI drawing assistantcad-agent-plugin adds a natural-language CAD agent to cad-simple-viewer-based apps. Users describe what they want in plain language; the agent calls CAD tools to inspect the drawing and create or modify geometry.
It provides:
AcApPlugin (trigger command: agent) so the AI bundle is not on the critical pathAgentChatPanel) built on the Vercel AI SDK (Experimental_Agent + @ai-sdk/vue)localStorage)get_drawing_context; draw_line, draw_circle, draw_arc, draw_rectangle, draw_polyline, draw_text; set_current_layer, create_layer, zoom_extentsThe full Vue cad-viewer app registers the agent automatically when the package is installed (palette tab). cad-simple-viewer-example wires it into a dock tab via cad-simple-ui-plugin. Host apps call registerLazyAgentPlugin and setAgentPaletteOpener to mount the panel where they want.
→ Installation, registration, and tool list: packages/cad-agent-plugin/README.md
These plugins add export (and PDF import) commands to the same plugin manager. They are lazy-loaded so initial page weight stays small. The cad-simple-viewer-example demo registers all three export plugins, cad-simple-ui-plugin, and cad-agent-plugin; the full cad-viewer app registers the export plugins and the agent plugin (when installed) in its bootstrap.
When opening the sample drawing canteen.dwg, memory consumption is roughly:
| Viewer | Memory consumption |
|---|---|
| AutoCAD 2020 | 320 MB |
| GstarCAD Viewer (浩辰看图王) | 246 MB |
| Self-contained HTML (measure mode) | 56 MB |
| Self-contained HTML (view mode) | 33 MB |
The offline HTML viewer uses about 83% less memory than AutoCAD 2020 and about 77% less than GstarCAD Viewer in view mode, while still supporting pan/zoom, layer toggle, and distance measurement (measure mode).
CAD-Viewer is engineered for exceptional performance and can handle very large DXF/DWG files while maintaining high frame rates. It employs multiple advanced rendering technologies to optimize performance:
These optimizations enable CAD-Viewer to smoothly render complex CAD drawings with thousands of entities while maintaining responsive user interactions.
The default open-source DWG path is based on LibreDWG via the optional @mlightcad/libredwg-converter package. It works well for many drawings, but its entity coverage is still limited, the WASM bundle is much larger, startup is slower, memory usage is high, and very large DWG files may hit out-of-memory errors. It also introduces GPL licensing considerations for commercial closed-source products. @mlightcad/cad-simple-viewer does not depend on or register that converter by default — host apps (see the example packages) opt in explicitly.
If you need better compatibility, lower memory usage, large-file support, or a cleaner commercial licensing story, see our proprietary DWG parser.
| Item | LibreDWG-based parser | Proprietary DWG parser |
|---|---|---|
| Supported entities | Limited coverage | Broader coverage |
| Bundle size | ~13 MB | ~437 KB |
| Load speed | Slower startup | Much faster startup |
| Memory usage | Higher | Lower |
| Large DWG files | May OOM on large files | No such issue |
| License | GPL propagation risk | No GPL propagation issue |
The goal of this project is to create a full-featured 2D AutoCAD-like system in the browser (viewer + editor), with modular architecture and framework-agnostic integration.
Legend:
This roadmap is intentionally granular so contributors can clearly see what exists, what is missing, and where help is needed.
Contributions are welcome! Please open issues or pull requests for bug fixes, new features, or suggestions. For bug reports, providing a link to the problematic drawing will help in reproducing and fixing the issue.
The cad-viewer monorepo is primarily MIT licensed.
DXF loading uses the built-in MIT parser in @mlightcad/data-model. DWG loading is opt-in: @mlightcad/cad-simple-viewer does not depend on GPL LibreDWG packages. Hosts that want open-source DWG support add @mlightcad/libredwg-converter (GPL-3.0) themselves, deploy its worker + wasm, and register the converter. If you ship a closed-source product and cannot distribute GPL code to your customers, use the proprietary DWG parser instead.
→ Commercial parser: PROPRIETARY-PARSER.md (scope, licensing, pricing, integration, GPL compliance, support)
The world’s first fully web-based DXF/DWG viewer and editor that runs entirely in the browser — no backend server required.
See the codeEnglish | 简体中文 | 日本語 | 한국어 | Español | Português | Русский | Čeština
cad-viewer is the first web-based DXF/DWG viewer and editor in the world that operates entirely in browser, without relying on any backend services.
By performing DWG/DXF parsing, geometry processing, and rendering directly in the browser, cad-viewer enables true serverless CAD viewing and editing, ideal for cloud apps, offline usage, and privacy-sensitive workflows.
It also offers something you will rarely find in other CAD viewers—one-click export to a single, self-contained HTML file. The downloaded .html embeds the drawing snapshot and a lightweight viewer runtime, so recipients can open, pan, zoom, toggle layers, and measure distances in any modern browser with no CAD app, no server, and no install. Most desktop and web CAD viewers only let you view inside their own product; cad-viewer turns a live drawing into a portable, offline artifact you can email, archive, or drop on a static file host—ideal for sharing with clients, compliance archives, and air-gapped workflows. The offline viewer also uses far less memory than traditional desktop tools when opening the same drawing (see memory comparison below).
The Thingraph team builds production DWG/DXF viewers and platform integrations on top of cad-viewer, serving tens of thousands of users worldwide:
.dwg / .dxfCommunity apps & integrations:
Community Linux desktop packages:
Official sample apps that show how to integrate cad-viewer into your own product:
@mlightcad/cad-simple-viewer: open local or CDN DXF/DWG, drive commands from a small toolbar, and lazy-load HTML/PDF/SVG export plugins without the full Vue UI.@mlightcad/cad-viewer with menus, ribbons, dialogs, command line, and status bar (live demo).cad-simple-viewer) or server-side ACEX prerender (faster load, lower memory).
@mlightcad/cad-simple-viewer, so mobile browsers work without a separate app.html file with an embedded viewer (pan/zoom, zoom extents, layers, distance measure, EN/ZH UI). Opens offline in any browser; no cad-viewer instance or backend required.Add DWG/DXF viewing to any website with a single <iframe>—no CAD backend, no uploading drawings to a third-party cloud. The file is fetched from your URL and parsed entirely in the visitor’s browser, with review tools (pan, zoom, measure, annotate) ready out of the box.
<iframe
src="https://mlightcad.com/embed.html?url=https://example.com/plans/floor.dwg&mode=review&toolbar=1"
style="width:100%;height:600px;border:0"
allowfullscreen>
</iframe>
Walkthrough and live playground: Embed DWG/DXF on Your Website Without Uploading a Single Byte.
git clone https://github.com/mlightcad/cad-viewer.git
cd cad-viewer
pnpm install
# Start the full-featured viewer (cad-viewer)
pnpm dev
# Or start the simple viewer
pnpm dev:simple
pnpm build
# Preview the full-featured viewer
pnpm preview
# Preview the simple viewer
pnpm preview:simple
New to CAD Viewer? The User Guide provides step-by-step instructions for the viewer interface, desktop and touch operations, markup, and measurement tools.
Del keyCAD-Viewer is built around a modular plugin system in @mlightcad/cad-simple-viewer. Plugins implement the AcApPlugin interface and hook into viewer lifecycle via onLoad / onUnload—typically to register commands, add UI, or wire export/import pipelines.
Load plugins through AcApDocManager.instance.pluginManager (loadPlugin, registerLazyPlugin, or plugins.fromConfig when creating the document manager). Export-oriented plugins support lazy loading: register a small stub up front and download the heavy bundle only when the user runs the related command (for example -chtml, or when confirming export from the chtml dialog in cad-viewer).
The monorepo ships several first-party plugins. Each focuses on one concern; combine them as needed. Installation, registration, and API details live in each package’s README—see the links below.
| Package | Role | Commands / capabilities |
|---|---|---|
@mlightcad/cad-simple-ui-plugin | Toolbar, layer manager & review palette UI for cad-simple-viewer (plain DOM, no Vue/React) | layer, markuppanel, default toolbar (view, measure, export, review, theme, locale) |
@mlightcad/cad-agent-plugin | Natural-language CAD agent (AI chat panel + drawing tool calls) | agent |
@mlightcad/cad-html-plugin | Export drawings to self-contained offline HTML | chtml (dialog in cad-viewer), -chtml (command-line) |
@mlightcad/cad-pdf-plugin | PDF export and import (vector pipeline) | cpdf, ipdf |
@mlightcad/cad-svg-plugin | SVG export and shared vector renderer (also used by PDF export) | csvg |
@mlightcad/cad-onedrive-plugin | OneDrive data source — open DWG/DXF from OneDrive / SharePoint | Registers AcApDataSource (onedrive); two-step Sign in → Open (popup-safe) |
@mlightcad/cad-google-drive-plugin | Google Drive data source — open DWG/DXF from Google Drive | Registers AcApDataSource (googledrive); two-step Sign in → Open (popup-safe) |
@mlightcad/cad-simple-ui-plugin — UI chrome for the simple viewercad-simple-viewer deliberately ships no application UI—only the canvas and CAD core. If you embed the simple viewer in your own web app and want ready-made chrome without adopting the full Vue-based cad-viewer shell, cad-simple-ui-plugin is the intended UI layer.
It provides:
COLORTHEME sysvar and --ml-ui-* CSS tokens on your host elementAcApI18n (English / Chinese / Czech / Turkish)All widgets are framework-agnostic (plain DOM). The full Vue cad-viewer app has its own Element Plus UI and does not require this plugin; use cad-simple-ui-plugin when you build on cad-simple-viewer directly.
→ Quick start, toolbar customization, and options: packages/cad-simple-ui-plugin/README.md
@mlightcad/cad-agent-plugin — AI drawing assistantcad-agent-plugin adds a natural-language CAD agent to cad-simple-viewer-based apps. Users describe what they want in plain language; the agent calls CAD tools to inspect the drawing and create or modify geometry.
It provides:
AcApPlugin (trigger command: agent) so the AI bundle is not on the critical pathAgentChatPanel) built on the Vercel AI SDK (Experimental_Agent + @ai-sdk/vue)localStorage)get_drawing_context; draw_line, draw_circle, draw_arc, draw_rectangle, draw_polyline, draw_text; set_current_layer, create_layer, zoom_extentsThe full Vue cad-viewer app registers the agent automatically when the package is installed (palette tab). cad-simple-viewer-example wires it into a dock tab via cad-simple-ui-plugin. Host apps call registerLazyAgentPlugin and setAgentPaletteOpener to mount the panel where they want.
→ Installation, registration, and tool list: packages/cad-agent-plugin/README.md
These plugins add export (and PDF import) commands to the same plugin manager. They are lazy-loaded so initial page weight stays small. The cad-simple-viewer-example demo registers all three export plugins, cad-simple-ui-plugin, and cad-agent-plugin; the full cad-viewer app registers the export plugins and the agent plugin (when installed) in its bootstrap.
When opening the sample drawing canteen.dwg, memory consumption is roughly:
| Viewer | Memory consumption |
|---|---|
| AutoCAD 2020 | 320 MB |
| GstarCAD Viewer (浩辰看图王) | 246 MB |
| Self-contained HTML (measure mode) | 56 MB |
| Self-contained HTML (view mode) | 33 MB |
The offline HTML viewer uses about 83% less memory than AutoCAD 2020 and about 77% less than GstarCAD Viewer in view mode, while still supporting pan/zoom, layer toggle, and distance measurement (measure mode).
CAD-Viewer is engineered for exceptional performance and can handle very large DXF/DWG files while maintaining high frame rates. It employs multiple advanced rendering technologies to optimize performance:
These optimizations enable CAD-Viewer to smoothly render complex CAD drawings with thousands of entities while maintaining responsive user interactions.
The default open-source DWG path is based on LibreDWG via the optional @mlightcad/libredwg-converter package. It works well for many drawings, but its entity coverage is still limited, the WASM bundle is much larger, startup is slower, memory usage is high, and very large DWG files may hit out-of-memory errors. It also introduces GPL licensing considerations for commercial closed-source products. @mlightcad/cad-simple-viewer does not depend on or register that converter by default — host apps (see the example packages) opt in explicitly.
If you need better compatibility, lower memory usage, large-file support, or a cleaner commercial licensing story, see our proprietary DWG parser.
| Item | LibreDWG-based parser | Proprietary DWG parser |
|---|---|---|
| Supported entities | Limited coverage | Broader coverage |
| Bundle size | ~13 MB | ~437 KB |
| Load speed | Slower startup | Much faster startup |
| Memory usage | Higher | Lower |
| Large DWG files | May OOM on large files | No such issue |
| License | GPL propagation risk | No GPL propagation issue |
The goal of this project is to create a full-featured 2D AutoCAD-like system in the browser (viewer + editor), with modular architecture and framework-agnostic integration.
Legend:
This roadmap is intentionally granular so contributors can clearly see what exists, what is missing, and where help is needed.
Contributions are welcome! Please open issues or pull requests for bug fixes, new features, or suggestions. For bug reports, providing a link to the problematic drawing will help in reproducing and fixing the issue.
The cad-viewer monorepo is primarily MIT licensed.
DXF loading uses the built-in MIT parser in @mlightcad/data-model. DWG loading is opt-in: @mlightcad/cad-simple-viewer does not depend on GPL LibreDWG packages. Hosts that want open-source DWG support add @mlightcad/libredwg-converter (GPL-3.0) themselves, deploy its worker + wasm, and register the converter. If you ship a closed-source product and cannot distribute GPL code to your customers, use the proprietary DWG parser instead.
→ Commercial parser: PROPRIETARY-PARSER.md (scope, licensing, pricing, integration, GPL compliance, support)