Skip to content

Export an editable deck: images and text as objects, ink as an overlay - #94

Merged
marcosqlbi merged 1 commit into
mainfrom
feature/export-e3-editable-deck
Sep 3, 2026
Merged

Export an editable deck: images and text as objects, ink as an overlay#94
marcosqlbi merged 1 commit into
mainfrom
feature/export-e3-editable-deck

Conversation

@marcosqlbi

Copy link
Copy Markdown
Collaborator

Why

Phase E3 of docs/export.md, on top of #93 (base is the E2 branch; retarget to main once it merges). A picture slide is exact but dead: a person who wants to rework a deck after a session needs the DAX to be text and the pictures to be pictures.

What it does

  • Slide content: Picture or Editable, a choice on the Export dialog for PowerPoint. Picture stays the default because it is exact; Editable is best effort by design.
  • Editable puts each image on the slide as a picture (PNG and JPEG bytes as they are, sniffed rather than trusted to the stored content type; SVG, BMP, and GIF rasterized at the size they take on the slide through the code the clipboard uses), each text container as a rounded text box with the language service's title as its first line and the body as runs carrying the syntax colors and weights the screen shows, a LiveView as its current frame, and all the ink as one transparent PNG over everything.
  • Placement is identical to the picture mode: the rasterizer exposes the camera it would have used, and every element is mapped through it into the same picture box.

Where the code is

  • SQLBI.Whiteboard.Export/ExportPage.cs: the element model (SlideImageElement, SlideTextElement), in page pixel space.
  • PptxDeckWriter: a slide with elements gets one shape per element in z-order; the single-picture path is unchanged.
  • SQLBI.Whiteboard/Export/EditableSlide.cs: builds the elements from an area; BoardSurface gains DrawBackground and ObjectFilter for the ink overlay.
  • Smoke tests write an editable slide and check its pictures, text box, runs, and image parts.

The smaller calls are under E3 in docs/export-decisions.md; decision 26 is updated.

🤖 Generated with Claude Code

@marcosqlbi
marcosqlbi force-pushed the feature/export-e2-pdf branch from d107052 to 27a2353 Compare September 3, 2026 18:27
@marcosqlbi
marcosqlbi force-pushed the feature/export-e3-editable-deck branch from c20fe20 to 94a3ad7 Compare September 3, 2026 18:27
Base automatically changed from feature/export-e2-pdf to main September 3, 2026 21:54
Phase of docs/export.md squashed onto its base after the previous phase merged; the tree is unchanged.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@marcosqlbi
marcosqlbi force-pushed the feature/export-e3-editable-deck branch from 94a3ad7 to 6b416d9 Compare September 3, 2026 21:54
@marcosqlbi
marcosqlbi merged commit 4ca756a into main Sep 3, 2026
5 checks passed
@marcosqlbi
marcosqlbi deleted the feature/export-e3-editable-deck branch September 3, 2026 21:58
marcosqlbi added a commit that referenced this pull request Sep 3, 2026
…#95)

## Why

Phase E4 of [docs/export.md](docs/export.md), on top of #94 (base is the
E3 branch; retarget to `main` once it merges). A picture page is exact
but soft under zoom and dead to selection. A reader who wants to copy
the DAX off a page, or print at any size, needs the text to be text and
the ink to be paths.

## What it does

- **Page content: Picture or Vector**, a choice on the Export dialog for
PDF, with Picture the default because it is exact.
- **Vector** reuses the editable slide's element list, with one
difference: the ink goes out as strokes in their own z-order between the
containers rather than as one overlay, because a path costs nothing to
layer correctly.
- **A stroke is the sweep of its nib.** For each pair of points the
writer fills the convex hull of the two nib polygons, which is exactly
the area a convex nib sweeps along a segment, and joins every hull into
one path filled once with the non-zero rule, so a translucent stroke
does not darken where it overlaps itself. The nibs follow WPF: a pen is
an ellipse whose diameter is thickness × 2 × pressure, a highlighter a
flat rectangle with no pressure drawn at half opacity when its color is
opaque, calligraphy a tall bar following pressure.
- **Text is laid out in the writer**: paragraphs on line breaks, runs
measured left to right, wrapped at the last space that fits, in the
language's font at the board's size, clipped to the container as the
board clips it. Fonts are embedded as subsets of Segoe UI and Consolas
from the Windows fonts folder, with Arial and Courier New standing in.

## Where the code is

- `SQLBI.Whiteboard.Export/ExportPage.cs`: `SlideInkElement`,
`SlideStroke`, `SlidePoint`.
- `PdfDocumentWriter`: draws elements into the rectangle the picture
would have used; the font resolver serves both families in four styles.
- `EditableSlide` builds strokes in z-order when asked; `ExportSettings`
and the dialog gain the page content choice.
- Smoke tests write a vector page with a pen, a highlighter, a
calligraphy stroke, and a dot, and check that the text's font is
embedded.

The smaller calls are under E4 in
[docs/export-decisions.md](docs/export-decisions.md); decision 26 is
updated.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant