Summary
OfficeCLI Word HTML preview currently only enables scalePages() when the preview is running as the top-level window. When the generated HTML is embedded in an iframe (for example inside Cove's preview panel), landscape pages render at natural width and cannot fully fit the panel.
Repro
- Generate HTML preview for a landscape-heavy
.docx via officecli view <file.docx> html --json.
- Render the returned HTML inside an iframe with a fixed-width container.
- Observe that pages keep natural width because
window.top !== window.self, so the built-in fit-to-width logic is skipped.
Expected
Embedded preview should keep the same fit-to-width behavior as the standalone HTML preview, with an explicit opt-out only when a host truly wants native page width.
Acceptance Criteria
Summary
OfficeCLI Word HTML preview currently only enables
scalePages()when the preview is running as the top-level window. When the generated HTML is embedded in an iframe (for example inside Cove's preview panel), landscape pages render at natural width and cannot fully fit the panel.Repro
.docxviaofficecli view <file.docx> html --json.window.top !== window.self, so the built-in fit-to-width logic is skipped.Expected
Embedded preview should keep the same fit-to-width behavior as the standalone HTML preview, with an explicit opt-out only when a host truly wants native page width.
Acceptance Criteria