Skip to content

Release Upgrade Notes ​

This page records public API and module-level upgrade changes for @mlightcad/cad-simple-viewer, @mlightcad/cad-editor, and related packages, organized by release. For how to move the whole package set to a target version, see the Synchronized Upgrade Guide.

Latest: Options, PICKBOX, and default navigation quality ​

PICKBOX matches AutoCAD height semantics

Starting with the release that includes this change (and a matching @mlightcad/data-model), PICKBOX is the full object-selection target height in pixels — the same meaning as AutoCAD — not a half-size. The default changes from 10 to AutoCAD’s 3 (range 0–50). The Options dialog preview, crosshair pickbox, and pick hit radius (selectionBoxSize = PICKBOX / 2) all follow that value. If you previously stored a large PICKBOX under the old half-size interpretation, re-tune it after upgrading.

Default pan/orbit quality is full detail

Starting with the release that includes this change, AcApSettings.navigationQuality defaults to quality (was performance) so middle-button pan keeps all detail. Performance / Balanced still hide objects under 6 / 3 pixels while gesturing. Options → Display and the status-bar Orbit menu share the same three-way control.

Migrate hosts that relied on the old always-on culling default:

  • configure({ defaults: { navigationQuality: 'performance' } }) before first accessing AcApSettingManager.instance.
  • Drop any use of the short-lived isNavigationLodEnabled setting if you adopted a preview build; stored copies are stripped on load.

Configurable mouse bindings

The release also adds AcApSettings.mouseBindings. The built-in gestures preserve the previous controls. Code constructing a complete AcApSettings object must add mouseBindings, for example mouseBindings: acapDefaultMouseBindings(); callers using Partial<AcApSettings> need no change. Hosts can use acapResolveMouseBindings to validate partial defaults before passing them to configure. Saved mouse preferences override host defaults; restoring built-in defaults in the dialog saves those defaults as the user's preference.

1.8.2: Navigation and UCS preferences ​

This release adds the AcApSettings.navigationQuality preference and host defaults through AcApSettingManager.configure({ defaults }). Existing hosts need no migration: built-in defaults apply automatically, user preferences override host defaults, and the new free-orbit methods on AcTrView2d are additive. Configure host defaults before first accessing AcApSettingManager.instance. See also the Default pan/orbit quality is full detail note above for the later default change.

Settings migration

The old boolean navigationPerformance setting is migrated automatically to navigationQuality (true → 'performance', false → 'quality'), and the obsolete ucsIconVisible / ucsIconOpacity keys are removed. Users do not need to clear localStorage.

ViewCube navigation, UCS display, and UI commands

This release adds AutoCAD-style ViewCube 3D navigation (26 clickable faces / edges / corners, drag orbit, SW isometric home), new additive AcTrView2d APIs such as canOrbit, isFreeOrbit, and setFreeOrbitEnabled, and shows the UCS icon Z axis when the view is tilted.

@mlightcad/cad-simple-viewer also registers COMMANDLINE / COMMANDLINEHIDE, RIBBON / RIBBONCLOSE, and SHORTCUTTOOLBAR / SHORTCUTTOOLBARHIDE, and adds the read-only RIBBONSTATE system variable (always kept in sync with isShowRibbon).

isShowShortCutToolbar is now honored only on handheld devices, and isShowViewCubeCompass only on desktop browsers; both use device type rather than viewport width. Existing hosts need no migration.

1.8.1: Visual styles and shading ​

SHADEMODE / VSCURRENT

This release registers SHADEMODE (alias SHADE) and VSCURRENT (alias VS), which switch sub-mesh drawing between 2Dwireframe / 3Dwireframe / Gouraud, and adds AcApVisualStyleService and ACAP_MESH_VISUAL_STYLE_PRESETS in @mlightcad/cad-simple-viewer. The visual style is written to the drawing's ACAD_VISUALSTYLE dictionary and the active viewport's renderMode, and round-trips through DXF.

