Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

xlsx and xls: read the print setup, so a printed sheet fits its paper

未关闭
#1,214 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
backend

调研方向

Start in internal/html/document_element.cpp at sheet_print_fit, then read ooxml_spreadsheet_document.cpp and the existing Sheet::page_layout() path. Trace how XLSX page setup, margins, column widths and defaults are read, then compare the corresponding XLS records (SETUP, margin records, COLINFO, DEFCOLWIDTH). Done means XLSX and XLS print setup and effective column widths feed the fit calculation; pagination, print ranges and repeated title rows are out of scope.

由索引模型根据 Issue 内容生成。

描述

enhancement

Split out of #816. For an ods sheet, #817, #820 and #1197 fixed the reported case: the ruler does not print, and translate_sheet writes --odr-print-fit from Sheet::page_layout(). For xlsx and xls, sheet_page_layout returns an empty layout, so a wide sheet still depends on the shrink heuristic of the browser.

Three gaps stop sheet_print_fit (internal/html/document_element.cpp) for xlsx:

  1. pageSetup and pageMargins are not read (ooxml_spreadsheet_document.cpp, // TODO pageSetup is not read). paperSize is an enumeration (ECMA-376 Part 1, 18.3.1.63), orientation turns it, and the margins are in inches. A paperWidth and paperHeight with units can replace the enumeration.
  2. A column width is in characters (ch), and css_pixels gives no answer for ch. Excel converts with the maximum digit width of the default font (7 px for Calibri 11).
  3. A column with no <col> has no width, so the sum stops. sheetFormatPr/@defaultColWidth or @baseColWidth gives the default.

xls has the same shape (SETUP, the margin records, COLINFO and DEFCOLWIDTH).

Not in scope: pagination along the columns, print ranges, and repeated title rows. #816 lists these as the larger fix.

主要语言
C++
星标
41
派生
10
平均合并
10 小时 30 分钟
30 天内合并 PR
342

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

opendocument-app/OpenDocument.core 的其他 Issue

查看 opendocument-app/OpenDocument.core 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。