Let a document be printed on A4 or US Letter, either way up (#344) #1084
No reviewers
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo!1084
Loading…
Reference in a new issue
No description provided.
Delete branch "344-paper-sizes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Every document was A4 portrait: a constant for Chromium, another in the
Word and OpenDocument writers, and
size: A4in every theme. Nobody couldchoose a paper, and a theme could not say what it prints on.
documents/paper.py is the vocabulary: four papers (A4 and US Letter,
portrait and landscape), what a theme declares, and the page rule. Theme
gains
papers, a list for every kind or a mapping per kind, each entry apaper's key or "any"; a theme that declares nothing is A4 portrait only.
Plain and Classic are fluid and declare "any".
Postulo writes the page rule, not the theme: one
@page { size: … }and a<meta name="postulo-paper">are written last in the document's head (withthe preview's nonce), so a theme's own rule loses to it, and the themes'
size: A4is gone. The template is handedpapertoo. WeasyPrint readsthe rule; Chromium reads the meta and is given the width and height in
place of PAGE_FORMAT; the outline carries the paper, and the Word writer
sets pgSz (with w:orient) and the OpenDocument writer the page layout.
documents/paper_choice.py is the chain: SiteSettings.default_paper (Server
settings > Defaults > Documents; blank is A4 portrait), then
Profile.paper (Settings > Export > Paper; blank follows the instance),
then one export's choice. A default the theme does not print on gives way
to A4 portrait, or the theme's first paper; a paper asked for one export
that the theme does not print on raises CannotRender, said on the page.
The CV page offers the paper beside Download draft PDF, posted with the
file-properties form by Export PDF, the draft and every format; the
letter's draft and the report's page offer it too, and the errands carry
it. The picker offers only what the theme prints on and says why where
that is fewer than four. Record what you sent draws on the default.
The account archive moves to format 79 and carries
paperon theprofile, read back against the column's choices. Migrations
accounts/0051_paper and core/0040_default_paper. The render tests draw
each built-in theme's every kind, the report included, on each paper and
measure the page; tests/test_paper_sizes.py holds the rest, with Chromium
drawing each paper where a browser launches.
Closes #344
Notes for review
documents/paper.py). The choice runs from the instance's default (Server settings → Defaults → Documents), to the person's (Settings → Export → Paper), to one export's choice. The picker sits on the CV page, the letter's draft and the report.Theme.papers, a list or a mapping by kind). One that declares nothing gets A4 portrait only. Plain and Classic declare"any", andsize: A4is gone from every theme template.@page { size: … }itself. Chromium, DOCX and ODT honour the choice too; ODT also hard-coded A4 before.accounts 0051_paper,core 0040_default_paper. Archive format 79, which clashes with #331 (PR #1080); the second to land takes 80.🤖 Generated with Claude Code
Every document was A4 portrait: a constant for Chromium, another in the Word and OpenDocument writers, and `size: A4` in every theme. Nobody could choose a paper, and a theme could not say what it prints on. documents/paper.py is the vocabulary: four papers (A4 and US Letter, portrait and landscape), what a theme declares, and the page rule. Theme gains `papers`, a list for every kind or a mapping per kind, each entry a paper's key or "any"; a theme that declares nothing is A4 portrait only. Plain and Classic are fluid and declare "any". Postulo writes the page rule, not the theme: one `@page { size: … }` and a `<meta name="postulo-paper">` are written last in the document's head (with the preview's nonce), so a theme's own rule loses to it, and the themes' `size: A4` is gone. The template is handed `paper` too. WeasyPrint reads the rule; Chromium reads the meta and is given the width and height in place of PAGE_FORMAT; the outline carries the paper, and the Word writer sets pgSz (with w:orient) and the OpenDocument writer the page layout. documents/paper_choice.py is the chain: SiteSettings.default_paper (Server settings > Defaults > Documents; blank is A4 portrait), then Profile.paper (Settings > Export > Paper; blank follows the instance), then one export's choice. A default the theme does not print on gives way to A4 portrait, or the theme's first paper; a paper asked for one export that the theme does not print on raises CannotRender, said on the page. The CV page offers the paper beside Download draft PDF, posted with the file-properties form by Export PDF, the draft and every format; the letter's draft and the report's page offer it too, and the errands carry it. The picker offers only what the theme prints on and says why where that is fewer than four. Record what you sent draws on the default. The account archive moves to format 79 and carries `paper` on the profile, read back against the column's choices. Migrations accounts/0051_paper and core/0040_default_paper. The render tests draw each built-in theme's every kind, the report included, on each paper and measure the page; tests/test_paper_sizes.py holds the rest, with Chromium drawing each paper where a browser launches. Closes #344 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>bd01b96cccfddcca5272fddcca5272c9523eceae