Hatch background color HPBACKGROUNDCOLOR now carries through the viewer, PDF, and HTML export. There are no breaking host API changes in this release; data-model / libredwg-converter / libredwg-web move together to 1.16.9 / 3.16.9 / 0.9.6.

1.8.0: Plugin UI, PDF import/export, groups and arrays ​

Plugin UI comes from AcApUiRegistry

Starting with the release that includes this change, ribbon groups, File → Export rows, simple-UI toolbar buttons, and palette tabs that belong to a plugin are declared by that plugin's /register module through AcApUiRegistry. The host draws whatever is registered. A package that is not installed contributes no UI.

Migrate hosts and plugins:

  • @mlightcad/cad-editor no longer hardcodes Agent, model settings, script, PDF, HTML, or SVG buttons. It loads @mlightcad/cad-pdf-plugin/register, @mlightcad/cad-html-plugin/register, and @mlightcad/cad-svg-plugin/register with dynamic import(), the same way it already loads the agent, LLM, script, and PaddleOCR packages. Keep those specifiers external when bundling the editor.
  • The store.features flags (agentPlugin, llmPlugin, paddleOcrPlugin, scriptPlugin) are removed.
  • A plugin calls AcApUiRegistry.register from /register with ribbon groups, file.export menu rows, a palette mount, and locale messages. The button exists as soon as /register runs. The heavy module still loads on the command.
  • Simple UI builds its export menu and extra toolbar buttons from the same registry. Remove handwritten Agent and Script toolbar items.
  • setAgentPaletteOpener and setCadScriptPaletteOpener remain for hosts that do not open registry palette ids. cad-editor and simple UI open those ids themselves.
  • chtml and cpdf open framework-free dialogs that live in cad-html-plugin and cad-pdf-plugin. /register claims those commands in the browser; OK loads the plugin through -chtml / -cpdf. Headless hosts pass dialog: false so chtml and cpdf stay command-line prompts. The Vue dialogs MlExportHtmlDlg / MlExportPdfDlg and the editor command classes are removed.

Simple UI chrome moves into cad-simple-viewer

Starting with the release that includes this change, @mlightcad/cad-simple-ui-plugin is removed. Toolbar presets, dock palette tabs (layers / find / review / measurements), theme sync, and the default AcApPaletteHost live in @mlightcad/cad-simple-viewer (types under src/ui/).

Migrate hosts:

  • Uninstall @mlightcad/cad-simple-ui-plugin and drop acuiRegisterSimpleUiPlugin / acuiCreateSimpleUiPlugin imports from that package.
  • Prefer AcApDocManager.createInstance({ simpleUi: { … } }) (default on). Pass former plugin options through simpleUi. Use simpleUi: false for cad-editor, CLI, MCP, and other headless hosts.
  • Import types/helpers from @mlightcad/cad-simple-viewer (the /simple-ui and /find package subpaths are removed).
  • Await AcApDocManager.instance.simpleUiReady (or read simpleUi) instead of pluginManager.getPlugin('SimpleUiPlugin') / the former simpleUiPlugin getter.
  • cad-editor keeps its Vue layer manager; find / design-review / measurements use the shared DOM palette views.

Dock panel chrome moves to cad-simple-viewer

The plain-DOM dock panel chrome (AcUiDockPanel) lives in @mlightcad/cad-simple-viewer. Built-in simple UI chrome mounts tab content (layers, find, review, measurements) and registers an AcApPaletteHost on that dock; cad-editor registers its Vue tool-palette host instead.

Migrate hosts / plugins:

  • Import AcUiDockPanel, AcUiDockPanelTab, and AcUiDockPanelSide from @mlightcad/cad-simple-viewer.
  • Dock chrome i18n keys live under main.dockPanel.* (including main.dockPanel.tab.layers and friends).
  • AcApPaletteService.open without a registered host uses a real AcUiDockPanel (right dock / phone sheet).
  • Named built-in tabs open through AcApPaletteService.openNamedTab / optional AcApPaletteHost.openNamedTab (ids in ACAP_PALETTE_NAMED_TAB) and require a registered host — there is no dock fallback for named tabs. Opens requested before a host is registered are queued and flushed when the host arrives (covers the async simpleUi load gap). Hosted HTMLElement panels still use AcApPaletteService.open.

Local PaddleOCR (@mlightcad/cad-paddleocr-plugin)

Starting with the release that includes this change, hosts can install @mlightcad/cad-paddleocr-plugin for in-browser OCR of exploded PDF text (pdftext / PDF import OCR). It registers the paddleocr recognizer in AcApTextRecognitionService. Wasm and ONNX models load only on the first OCR request. The PDF import “Recognize exploded text” list shows each available OCR option: local PaddleOCR and every configured vision-capable LLM model (e.g. kkidc — model-id), not one row per provider.

Migrate hosts:

  • Install @mlightcad/cad-paddleocr-plugin and call registerLazyPaddleOcrPlugin before registerLazyLlmPlugin, so unread lines still fall back to the vision LLM. @mlightcad/cad-editor does this when the package is installed.
  • Serve ONNX Runtime Web wasm files from a same-origin path (demos use ./vendor/onnxruntime/) and pass wasmPaths to registerLazyPaddleOcrPlugin.
  • AcApTextRecognitionService.has(id) can check whether a given recognizer is registered (for example skip the “OCR not configured” LLM hint when paddleocr is present).
ts
import { registerLazyPaddleOcrPlugin } from '@mlightcad/cad-paddleocr-plugin/register'
import { registerLazyLlmPlugin } from '@mlightcad/cad-llm-plugin/register'

registerLazyPaddleOcrPlugin(pluginManager, {
  wasmPaths: './vendor/onnxruntime/'
})
registerLazyLlmPlugin(pluginManager)

Shared AI model settings (@mlightcad/cad-llm-plugin)

Starting with the release that includes this change, the LLM provider settings move out of @mlightcad/cad-agent-plugin into the new @mlightcad/cad-llm-plugin, so the CAD Agent and pdftext text recognition (OCR) share one configuration. The new package adds the LLMSETTINGS command, a framework-free settings dialog (also on the AI ribbon tab of @mlightcad/cad-editor), and @mlightcad/cad-simple-viewer adds AcApLlmSettingsService so any feature can open the dialog or check whether a vision model is configured.

Migrate hosts:

  • Install @mlightcad/cad-llm-plugin (now a peer dependency of @mlightcad/cad-agent-plugin) and call registerLazyLlmPlugin next to registerLazyAgentPlugin. @mlightcad/cad-editor does this on its own when the package is installed.
  • registerLazyAgentPlugin no longer registers a text recognizer. The recognizer is now cad-llm (was cad-agent) and comes from registerLazyLlmPlugin. acapAgentRecognizeText / cleanRecognizedText are now acapLlmRecognizeText / acapLlmCleanRecognizedText in @mlightcad/cad-llm-plugin.
  • The agent panel's inline settings card is replaced by the dialog; its gear button opens LLMSETTINGS.
  • Saved settings are kept: the localStorage key cad-agent-plugin.llm-config is unchanged.
  • OCR falls back to the first image-capable configured model when the model in use is text-only.
ts
import { registerLazyAgentPlugin } from '@mlightcad/cad-agent-plugin/register'
import { registerLazyLlmPlugin } from '@mlightcad/cad-llm-plugin/register'

registerLazyLlmPlugin(pluginManager)
registerLazyAgentPlugin(pluginManager)

Import PDF: ipdf is now PDFIMPORT / -PDFIMPORT

Starting with the release that includes this change (1.8.0), the PDF import command of @mlightcad/cad-pdf-plugin takes AutoCAD's names:

  • PDFIMPORT opens an Import PDF dialog (AcUiPdfImportDialog) after the file is picked: page with preview, insertion point (X/Y or on-screen), scale and mode (Recover drawing / Keep PDF appearance).
  • -PDFIMPORT keeps the command-line prompts ipdf had (page, insertion point with Scale and Mode). Its class is AcApImportPdfPromptCmd.

Migrate: ipdf no longer exists. Scripts that ran executeCommand('ipdf') and answered prompts should run -pdfimport; hosts that render their own ribbon should use pdfimport (the cad-editor ribbon item id is now cmd-pdfimport). The command descriptions move from command.ACAD.ipdf to command.ACAD.pdfimport / command.ACAD.-pdfimport, and the prompt strings from jig.ipdf to jig.pdfimport (dialog strings under jig.pdfimport.dialog). AcApPdfImportConvertor.importFromFilePicker now shows the dialog; importFromCommandLine is the prompt flow.

Smart Blocks: Search and Convert (BSEARCH)

Starting with the release that includes this change, @mlightcad/cad-simple-viewer registers -BSEARCH and @mlightcad/cad-editor adds BSEARCH (alias BCONVERT) with a Search and Convert palette tab (list of found instances) and a Convert to Block dialog (Insert and AI ribbon tabs).

Shape matching moved from @mlightcad/cad-pdf-plugin to @mlightcad/cad-simple-viewer. Migrate imports:

@mlightcad/cad-pdf-plugin (deprecated)@mlightcad/cad-simple-viewer
findPdfShapeMatchesacedFindShapeMatches
applyPdfAffineacedApplyAffine2d
pdfEntityToFeatureacedEntityToShapeFeature(entity, id, { matchLayer: false })
PdfMatchFeature / PdfAffine / PdfShapeMatch / PdfShapeMatchOptionsAcEdShapeFeature / AcEdAffine2d / AcEdShapeMatch / AcEdShapeMatchOptions

The old names still work as deprecated aliases. Text strings moved from the feature kind to label (compare with ignoreLabels: false, the default). The @mlightcad/cad-pdf-plugin pdfblock command is removed; use BSEARCH / -BSEARCH instead (after PDF import, turn off layer matching — PDF layers are by color).

AutoCAD groups (GROUP / PICKSTYLE / GROUPDISPLAYMODE)

Starting with the release that includes this change, @mlightcad/cad-simple-viewer registers GROUP, -GROUP, UNGROUP, and GROUPEDIT, expands selection when PICKSTYLE is 1 or 3, and applies GROUPDISPLAYMODE grips for selectable groups. @mlightcad/cad-editor adds CLASSICGROUP (Object Grouping dialog) and a Home → Groups ribbon panel.

Requires @mlightcad/data-model that registers PICKSTYLE (0–3, default 1) and GROUPDISPLAYMODE (0–2, default 2). Associative hatch co-selection (PICKSTYLE 2/3) expands hatch ↔ boundary soft-pointers (DXF 97/330) stored on AcDbHatch.

Associative hatch soft-pointers (DXF 71 / 97 / 330)

Starting with the release that includes this change, @mlightcad/data-model stores per-path source boundary object ids on AcDbHatch (pathSourceIds / setPathSourceIds), round-trips them through DXF groups 71, 97, and 330, and rebuilds hatch loops when a linked boundary is modified (or disassociates when the last source is erased) via AcDbDatabase.hatchAssociationIndex. AcApHatchCmd attaches source ids when creating associative hatches from selected boundaries; pick-points without recoverable sources stay non-associative.

Associative arrays (ARRAY / ARRAYRECT / ARRAYPOLAR / ARRAYPATH / ARRAYEDIT / ARRAYCLOSE)

Starting with the release that includes this change, @mlightcad/data-model adds an ObjectARX-style associative framework under object/assoc/ (AcDbAssocNetwork, AcDbAssocAction, AcDbAssocDependency, AcDbAssocArrayActionBody, rectangular / polar / path parameters). Associative arrays are still drawn as an AcDbBlockReference of an anonymous *U block; the action body owns the parameters and rebuilds item transforms on evaluate.

