A spreadsheet prints at its own width, so a wide one is cut off on the right
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 62/100
調査の方向性
Start with PrintingManager.print and PageView in the Android app to see how the print job and its PrintAttributes are built, then read document_element.cpp where .odr-sheet and translate_table_column_style fix the table width in centimetres, plus the @media print rule in odrcore's stylesheet that forces zoom:1. Decide whether to scale from the app side (mirroring suspendDarkening) or add a print stylesheet in the shared renderer, and note the <thead> ruler as optional to hide. Done means a wide sheet prints scaled to the page width instead of being clipped, verified through the app's print path or WebView print preview.
索引モデルが issue の本文から書いたものです。
説明
Reported by a user: a one-page .ods opens and displays correctly, but printing it from the phone comes out too wide and is cut off along the right edge. The same file prints correctly from a desktop. They were explicit that it is a minor annoyance for them.
Reproduced in the code rather than on paper, but the path is unambiguous.
Why it happens
A sheet is laid out at an absolute width. document_element.cpp writes each spreadsheet as a <table class="odr-sheet"> with one <col> per column carrying the document's own column width as both width and min-width (translate_table_column_style), and .odr-sheet is table-layout:fixed. The table is therefore exactly as wide as the document says, in centimetres, no matter what it is rendered onto.
On screen that is invisible, because PageView sets useWideViewPort and loadWithOverviewMode, so the WebView zooms out until the sheet fits. The core also applies a body zoom of its own.
On paper the zoom is deliberately removed. The core's stylesheet ends with
@media print{:root{--odr-zoom:1!important}body{zoom:1!important}}
commented "paper has its own geometry; beats the script's inline zoom" — which is right as far as it goes, but nothing then fits the sheet to that geometry. PrintingManager.print hands webView.createPrintDocumentAdapter() to the framework with a default PrintAttributes, and neither the app nor the core ships any other @media print rule. So the sheet is rendered at its natural width against the printable page width, and whatever does not fit is clipped.
A desktop office suite scales or paginates a sheet to the paper instead, which is why the same file is fine from a PC.
Scope
- Spreadsheets, and any other document wider than the page. Text documents are unaffected in practice because they are laid out to a page width already.
- PDFs are unaffected: they print through
PdfDocumentAdapter, not the WebView. - The "page margins" toggle cannot help here —
PaginationSettingis odrcore'stextDocumentMargin, which by its own documentation applies to text documents only.
Where a fix could go
Either side, and worth deciding deliberately:
- In the app, by asking for a page size that fits the content, or by scaling the WebView for the duration of the print job the way dark mode is already suspended for it (
suspendDarkening). - In odrcore, by giving
.odr-sheeta print stylesheet that scales the sheet down to the page, or breaks it across pages the way a spreadsheet application would.
The second is the more correct fix and helps every frontend, but it is a change to the shared renderer, so it needs its own decision.
Worth noting while in here
The printed page also carries the row and column ruler — the gutter and the A/B/C header row that document_element.cpp writes into <thead>. A spreadsheet application does not print those by default, and they add width to a page that has none to spare.
- 主要言語
- Kotlin
- スター
- 473
- フォーク
- 44
- 平均マージ
- 3時間 7分
- マージ済み PR(30日)
- 49
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
opendocument-app/OpenDocument.droid のほかの issue
-
UI
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
opendocument-app/OpenDocument.droid#724 ·
メンテナーはふだん 1 日以内に返信
-
UI
難易度 1/5 1時間未満 初心者へのやさしさ 66/100
opendocument-app/OpenDocument.droid#723 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
opendocument-app/OpenDocument.droid#484 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
opendocument-app/OpenDocument.droid#725 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
opendocument-app/OpenDocument.droid#722 ·
メンテナーはふだん 1 日以内に返信
opendocument-app/OpenDocument.droid の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
navikt/mock-oauth2-server#1129 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
-
unconfirmed
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
thunderbird/thunderbird-android#11778 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
software-mansion/enriched-markdown#1042 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
world-federation-of-advertisers/cross-media-measurement#4709 ·
メンテナーはふだん 1 日以内に返信