Repository navigation
Add presets and a Paper Mode link to the PDF export dialog (DSK-245) - #637
Merged
Merged
Conversation
The dialog was a long list of settings. Rescoped by the founder: presets plus Paper Mode, which already shows the document as the PDF's pages, instead of a second preview inside the dialog. - Presets: Report (the defaults: contents, page X of Y, bookmarks, high-quality images), Paper (wide margins, plain page numbers, print-quality images) and Handout (narrow margins, nothing extra, standard images). A preset sets the margins, the page furniture and the image quality, and leaves the page size and orientation alone. The dialog marks the preset its settings match, or says Custom. - "See these pages in Paper Mode" makes the dialog's page setup the document's and turns Paper Mode on, where Paper Mode can show. - Margins, page numbers, contents, outline, cover page and diagram settings fold under Advanced options. Assisted-by: Opus 5.5
Assisted-by: Opus 5.5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The export dialog was a long list of settings. The founder rescoped DSK-245 on 2026-12-01: presets plus Paper Mode, which already shows the document as the PDF's real pages, instead of a second pdf.js preview inside the dialog.
Presets (
src/ui/pdfExportPresets.ts,PdfPresetPicker.tsx):aria-labelledby,aria-describedby)."See these pages in Paper Mode", under the presets, makes the dialog's page setup the document's, turns Paper Mode on and closes the dialog. It's shown only where Paper Mode can show (Relaxed layout, writing on screen, wide enough). It was in the footer at first, which squeezed five buttons into stacked lines.
Advanced options: margins, page numbers, contents, outline, cover page and diagram settings fold under a collapsed section.
The guide (
docs-site/guide/export-import.md) describes the presets, the link and the fold.For your review: the preset values are my proposal. They're easy to change in one table.
Verification
pdfExportPresets.test.ts(7): each preset's values; recognising each; a changed mix is Custom; the format is ignored while page numbers are off.PdfPresetPicker.test.tsx(4): apply, the pressed state, Custom, names and descriptions; plus "See in Paper Mode" setting the document's page setup and turning Paper Mode on.PDFExportDialog.presets.test.tsx(3), on the rendered dialog: it opens on Report; a preset sets the margins, page numbers, contents and outline; a change makes it Custom; the advanced settings are folded.tscis clean; the suite passes 5,631 tests in 520 files; the docs link test passes. The OSS leak grep is clean.Assisted-by: Opus 5.5