Add inner and outer margin settings for booklet printing#222
Conversation
Add support for booklet-style printing with inner/outer margins that automatically adjust for left and right pages: - Add --margin-inner and --margin-outer CLI flags for booklet printing - Add validation to prevent using left/right and inner/outer together - Update CSS generation to use @page :left and :right for booklet mode - Update Typst generation to use inside/outside margins for booklet mode - Add comprehensive tests for booklet margin functionality For booklet printing, inner margins appear on the binding side (left on odd pages, right on even pages), while outer margins appear on the outer edge.
🧪 CI InsightsHere's what we observed from your CI run for 78c4b71. 🟢 All jobs passed!But CI Insights is watching 👀 |
There was a problem hiding this comment.
💡 Codex Review
mono/printpdf/pkg/converter/markdown.go
Lines 79 to 85 in 78c4b71
In booklet mode the left-page CSS applies the margins in the wrong order. resolveBookletMargins returns outerLeft for the outer edge and innerLeft for the binding edge on left pages, but the code formats @page :left { margin: %s %s %s %s } as topLeft, outerLeft, bottomLeft, innerLeft. For left pages the right margin should be the binding margin (innerLeft) and the left margin should be the outer margin (outerLeft). As written, even-numbered pages get the wide binding margin on the outer edge and the narrow outer margin on the binding side, which defeats the purpose of the new inner/outer flags. Swap the parameters so right=inner and left=outer.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Add support for booklet-style printing with inner/outer margins that automatically adjust for left and right pages:
For booklet printing, inner margins appear on the binding side (left on odd pages, right on even pages), while outer margins appear on the outer edge.