openpencil/packages/docs/programmable/sdk/api/composables/use-export.md
Danila Poyarkov 2d9e83d58a
refactor(export): derive export format lists from the IO registry (#755)
The Export panel, SDK helpers, app menus, and CLI each kept their own
hand-written format lists, so new formats such as PPTX reached some
surfaces and not others.

Scene Graph now owns the persisted export-setting format ids, Core IO
adapters carry literal ids so that list is checked against real adapters,
and the panel labels, scale handling, app format types, and CLI format
validation/help are derived from the registry. PPTX joins the Export
panel as a result.
2026-09-25 15:42:42 +04:00

901 B

title description
useExport Manage export settings like scale and format for the current selection.

useExport

useExport() is the export-panel composable for selected nodes.

It manages:

  • export settings rows
  • selected node ids
  • export name labeling
  • supported scales and formats (formats ids and labeled formatOptions)

Usage

import { useExport } from '@open-pencil/vue'

const exportState = useExport()

Basic example

const {
  settings,
  nodeName,
  scales,
  formats,
  formatOptions,
  addSetting,
  updateScale,
  updateFormat,
} = useExport()

Practical examples

Add another export preset

exportState.addSetting()

Change the first export to 2x WEBP

exportState.updateScale(0, 2)
exportState.updateFormat(0, 'webp')