@mlightcad/cad-simple-viewer registers ARRAY, -ARRAY, ARRAYRECT, ARRAYPOLAR, ARRAYPATH, ARRAYEDIT, and ARRAYCLOSE (alias AR → ARRAY). Defaults: ARRAYASSOCIATIVITY (0 / 1, default 1), ARRAYTYPE (0 rectangular / 1 path / 2 polar, default 0), read-only ARRAYEDITSTATE (0 / 1, default 0; hosts use setArrayEditState). ARRAYCLOSE is registered for AutoCAD parity; until ARRAYEDIT Source mode is implemented it reports that the drawing is not in array edit state. EXPLODE on an associative array yields independent leaf entities and tears down the action graph; array grips adjust column / row / item counts. Creation shows a live preview (not gated by COMMANDPREVIEW). @mlightcad/cad-editor adds a Home → Modify Array dropdown (rectangular / polar / path).

Migrate hosts:

  • Bump @mlightcad/data-model (and libredwg-converter if you load DWG) together with @mlightcad/cad-simple-viewer / @mlightcad/cad-editor — the viewer calls AcDbAssocManager.evaluateTopLevelNetwork at the end of write commands.
  • New public APIs include AcDbAssocArray.createArray / AcDbAssocArrayActionBody.createInstance, acdbAllocateAnonymousUserBlockName, AcDbSysVarManager.setArrayEditState, and curve helpers getPointAtDist / getFirstDeriv on AcDbCurve.
  • DWG note: LibreDWG may not round-trip assoc objects yet; an array opened from DWG can appear as a plain INSERT without an action body. Prefer DXF for associative-array persistence until DWG import is extended.

cad.view.capturePreview selection preview

Starting with the release that includes this change, CadSession.capturePreview takes an options object instead of a bare longSide number (a bare positive number is still accepted as longSide):

ts
capturePreview?(options?: {
  longSide?: number
  selection?: boolean
}): Promise<CaptureDrawingPreviewResult>

Script callers use cad.view.capturePreview({ longSide?, selection? }). Pass selection: true after cad.selection.replace(ids) to extract the selected entities via the same batch-preview path as ENTPREVIEW (scene bounds, not database geometricExtents) and attach a PNG to the tool result. Empty selection returns reason: 'no-selection'. Headless createDatabaseSession still skips previews (no renderer).

cad.view.capturePreview layer preview

Starting with the release that includes this change, CadCapturePreviewOptions adds layers?: string | string[], and CaptureDrawingPreviewFailure adds 'no-layers':

ts
cad.view.capturePreview({ layers: ['WALL', 'DOOR'], longSide: 1024 })

Only model-space geometry on those layers is rendered (an INSERT contributes just its fragments on those layers), framed to the combined extents of the layers instead of the whole drawing. Names are case-insensitive; unknown names throw while the script runs; layers cannot be combined with selection: true. normalizeCadCapturePreviewOptions now returns NormalizedCadCapturePreviewOptions (with layers as a de-duplicated string[]). Custom CadSession.capturePreview implementations should honor options.layers or return reason: 'no-layers'. The viewer implementation uses the new AcApEntityPreviewConvertor.captureLayers(layerNames, longSide).

Lightweight file-open landing entry

Starting with 1.8.0, @mlightcad/cad-simple-viewer exposes a DocManager-free subpath for landing pages. Prefer acuiCreateFileOpenSession (lazy createDocManager + auto open / attachSourcesTo). Use AcUiFileOpenLanding when you open drawings yourself (e.g. Vue MlCadViewer):

ts
import { acuiCreateFileOpenSession } from '@mlightcad/cad-simple-viewer/file-open-panel'

