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

Ouverte
#1,214 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
35/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
cpp
Domaine
backend

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

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.

Langage dominant
C++
Étoiles
41
Forks
10
Merge moyen
10 h 30 min
PR mergées (30 j)
342

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de opendocument-app/OpenDocument.core

Toutes les issues de opendocument-app/OpenDocument.core

Issues similaires

Plus d'issues C++

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.