Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ How the project is developed and shipped is documented separately:
- Undo and redo for strokes, erasing, containers, text edits, and transformations
- Versioned ZIP-based `.wboard` documents with an embedded `preview.png`. Explorer shows that picture as the file thumbnail in the released install. The VS Code extension in `vscode/sqlbi-whiteboard` opens the same picture instead of the ZIP.
- Markdown `.wimport` recipes that build image and text containers from headings
- **File → Export** to PowerPoint: the board is cut into areas where it is empty, one slide per area with the text containers in the speaker notes and an overview slide first. The dialog shows the areas numbered on the board and updates as the settings change. [docs/export.md](docs/export.md) explains how areas are chosen
- **File → Export** to PowerPoint or PDF: the board is cut into areas where it is empty, one slide or page per area, with an overview first. A deck carries the text containers in the speaker notes; a PDF has a bookmark per page and can put the whole board on one page to zoom into. The dialog shows the areas numbered on the board and updates as the settings change. [docs/export.md](docs/export.md) explains how areas are chosen
- An intentionally small floating toolbar
- A File / Edit / View / Help tab strip. Click a tab for a one-row command strip over the canvas
- Preferences for the startup monitor, full-screen start, finger drawing, mouse drawing, the pen button, snippet format order, laser trail timing and weight, toolbar position and layout, keeping the Eraser on the toolbar for a pen that has no reverse end, and (except Store installs) a daily new-version check
Expand Down Expand Up @@ -203,7 +203,7 @@ Use **Copy settings** after finding a useful combination so the exact values can
| Escape | Cancel the active text edit, close the command strip, or leave full screen or canvas only |
| Ctrl+S / Ctrl+O | Save / open a board |
| Shift+F12 | Save As |
| Ctrl+E | Export the board to PowerPoint |
| Ctrl+E | Export the board to PowerPoint or PDF |
| Delete | Delete the selected container and its linked strokes |
| Alt+L | Laser pointer |
| File / Edit / View / Help | Tab strip. Click a tab for a one-row command strip over the canvas. Click the canvas to hide it |
Expand Down
17 changes: 13 additions & 4 deletions docs/decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ else.

## 26. Export cuts the board where it is empty

**Implemented for PowerPoint.** The plan, with the alternatives, is
**Implemented for PowerPoint and PDF.** The plan, with the alternatives, is
[export.md](export.md); the calls made while building it are in
[export-decisions.md](export-decisions.md).

Expand All @@ -582,9 +582,18 @@ full HD, so calligraphy, the highlighter, and SVG come out as they are seen. The
containers go in the speaker notes so DAX and SQL can still be copied. An editable deck,
with native text boxes and images, is a later phase.

`DocumentFormat.OpenXml` writes the file: Microsoft's own SDK, MIT, managed-only, so it
passes the tests decision 21 set for a dependency. The writer lives in a new assembly,
`SQLBI.Whiteboard.Export`, with no WPF dependency, which the signing step lists.
`DocumentFormat.OpenXml` writes the deck and `PdfSharp` the PDF: Microsoft's own SDK and
a long-lived MIT library, both managed-only, so they pass the tests decision 21 set for a
dependency. The writers live in a new assembly, `SQLBI.Whiteboard.Export`, with no WPF
dependency, which the signing step lists.

A PDF page is also a picture, for now. PDF has one freedom a slide lacks, a page of any
size, and the export uses it: the whole board can go on one page the shape of the board,
rendered at up to six thousand pixels on the longer edge, for a reader who zooms. Pages get
a bookmark each and a footer with the board name, date, and page number. Vector pages,
with selectable text and ink as paths, are a later phase, and so is Print through
Microsoft Print to PDF, which was weighed as the zero-dependency route and kept for later
because the driver, not the application, asks for the file name.

---

Expand Down
19 changes: 19 additions & 0 deletions docs/export-decisions.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,22 @@ which phase made it and why.
the pipeline's signing step. The smoke test project references it to open the produced
deck, which means the core-only verification now restores the Open XML SDK package; it
still needs no WPF.

## E2 — PDF

- **PDF is a choice in the same dialog**, not a second command. The dialog relabels itself
(pages rather than slides), hides the slide size and the notes switch, and shows the
page size and the footer switch. The preview and the areas are the same.
- **Pages are landscape only**, A4 or Letter. Boards are landscape; a portrait option
was left out until someone asks.
- **Each page has a header line with the area's title** as well as the bookmark, so a
printed page says what it is. The footer (board name, date, page n of m) is a switch, on
by default.
- **No notes in a PDF.** There is nowhere for them that is not the page, and the text is
in the picture already. Selectable text is what the vector phase brings.
- **The whole-board page is rendered at up to 6000 pixels on the longer edge** and sized
at 144 dpi, so a 6000-pixel board becomes a 41-inch page, under the 200-inch limit
viewers enforce. It has no header or footer: the page is the board.
- **The overview page** works as for the deck: first, only with two or more areas.
- **`PdfSharp` 6.2.4** is the writer, MIT and managed-only. Fonts come from the Windows
fonts folder through its platform resolver; the export runs only on Windows.
1 change: 1 addition & 0 deletions site/guide.html
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,7 @@ <h3 id="liveview">LiveView</h3>
<h3>Files</h3>
<p>The <span class="ui">File</span> row holds five commands: <span class="ui">New</span>, <span class="ui">Open</span>, <span class="ui">Save</span>, <span class="ui">Save As</span>, and <span class="ui">Export</span>. <kbd>Ctrl</kbd><span class="plus">+</span><kbd>S</kbd> and <kbd>Ctrl</kbd><span class="plus">+</span><kbd>O</kbd> save and open a <code>.wboard</code> without opening the row at all.</p>
<p><span class="ui">Export</span> (<kbd>Ctrl</kbd><span class="plus">+</span><kbd>E</kbd>) writes the board as a PowerPoint deck. The board is cut into areas wherever it is empty: a picture or a note keeps the ink drawn on it, and a stroke that spans two of them keeps them together. Each area becomes a slide, with the text containers in the speaker notes so that DAX and SQL can be copied, and an overview slide first shows where every slide sits on the board. The dialog previews the areas, numbered, and the <span class="ui">Gap between areas</span> slider and <span class="ui">Smallest text on a slide</span> change the cut as you move them. <span class="ui">Drawing order</span> puts slides in the order the areas were begun; <span class="ui">Reading order</span> goes top-left to bottom-right.</p>
<p>Choose <span class="ui">PDF</span> in the same dialog for a document instead: the same areas, one per A4 or Letter page in landscape, each with a bookmark, and a footer with the board name, the date, and the page number. <span class="ui">Whole board on one page</span> writes a single page the shape of the board, to be read by zooming, which suits a board that is one drawing.</p>
<p>The released installer registers that type and <code>.wimport</code>. The pre-release (Dev) channel does not, so it can sit beside a released copy without stealing the file association.</p>

<figure class="fig">
Expand Down
2 changes: 1 addition & 1 deletion site/shortcuts.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ <h2><span class="secico" aria-hidden="true"><svg viewBox="0 0 24 24" fill="none"
<div class="keyrow"><span><kbd>Ctrl</kbd><span class="plus">+</span><kbd>C</kbd></span><span class="act">Copy the selection. Copying a LiveView copies its last frame as a bitmap.</span></div>
<div class="keyrow"><span><kbd>Ctrl</kbd><span class="plus">+</span><kbd>S</kbd> <span class="plus">/</span> <kbd>Ctrl</kbd><span class="plus">+</span><kbd>O</kbd></span><span class="act">Save / open a board.</span></div>
<div class="keyrow"><span><kbd>Shift</kbd><span class="plus">+</span><kbd>F12</kbd></span><span class="act">Save As. Commits an active text edit first.</span></div>
<div class="keyrow"><span><kbd>Ctrl</kbd><span class="plus">+</span><kbd>E</kbd></span><span class="act">Export the board to PowerPoint. Commits an active text edit first.</span></div>
<div class="keyrow"><span><kbd>Ctrl</kbd><span class="plus">+</span><kbd>E</kbd></span><span class="act">Export the board to PowerPoint or PDF. Commits an active text edit first.</span></div>
<div class="keyrow"><span><kbd>Delete</kbd></span><span class="act">Delete the selected container and its linked strokes.</span></div>
<div class="keyrow"><span><kbd>F2</kbd></span><span class="act">Edit the selected text container.</span></div>
<div class="keyrow"><span><kbd>F6</kbd></span><span class="act">Format DAX or SQL Server on the selected text container. In <kbd>F2</kbd>, formats in place; <kbd>Ctrl</kbd><span class="plus">+</span><kbd>Enter</kbd> then commits.</span></div>
Expand Down
19 changes: 19 additions & 0 deletions src/SQLBI.Whiteboard.Core/Settings/ExportSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ namespace SQLBI.Whiteboard.Core.Settings;
public enum ExportFormat
{
PowerPoint = 0,
Pdf = 1,
}

public enum ExportPageSize
{
A4 = 0,
Letter = 1,
}

public enum ExportPageModel
Expand Down Expand Up @@ -50,6 +57,13 @@ public sealed class ExportSettings

public ExportSlideAspect SlideAspect { get; set; } = ExportSlideAspect.Wide;

public ExportPageSize PageSize { get; set; } = ExportPageSize.A4;

/// <summary>
/// The board name, the date, and "n of m" at the foot of every PDF page.
/// </summary>
public bool IncludeFooter { get; set; } = true;

public ExportLayoutOptions LayoutOptions => ExportLayoutOptions.ForSmallestText(
SmallestTextPoints,
GapThreshold,
Expand Down Expand Up @@ -78,6 +92,11 @@ public static ExportSettings Normalize(ExportSettings? settings)
result.SlideAspect = ExportSlideAspect.Wide;
}

if (!Enum.IsDefined(result.PageSize))
{
result.PageSize = ExportPageSize.A4;
}

result.GapThreshold = double.IsFinite(result.GapThreshold)
? Math.Clamp(
result.GapThreshold,
Expand Down
Loading