Use this on the home / file-picker screen so the full viewer stays lazy until a drawing opens. The Vue editor counterpart is @mlightcad/cad-editor/locale for i18n without mounting MlCadViewer.

Full walkthrough: File Open Panel. Cloud source contracts: Data Source Plugin.

Package renamed: @mlightcad/cad-viewer → @mlightcad/cad-editor

Starting with 1.8.0, the package previously published as @mlightcad/cad-viewer is now @mlightcad/cad-editor, so that its name matches what it actually does.

  • The old package is frozen. @mlightcad/cad-viewer stops at 1.7.x and no release after that will appear on the registry, so pnpm add @mlightcad/cad-viewer@1.8.0 fails with a 404. The project is still maintained — just under the new name.
  • Nothing else changed. Only the package name and the emitted artifact filenames moved; the exports (MlCadViewer, i18n, …) and their usage are identical.
  • Rename as part of the same upgrade, so the viewer stays on the same version as the rest of the package set:
diff
  {
    "dependencies": {
-     "@mlightcad/cad-viewer": "1.7.8",
+     "@mlightcad/cad-editor": "1.8.0",
      "@mlightcad/cad-simple-viewer": "1.8.0"
    }
  }
diff
- import { MlCadViewer, i18n } from '@mlightcad/cad-viewer'
+ import { MlCadViewer, i18n } from '@mlightcad/cad-editor'

If you pin CDN files by version (jsDelivr, unpkg, …), update the filenames as well:

diff
- https://cdn.jsdelivr.net/npm/@mlightcad/cad-viewer@1.7.8/dist/cad-viewer.js
- https://cdn.jsdelivr.net/npm/@mlightcad/cad-viewer@1.7.8/dist/cad-viewer.css
+ https://cdn.jsdelivr.net/npm/@mlightcad/cad-editor@1.8.0/dist/cad-editor.js
+ https://cdn.jsdelivr.net/npm/@mlightcad/cad-editor@1.8.0/dist/cad-editor.css

The repository name did not change

The GitHub repository is still mlightcad/cad-viewer, and the docs site and live demos keep their existing paths. Only the npm package name changed, so every repository and issue link in this guide still works.

:::

HTML export public API renamed (AcExHtml / acexHtml)

Starting with 1.8.0, the public types and functions of @mlightcad/cad-html-core (re-exported by @mlightcad/cad-html-plugin) use the layer prefixes AcExHtml* (types) and acexHtml* (functions), matching the convention used elsewhere in the monorepo.

Behavior is unchanged; only the symbol names moved. Update imports when you upgrade from 1.7.x:

diff
  import {
-   type AcExSnapshot,
-   buildAcExPackage,
-   zipAcExPackageFiles,
-   unzipAcExPackageFiles,
-   packHtml,
-   packHtmlPackage
+   type AcExHtmlSnapshot,
+   acexHtmlBuildPackage,
+   acexHtmlZipPackageFiles,
+   acexHtmlUnzipPackageFiles,
+   acexHtmlPackHtml,
+   acexHtmlPackHtmlPackage
  } from '@mlightcad/cad-html-plugin'

The same rename applies to other HTML-core helpers (for example captureAcExSavedViewExtents → acexHtmlCaptureSavedViewExtents, buildOsnapCatalog → acexHtmlBuildOsnapCatalog). Command-level APIs such as AcApHtmlConvertor and chtml / -chtml are unaffected. Development guides that show the new names target 1.8.0+; on 1.7.x keep using the old symbols.

Script host: create real dimension entities (drawDim*)

Starting with the release that follows 1.8.0-preview.2, cad.edit.transaction in @mlightcad/cad-script-core can create dimension entities — not only read their snapshots:

  • drawDimAligned, drawDimLinear, drawDimDiameter, drawDimRadius
  • drawDimAngular, drawDimArc, drawDimOrdinate

Agents and scripts should call these instead of approximating dimensions with lines, arrows, and text. Diameter/radius accept center + radius so a circle snapshot can feed them directly. See Script API.

Script host: per-block tallies on cad.blocks

In the release that includes this change, cad.blocks exposes per-block entityCount / typeCounts metadata — no embedded entity arrays. Prefer those fields / count(pred) for tallies. Snapshot with where / inBlock(id, pred) — bare whole-space snapshots stop at ~500 matches (too_many_matches). where / count / inBox scan model and paper spaces only (use inBlock for block definitions). Block references use type === 'BlockReference'.

SVG File → Open

Starting with 1.8.0, .svg can be opened as a drawing through the normal File → Open / openDocument / openUrl path. Vector conversion lives in the new package @mlightcad/cad-svg-converter (depends only on @mlightcad/data-model).

Integrators using @mlightcad/cad-editor: initializeCadViewer registers the converter automatically. Install @mlightcad/cad-svg-converter next to the other fixed-group packages (same version).

Integrators using only @mlightcad/cad-simple-viewer: call once at startup:

ts
import { registerSvgConverter } from '@mlightcad/cad-svg-converter'

registerSvgConverter()

Supported subset (v1): line, polyline / polygon / rect, circle, ellipse (polyline approx when non-uniform), path (tessellated), text, nested g + transforms. Export remains csvg in @mlightcad/cad-svg-plugin. Save after editing is still DXF (cdxf) or re-export SVG — there is no native SVG save.

HTML/PDF export skips empty paper layouts by default

Starting with the release that includes this change, HTML and PDF export gain exportEmptyLayouts (default false). Paper-space layouts that contain only AutoCAD's default *Paper_Space viewport are omitted unless you set the option to true. Model space is always kept when layouts are exported.

Migrate: pass exportEmptyLayouts: true (export dialog toggle, -chtml / -cpdf prompt, script cad.file.saveHtml / savePdf, or exporter CLI flags --export-empty-layouts) if you need blank paper tabs in the output.

PDF export split into a shared core (browser + Node)

Starting with 1.8.0, PDF export uses the same layering as HTML export. Shared logic lives in @mlightcad/cad-pdf-core (option model and database → PDF pipeline, no cad-simple-viewer / DOM dependency). Two front ends consume it:

PackageRole
@mlightcad/cad-pdf-pluginBrowser cpdf / -cpdf / pdfimport (and the Vue export dialog)
@mlightcad/cad-pdf-exporterHeadless Node DXF/DWG → PDF — no browser

Browser integrators — mostly unchanged. Keep using cpdf / -cpdf / pdfimport, AcApPdfConvertor, AcApPdfExportOptions, and resolveAcApPdfExportOptions. Install the new peer @mlightcad/cad-pdf-core next to the plugin (same version as cad-simple-viewer).

User-facing API / behaviour deltas:

  • New option colorMode: 'color' | 'monochrome' (default 'color'). Available in the cpdf dialog, as the last -cpdf prompt (Color / Monochrome), and on AcApPdfExportOptions. Existing -cpdf scripts must answer that prompt (or send an empty line for the default) after the text-mode answer.
  • Headless / CI without a browser: use @mlightcad/cad-pdf-exporter (exportFileToPdf, convertDatabaseToPdf) instead of driving cpdf through Playwright.
ts
// Browser (names unchanged)
import {
  AcApPdfConvertor,
  resolveAcApPdfExportOptions
} from '@mlightcad/cad-pdf-plugin'

await new AcApPdfConvertor().convert(
  context,
  resolveAcApPdfExportOptions({ colorMode: 'monochrome' })
)

// Node, no browser
import { exportFileToPdf } from '@mlightcad/cad-pdf-exporter'

await exportFileToPdf('drawing.dwg', 'drawing.pdf', {
  colorMode: 'monochrome'
})

Advanced callers that talk to the shared pipeline directly use acexPdfExportDatabase / acexPdfResolveExportOptions from @mlightcad/cad-pdf-core. See the package READMEs for fonts, layouts, and text mode.